Submission #640349

#TimeUsernameProblemLanguageResultExecution timeMemory
640349lis05stComparing Plants (IOI20_plants)C++17
0 / 100
1 ms312 KiB
#ifdef LIS05ST #define _GLIBCXX_DEBUG #define _GLIBCXX_DEBUG_PEDANTIC #endif #pragma GCC optimize("O3") #pragma GCC target("avx2,popcnt,lzcnt") #include"plants.h" #include"bits/stdc++.h" using namespace std; typedef long long ll; typedef long double ld; const int NMAX=2e5; int pref[NMAX+5]; int n; int get(int l,int r){ return pref[r]-pref[l-1]; } bool one(int l,int r){ return get(l,r)==r-l+1; } bool zero(int l,int r){ return get(l,r)==0; } void init(int k, std::vector<int> r){ n=r.size(); for(int i=0;i<n;i++)pref[i+1]=pref[i]+r[i]; }; int compare_plants(int x, int y){ x++,y++; if(zero(x+1,y))return 1; if(one(1,x-1)&&one(y,n))return 1; if(one(x,y-1))return -1; if(zero(1,x-1)&&zero(y,n))return -1; return 0; } #define MULTITESTS false void solve(int testCase){ } void precalc(){ } /* signed main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); precalc(); int t=1; if(MULTITESTS)cin>>t; for(int i=1;i<=t;i++){ auto t1=clock(); solve(i); auto t2=clock(); float delta=t2-t1; delta/=CLOCKS_PER_SEC; #ifdef LIS05ST cout<<"("<<i<<")------------"<<fixed<<setprecision(2)<<delta<<"s\n"; #endif } }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...