제출 #528629

#제출 시각아이디문제언어결과실행 시간메모리
528629Plurm식물 비교 (IOI20_plants)C++11
0 / 100
52 ms4932 KiB
#include "plants.h" #include <bits/stdc++.h> using namespace std; vector<int> h; // recovered void init(int k, vector<int> r) { int n = r.size(); h.resize(n, 0); for (int it = 0; it < n; it++) { int m1 = -1; int m2 = -1; for (int i = 0; i < n; i++) { if (r[i] == 0) { if (m1 == -1) m1 = i; else m2 = i; } } if (m2 != -1 && m2 - m1 >= k) m1 = m2; h[m1] = n - it; for (int i = 1; i < k; i++) { r[(m1 + n - i) % n]--; } } } int compare_plants(int x, int y) { return h[x] > h[y] ? 1 : -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...