Submission #574864

# Submission time Handle Problem Language Result Execution time Memory
574864 2022-06-09T12:38:48 Z FatihSolak Last supper (IOI12_supper) C++17
0 / 100
78 ms 9740 KB
#include "advisor.h"
#include <bits/stdc++.h>
using namespace std;
void ComputeAdvice(int *c, int n, int k, int m){
    vector<int> occ[n];
    for(int i = n-1;i>=0;i--){
        occ[c[i]].push_back(i);
    }
    for(int i = 0;i<k;i++){
        WriteAdvice(occ[i].empty());
    }
    for(int i = 0;i<n;i++){
        occ[c[i]].pop_back();
        WriteAdvice(occ[c[i]].empty());
    }
}
#include "assistant.h"
#include <bits/stdc++.h>
using namespace std;

void Assist(unsigned char *a, int n, int k, int r) {
    set<int> s;
    int last = 0;
    bool now[n];
    for(int i = 0;i<n;i++){
        now[i] = 0;
    }
    for(int i = 0;i<k;i++){
        if(a[last++] == 1){
            s.insert(i);
        }
        now[i] = 1;
    }
    for (int i = 0; i < n; i++) {
        int req = GetRequest();
        if(now[req] == 0){
            assert(s.size());
            now[*s.begin()] = 0;
            PutBack(*s.begin());
            s.erase(s.begin());
            now[req] = 1;
        }
        if(a[last++] == 1){
            s.insert(req);
        }
    }

}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 516 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 2 ms 780 KB Output is correct
4 Runtime error 2 ms 928 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 9 ms 1608 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 66 ms 7164 KB Output is correct
2 Correct 69 ms 9100 KB Output is correct
3 Correct 78 ms 9176 KB Output is correct
4 Correct 70 ms 8860 KB Output is correct
5 Runtime error 59 ms 9136 KB Execution killed with signal 6
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 920 KB Output is correct
2 Runtime error 4 ms 1204 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 60 ms 9360 KB Execution killed with signal 6
2 Correct 68 ms 8816 KB Output is correct - 122000 bits used
3 Correct 69 ms 8896 KB Output is correct - 125000 bits used
4 Correct 71 ms 8952 KB Output is correct - 125000 bits used
5 Correct 71 ms 8960 KB Output is correct - 125000 bits used
6 Correct 72 ms 8916 KB Output is correct - 125000 bits used
7 Correct 69 ms 8896 KB Output is correct - 124828 bits used
8 Correct 67 ms 8856 KB Output is correct - 124910 bits used
9 Correct 71 ms 8924 KB Output is correct - 125000 bits used
10 Runtime error 59 ms 9740 KB Execution killed with signal 6