# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
578697 | 2022-06-17T16:14:26 Z | WongChun1234 | 최후의 만찬 (IOI12_supper) | C++14 | 137 ms | 73752 KB |
#include "advisor.h" #include<bits/stdc++.h> using namespace std; int c[100050],curr[100050],lpos[100050],opt[200050]; deque<int> ap[100050]; priority_queue<pair<int,int>> pq; void ComputeAdvice(int *C, int n, int k, int m) { for (int i=0;i<n;i++) c[i]=C[i]; for (int i=0;i<n;i++) ap[c[i]].push_back(i); for (int i=0;i<n;i++) ap[i].push_back(2e9); for (int i=0;i<k;i++) curr[i]=lpos[i]=i,pq.push({ap[i][0],i}); for (int i=k;i<n;i++) curr[i]=lpos[i]=-1; for (int i=0;i<n;i++){ int choice; lpos[c[i]]=k+i; if (curr[c[i]]!=-1){ choice=32767; }else{ choice=curr[c[i]]=curr[pq.top().second]; opt[lpos[pq.top().second]]=1; curr[pq.top().second]=-1; pq.pop(); } while (ap[c[i]].front()<=i) ap[c[i]].pop_front(); pq.push({ap[c[i]].front(),c[i]}); } for (int i=0;i<n+k;i++) WriteAdvice(opt[i]); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 42 ms | 68088 KB | Output is correct |
2 | Incorrect | 43 ms | 68188 KB | Error - Putting back a color that is not on the scaffold |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 51 ms | 68472 KB | Error - Putting back a color that is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 113 ms | 72444 KB | Error - Putting back a color that is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 49 ms | 68184 KB | Error - Putting back a color that is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 135 ms | 73548 KB | Error - Putting back a color that is not on the scaffold |
2 | Incorrect | 128 ms | 73556 KB | Error - Putting back a color that is not on the scaffold |
3 | Incorrect | 132 ms | 73628 KB | Error - Putting back a color that is not on the scaffold |
4 | Incorrect | 126 ms | 73620 KB | Error - Putting back a color that is not on the scaffold |
5 | Incorrect | 128 ms | 73752 KB | Error - Putting back a color that is not on the scaffold |
6 | Incorrect | 129 ms | 73592 KB | Error - Putting back a color that is not on the scaffold |
7 | Incorrect | 128 ms | 73568 KB | Error - Putting back a color that is not on the scaffold |
8 | Incorrect | 128 ms | 73496 KB | Error - Putting back a color that is not on the scaffold |
9 | Incorrect | 134 ms | 73628 KB | Error - Putting back a color that is not on the scaffold |
10 | Incorrect | 137 ms | 73384 KB | Error - Putting back a color that is not on the scaffold |