# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
558191 | 2022-05-07T03:15:10 Z | Jesus | Last supper (IOI12_supper) | C++14 | 60 ms | 6136 KB |
#include<bits/stdc++.h> #include "advisor.h" using namespace std; pair<int,int> colores[100001]; int andamio[100001]; queue<int> libres; void ComputeAdvice(int *C, int N, int K, int M){ for(int i=0;i<N;i++){ colores[i]={-1,-1}; } for(int i=0;i<N;i++){ if(i<K){ andamio[i]=i; colores[i].second=i; } colores[C[i]].first=i; } for(int i=0;i<K;i++){ if(colores[andamio[i]].first==-1) { WriteAdvice(0); libres.push(i); } else { WriteAdvice(1); } } for(int i=0;i<N;i++){ if(colores[C[i]].second=-1){ int pos=0; if(libres.size()>0){ pos=libres.front(); libres.pop(); } colores[C[i]].second=pos; andamio[pos]=C[i]; colores[andamio[pos]].second=-1; } if(colores[C[i]].first==i){ libres.push(colores[C[i]].second); WriteAdvice(0); } else WriteAdvice(1); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 620 KB | Output isn't correct - not an optimal way |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 1020 KB | Output isn't correct - not an optimal way |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 44 ms | 5040 KB | Output isn't correct - not an optimal way |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 828 KB | Output isn't correct - not an optimal way |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 56 ms | 5900 KB | Output isn't correct - not an optimal way |
2 | Incorrect | 60 ms | 5884 KB | Output isn't correct - not an optimal way |
3 | Incorrect | 55 ms | 5972 KB | Output isn't correct - not an optimal way |
4 | Incorrect | 54 ms | 6136 KB | Output isn't correct - not an optimal way |
5 | Incorrect | 55 ms | 6024 KB | Output isn't correct - not an optimal way |
6 | Incorrect | 51 ms | 5992 KB | Output isn't correct - not an optimal way |
7 | Incorrect | 56 ms | 6068 KB | Output isn't correct - not an optimal way |
8 | Incorrect | 53 ms | 5988 KB | Output isn't correct - not an optimal way |
9 | Incorrect | 57 ms | 5908 KB | Output isn't correct - not an optimal way |
10 | Incorrect | 51 ms | 5960 KB | Output isn't correct - not an optimal way |