From bf213d134cf823c64cc46ea374c623868ecbac53 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Sat, 7 Dec 2024 23:08:02 +0800 Subject: [PATCH] update --- CMakeLists.txt | 4 ++-- src/12/7/sh1000.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/12/7/sh1001.cpp | 35 +++++++++++++++++++++++++++++++++++ src/12/7/sh1002.cpp | 33 +++++++++++++++++++++++++++++++++ src/12/7/sh1003.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ src/12/7/sh984.cpp | 14 ++++++++++++++ 6 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 src/12/7/sh1000.cpp create mode 100644 src/12/7/sh1001.cpp create mode 100644 src/12/7/sh1002.cpp create mode 100644 src/12/7/sh1003.cpp create mode 100644 src/12/7/sh984.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a088eb..f53a8aa 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,10 @@ cmake_minimum_required(VERSION 3.10) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_compile_options(-Wall) -set(CMAKE_CXX_STANDARD 26) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -add_compile_options(-fexperimental-new-constant-interpreter) +# add_compile_options(-fexperimental-new-constant-interpreter) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) endif() diff --git a/src/12/7/sh1000.cpp b/src/12/7/sh1000.cpp new file mode 100644 index 0000000..4747bc2 --- /dev/null +++ b/src/12/7/sh1000.cpp @@ -0,0 +1,44 @@ +#include +#include +#include + +using ll = int64_t; + +ll t,n; + +int main(){ + std::cin>>t; + while(t--){ + std::cin>>n; + ll bobAns{}, bellaAns{}, bobNow{}, bellaNow{}; + for(ll i{1};i<=n;i++){ + ll tmp; + std::cin>>tmp; + if(tmp>0){ + bobNow++; + }else{ + bobAns=std::max(bobAns,bobNow); + bobNow=0; + } + } + bobAns=std::max(bobAns,bobNow); + for(ll i{1};i<=n;i++){ + ll tmp; + std::cin>>tmp; + if(tmp>0){ + bellaNow++; + }else{ + bellaAns=std::max(bellaAns,bellaNow); + bellaNow=0; + } + } + bellaAns=std::max(bellaAns,bellaNow); + if(bobAns>bellaAns){ + std::cout<<"Bob\n"; + }else if(bellaAns>bobAns){ + std::cout<<"Bella\n"; + }else{ + std::cout<<"Draw\n"; + } + } +} \ No newline at end of file diff --git a/src/12/7/sh1001.cpp b/src/12/7/sh1001.cpp new file mode 100644 index 0000000..4b7083a --- /dev/null +++ b/src/12/7/sh1001.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include +using ll = int64_t; + +bool greater(ll const& a,ll const& b)noexcept{ + return a>b; +} + +int main(){ + ll t; + std::cin>>t; + while(t--){ + ll n,m,h; + std::cin>>n>>m>>h; + const ll maxn{ll(1e5+5)}; + static std::vector bty(maxn); + for(ll i{1};i<=n;i++){ + std::cin>>bty[i]; + } + static std::vector pw(maxn); + for(ll i{1};i<=m;i++){ + std::cin>>pw[i]; + } + std::sort(bty.data()+1,bty.data()+1+n,greater); + std::sort(pw.data()+1,pw.data()+1+m,greater); + const ll minNm{std::min(n,m)}; + ll ans{}; + for(ll i{1};i<=minNm;i++){ + ans+=(h*pw[i]>bty[i]?bty[i]:h*pw[i]); + } + std::cout< +#include +#include +#include + +using ll = int64_t; + +int main(){ + std::ios::sync_with_stdio(false),std::cin.tie(nullptr),std::cout.tie(nullptr); + ll t; + std::cin>>t; + while(t--){ + static ll n,m; + std::cin>>n>>m; + const ll maxn{size_t(5e5+5)}; + static ll a[maxn]; + for(ll i{1};i<=n;i++){ + std::cin>>a[i]; + } + for(ll i{1};i<=n;i++){ + ll msk{a[i]}; + for(ll j{i};j<=n;j++){ + msk&=a[j]; + if(msk==m){ + std::cout<<"Yes\n"; + goto outLoop; + } + } + } + std::cout<<"No\n"; + outLoop:; + } +} \ No newline at end of file diff --git a/src/12/7/sh1003.cpp b/src/12/7/sh1003.cpp new file mode 100644 index 0000000..64c7ed0 --- /dev/null +++ b/src/12/7/sh1003.cpp @@ -0,0 +1,40 @@ +#include +using namespace std; + +typedef long long ll; + +const int MOD = 1000000007; + +int main(){ + ios::sync_with_stdio(false); + cin.tie(NULL); + int T; + cin >> T; + while(T--){ + int n; + cin >> n; + string S; + cin >> S; + ll c0=1, c1=0, c2=0, c3=0; + for(int i=0;i +#include + +using ll = int64_t; + +int main(){ + int n; + std::cin>>n; + if(6<=n&&n<=8){ + std::cout<<"Yes\n"; + }else{ + std::cout<<"No\n"; + } +} \ No newline at end of file