답안 #154020

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
154020 2019-09-17T17:50:09 Z stefdasca 최후의 만찬 (IOI12_supper) C++14
0 / 100
95 ms 7420 KB
#include<bits/stdc++.h>
#include "advisor.h"
using namespace std;

void ComputeAdvice(int *C, int N, int K, int M)
{
    int frq[100002];
    memset(frq, 0, sizeof(frq));
    for(int i = 0; i < N; ++i)
        frq[C[i]]++;
    for(int i = 0; i < N; ++i)
    {
        for(int j = 1; j <= frq[i]; ++j)
            WriteAdvice(0);
        WriteAdvice(1);
    }
}
#include<bits/stdc++.h>
#include "assistant.h"
using namespace std;

void Assist(unsigned char *A, int N, int K, int R)
{
    int frq[100002];
    memset(frq, 0, sizeof(frq));
    int poz = 0;
    for(int i = 0; i < R; ++i)
    {
        if(A[i] == 1)
            ++poz;
        else
            ++frq[poz];
    }
    bool is[100002];
    memset(is, 0, sizeof(is));
    set<pair<int, int> >frq1;
    set<pair<int, int> >frq2;
    for(int i = 0; i < K; ++i)
        frq1.insert({frq[i], i}), is[i] = 1;
    for(int i = 0; i < N; ++i)
    {
        int color = GetRequest();
        if(!is[color])
        {
            pair<int, int> p = *frq1.begin();
            frq1.erase(p);
            PutBack(p.second);
            frq2.insert(p);
            frq1.insert({frq[color], color});
            frq2.erase({frq[color], color});
        }
        frq1.erase({frq[color], color});
        --frq[color];
        frq1.insert({frq[color], color});
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 1652 KB Output is correct
2 Incorrect 4 ms 1528 KB Error - Putting back a color when it is already on the scaffold
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 13 ms 2196 KB Error - Putting back a color when it is already on the scaffold
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 70 ms 6104 KB Error - Putting back a color when it is already on the scaffold
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 1832 KB Error - Putting back a color when it is already on the scaffold
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 87 ms 7272 KB Error - Putting back a color when it is already on the scaffold
2 Incorrect 88 ms 7136 KB Error - Putting back a color when it is already on the scaffold
3 Incorrect 88 ms 7240 KB Error - Putting back a color when it is already on the scaffold
4 Incorrect 87 ms 7224 KB Error - Putting back a color when it is already on the scaffold
5 Incorrect 95 ms 7420 KB Error - Putting back a color when it is already on the scaffold
6 Incorrect 87 ms 7348 KB Error - Putting back a color when it is already on the scaffold
7 Incorrect 87 ms 7056 KB Error - Putting back a color when it is already on the scaffold
8 Incorrect 90 ms 7244 KB Error - Putting back a color when it is already on the scaffold
9 Incorrect 90 ms 7268 KB Error - Putting back a color when it is already on the scaffold
10 Incorrect 83 ms 7332 KB Error - Not putting back color when it is not on the scaffold