제출 #600860

#제출 시각아이디문제언어결과실행 시간메모리
600860PiejanVDC식물 비교 (IOI20_plants)C++17
0 / 100
2 ms1884 KiB
#include "plants.h" #include <bits/stdc++.h> using namespace std; vector<int>l(200005),h(200005); int N; void init(int k, vector<int>r) { N = r.size(); for(int i = 1 ; i < N ; i++) { if(r[i-1]) { h[i] = h[i-1]; l[i] = i; } else { h[i] = i; l[i] = l[i-1]; } } } int compare_plants(int x, int y) { if(h[y] == h[x]) return 0; if(l[y] == l[x]) return 1; if(h[N-1] == h[y] && h[x] == h[0]) return 1; if(l[N-1] == l[y] && l[x] == l[0]) return 0; 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...