Submission #302612

#TimeUsernameProblemLanguageResultExecution timeMemory
302612AlanChenComparing Plants (IOI20_plants)C++14
0 / 100
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; #define get4(a,b,c,d,...) d #define lp3(x,a,b) for(int x=(a);x<(b);x++) #define lp2(x,a) lp3(x,0,a) #define lp1(a) lp2(loopvar,a) #define lp(x...) get4(x,lp3,lp2,lp1,0)(x) #define trv(x,S) for(auto& x:(S)) #define pb push_back #define sz(S) (int)(S).size() #include "plants.h" const int mx=100; int n; int ord[mx]; void incr(int& x) { x++; if(x==n) x=0; } void decr(int& x) { if(x==0) x=n; x--; } void init(int k, vi r) { n=sz(r); lp(nump,n) { int idx=0; while(r[idx]!=k-1) idx++; idx=(idx+k)%n; while(r[idx]!=k-1) idx++; r[idx]=0; ord[idx]=nump; } return; } int compare_plants(int x, int y) { if(ord[x]>ord[y]) return 1; return -1; }
#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...