제출 #541822

#제출 시각아이디문제언어결과실행 시간메모리
541822LucaDantas식물 비교 (IOI20_plants)C++17
0 / 100
1 ms312 KiB
// subtask 2*k > n, n <= 5000 #include "plants.h" #include <bits/stdc++.h> using namespace std; constexpr int maxn = 2e5+10; int ordem[maxn]; void init(int k, std::vector<int> r) { int n = (int)(r.size()); for(int i = 0; i < n; i++) { int mx = 0; for(int j = 1; j < n; j++) if(r[j] < mx || (r[j] == mx && (mx - j + n) < k)) mx = j; ordem[mx] = i; r[mx] = 0x3f3f3f3f; for(int j = 0; j < k; j++) --r[(mx - j + n) % n]; } } int compare_plants(int x, int y) { return ordem[x] < ordem[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...