답안 #813339

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
813339 2023-08-07T16:09:22 Z Andrey 최후의 만찬 (IOI12_supper) C++14
0 / 100
2500 ms 3656 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);
            br[p]--;
            bruh[p] = false;
            bruh[b]= true;
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 508 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 85 ms 848 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2581 ms 3124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 14 ms 668 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2579 ms 3604 KB Time limit exceeded
2 Execution timed out 2586 ms 3520 KB Time limit exceeded
3 Execution timed out 2506 ms 3656 KB Time limit exceeded
4 Execution timed out 2591 ms 3580 KB Time limit exceeded
5 Execution timed out 2600 ms 3620 KB Time limit exceeded
6 Execution timed out 2507 ms 3576 KB Time limit exceeded
7 Execution timed out 2505 ms 3556 KB Time limit exceeded
8 Execution timed out 2506 ms 3584 KB Time limit exceeded
9 Execution timed out 2577 ms 3640 KB Time limit exceeded
10 Execution timed out 2509 ms 3604 KB Time limit exceeded