제출 #623047

#제출 시각아이디문제언어결과실행 시간메모리
623047SifferComparing Plants (IOI20_plants)C++14
0 / 100
1 ms304 KiB
#include "plants.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second vector<pair<int,int>> v; int n; void init(int p, vector<int> r) { n = r.size(); int s = 0; for(;r[s]; s++); s++; v.resize(n); int b = s % n; int k = 0; for(int i = 0; i < n; i++) { v[(s+i)%n] = {b, k++}; if(r[(s+i)%n] == 0) b = (s+i+1)%n, k = 0; } } int compare_plants(int x, int y) { if(y < x) return -compare_plants(y,x); if(v[x].F != v[y].F) { if(x == 0 && y == n-1) return -1; if(y-x == 1) return 1; return 0; } if(v[x].S > v[y].S) 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...