제출 #528633

#제출 시각아이디문제언어결과실행 시간메모리
528633Plurm식물 비교 (IOI20_plants)C++11
14 / 100
4073 ms8388 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 m = -1; int l = -1; for (int i = 0; i < n; i++) { if (r[i] == 0) { if (m == -1) m = i; else if (i - l >= k) m = i; l = i; } } // printf("DBG %d\n", m); h[m] = n - it; for (int i = 0; i < k; i++) { r[(m + 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...