# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1050200 | mychecksedad | 식물 비교 (IOI20_plants) | C++17 | 4040 ms | 8816 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "plants.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define vi vector<int>
#define all(x) x.begin(),x.end()
const int N = 3e5;
int a[N], n;
void init(int k, std::vector<int> r) {
n = r.size();
for(int i = 0; i < n; ++i) a[i] = 0;
// if(2*k > n){
int f = n-1;
for(int rep = 0; rep < n; ++rep){
int mx = *max_element(all(r));
int l = n, rr = -1;
vector<int> L;
for(int i = 0; i < n; ++i){
if(r[i] == mx){
L.pb(i);
}
}
int x = L[0];
for(int i = 0; i + 1 < L.size(); ++i){
if(L[i] + k <= L[i + 1]){
x = L[i + 1];
break;
}
}
a[x] = f--;
r[x] = -n;
// cout << x << ' ';
for(int i = x - 1; i > x - k; --i) r[(i+n)%n]++;
}
// for(int i = 0; i < n; ++i) cout << a[i] << ' ';
// }else{
// }
}
int compare_plants(int x, int y) {
return a[x] < a[y] ? 1 : (a[x] > a[y] ? -1 : 0);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |