답안 #417218

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
417218 2021-06-03T13:22:16 Z tqbfjotld Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
79 ms 8340 KB
#include "Anna.h"
#include <vector>
using namespace std;

void Anna(int N, std::vector<char> S) {
    bool found = false;
    for (int x = 0; x<N; x++){
        if (S[x]=='X') found = true;
        Send((!found) || S[x]=='Z');
    }
}
#include "Bruno.h"
#include <vector>
#include <cassert>
using namespace std;


void Bruno(int N, int L, std::vector<int> A) {
    assert(L==N);
    int Xpos = -1;
    for (int x = 0; x<N; x++){
        if (!A[x]){
            Xpos = x;
            break;
        }
    }

    if (Xpos==-1){
        for (int x = 0; x<N; x++){
            Remove(x);
        }
        return;
    }
    vector<int> rem;
    for (int x = 0; x<Xpos; x++){
        Remove(x);
    }
    for (int x = Xpos+1; x<N; x++){
        if (A[x]){
            while (!rem.empty()){
                Remove(rem.back());
                rem.pop_back();
            }
            Remove(x);
        }
        else{
            rem.push_back(x);
        }
    }
    Remove(Xpos);
    for (auto x : rem){
        Remove(x);
    }
}

# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 488 KB Output is correct
2 Correct 0 ms 488 KB Output is correct
3 Correct 0 ms 500 KB Output is correct
4 Correct 0 ms 488 KB Output is correct
5 Correct 0 ms 488 KB Output is correct
6 Correct 0 ms 488 KB Output is correct
7 Correct 0 ms 488 KB Output is correct
8 Correct 0 ms 484 KB Output is correct
9 Correct 0 ms 484 KB Output is correct
10 Correct 0 ms 484 KB Output is correct
11 Correct 0 ms 496 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 64 ms 7980 KB Partially correct
2 Partially correct 63 ms 8048 KB Partially correct
3 Partially correct 63 ms 8088 KB Partially correct
4 Partially correct 64 ms 8096 KB Partially correct
5 Partially correct 63 ms 8048 KB Partially correct
6 Partially correct 73 ms 8044 KB Partially correct
7 Partially correct 64 ms 8100 KB Partially correct
8 Partially correct 65 ms 8052 KB Partially correct
9 Partially correct 63 ms 7936 KB Partially correct
10 Partially correct 63 ms 8012 KB Partially correct
11 Partially correct 64 ms 8076 KB Partially correct
12 Partially correct 66 ms 8032 KB Partially correct
13 Partially correct 70 ms 8256 KB Partially correct
14 Partially correct 72 ms 8096 KB Partially correct
15 Partially correct 73 ms 8044 KB Partially correct
16 Partially correct 70 ms 8032 KB Partially correct
17 Partially correct 73 ms 8300 KB Partially correct
18 Partially correct 78 ms 7976 KB Partially correct
19 Partially correct 70 ms 8072 KB Partially correct
20 Partially correct 63 ms 8040 KB Partially correct
21 Partially correct 61 ms 8072 KB Partially correct
22 Partially correct 70 ms 8212 KB Partially correct
23 Partially correct 62 ms 8040 KB Partially correct
24 Partially correct 60 ms 7984 KB Partially correct
25 Partially correct 69 ms 8084 KB Partially correct
26 Partially correct 70 ms 8236 KB Partially correct
27 Partially correct 69 ms 8064 KB Partially correct
28 Partially correct 69 ms 8340 KB Partially correct
29 Partially correct 69 ms 8152 KB Partially correct
30 Partially correct 79 ms 7996 KB Partially correct
31 Partially correct 74 ms 8000 KB Partially correct
32 Partially correct 65 ms 8088 KB Partially correct
33 Partially correct 71 ms 8072 KB Partially correct