Submission #813345

# Submission time Handle Problem Language Result Execution time Memory
813345 2023-08-07T16:12:47 Z Andrey Last supper (IOI12_supper) C++14
0 / 100
2500 ms 4372 KB
#include<bits/stdc++.h>
#include "advisor.h"
using namespace std;

void ComputeAdvice(int *c, int n, int k, int m) {
    vector<int> br(n);
    for(int i = 0; i < n; i++) {
        br[c[i]]++;
    }
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < br[i]; i++) {
            WriteAdvice(1);
        }
        WriteAdvice(0);
    }
}
#include<bits/stdc++.h>
#include "assistant.h"
using namespace std;

void Assist(unsigned char *a, int n, int k, int r) {
    vector<int> br(n);
    int y = 0,b,sm = 0,p;
    for(int i = 0; i < r; i++) {
        if((int)a[i] == 0) {
            y++;
        }
        else {
            br[y]++;
        }
    }
    vector<bool> bruh(n);
    for(int i = 0; i < k; i++) {
        bruh[i] = true;
    }
    for(int i = 0; i < n; i++) {
        b = GetRequest();
        if(!bruh[b]) {
            p = -1;
            sm = INT_MAX;
            for(int j = 0; j < n; j++) {
                if(bruh[j] == true && br[j] < sm) {
                    sm = br[j];
                    p = j;
                }
            }
            PutBack(p);
            bruh[p] = false;
            bruh[b] = true;
        }
        br[b]--;
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 520 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 99 ms 1000 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2554 ms 3348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 808 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2578 ms 4068 KB Time limit exceeded
2 Execution timed out 2587 ms 4100 KB Time limit exceeded
3 Execution timed out 2578 ms 4236 KB Time limit exceeded
4 Execution timed out 2602 ms 4220 KB Time limit exceeded
5 Execution timed out 2598 ms 4112 KB Time limit exceeded
6 Execution timed out 2514 ms 4096 KB Time limit exceeded
7 Execution timed out 2587 ms 4032 KB Time limit exceeded
8 Execution timed out 2590 ms 4224 KB Time limit exceeded
9 Execution timed out 2554 ms 4044 KB Time limit exceeded
10 Execution timed out 2590 ms 4372 KB Time limit exceeded