답안 #852995

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
852995 2023-09-23T10:04:23 Z danikoynov Ancient Machine (JOI21_ancient_machine) C++17
30 / 100
67 ms 9964 KB
#include "Anna.h"
#include <vector>
#include <bits/stdc++.h>


namespace
{



}

void Anna(int N, std::vector<char> S)
{
    for (int i = 0; i < N; i ++)
    {
        if (S[i] == 'X')
        {
            Send(0);
            Send(0);
        }
        else
        if (S[i] == 'Y')
        {
            Send(1);
            Send(0);
        }
        else
        if (S[i] == 'Z')
        {
            Send(1);
            Send(1);
        }

    }


}
#include "Bruno.h"
#include <vector>
#include <iostream>
namespace
{
const int maxn = 1e5 + 10;
int variable_example = 0;

int FunctionExample(int P)
{
    return 1 - P;
}
char c[maxn];
}  // namespace

void sub_solve()
{

}
void Bruno(int N, int L, std::vector<int> A)
{
    for (int i = 0; i < N; i ++)
    {
        if (A[i * 2] == 0)
            c[i] = 'X';
        else if (A[i * 2 + 1] == 0)
            c[i] = 'Y';
        else
            c[i] = 'Z';
    }


        int pt = 0;
        while(pt < N && c[pt] != 'X')
        {
            Remove(pt);
            pt ++;
        }

        int last = pt;
        while(last < N)
        {
            int id = last + 1;
            while(id < N && c[id] != 'Z')
                id ++;

            for (int i = id - 1; i > last; i --)
                Remove(i);
                if (id != N)
                    Remove(id);
                last = id;

        }
        if (pt != N)
            Remove(pt);
    /**for (int i = 0; i < N; i ++)
        std::cout << c[i] << " ";
    std::cout << std::endl;*/
}

Compilation message

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:47:13: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   47 |             for (int i = id - 1; i > last; i --)
      |             ^~~
Bruno.cpp:49:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   49 |                 if (id != N)
      |                 ^~
Bruno.cpp: At global scope:
Bruno.cpp:9:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
    9 | int FunctionExample(int P)
      |     ^~~~~~~~~~~~~~~
Bruno.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 788 KB Output is correct
2 Correct 1 ms 788 KB Output is correct
3 Correct 1 ms 776 KB Output is correct
4 Correct 0 ms 788 KB Output is correct
5 Correct 0 ms 792 KB Output is correct
6 Correct 1 ms 796 KB Output is correct
7 Correct 0 ms 884 KB Output is correct
8 Correct 0 ms 784 KB Output is correct
9 Correct 0 ms 796 KB Output is correct
10 Correct 0 ms 876 KB Output is correct
11 Correct 0 ms 780 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 53 ms 9232 KB Partially correct
2 Partially correct 55 ms 9760 KB Partially correct
3 Partially correct 57 ms 9804 KB Partially correct
4 Partially correct 56 ms 9672 KB Partially correct
5 Partially correct 55 ms 9628 KB Partially correct
6 Partially correct 59 ms 9588 KB Partially correct
7 Partially correct 55 ms 9584 KB Partially correct
8 Partially correct 57 ms 9844 KB Partially correct
9 Partially correct 57 ms 9816 KB Partially correct
10 Partially correct 56 ms 9716 KB Partially correct
11 Partially correct 59 ms 9536 KB Partially correct
12 Partially correct 57 ms 9668 KB Partially correct
13 Partially correct 64 ms 9612 KB Partially correct
14 Partially correct 67 ms 9712 KB Partially correct
15 Partially correct 57 ms 9860 KB Partially correct
16 Partially correct 54 ms 9832 KB Partially correct
17 Partially correct 59 ms 9892 KB Partially correct
18 Partially correct 57 ms 9768 KB Partially correct
19 Partially correct 58 ms 9908 KB Partially correct
20 Partially correct 51 ms 9708 KB Partially correct
21 Partially correct 54 ms 9720 KB Partially correct
22 Partially correct 57 ms 9684 KB Partially correct
23 Partially correct 55 ms 9816 KB Partially correct
24 Partially correct 52 ms 9588 KB Partially correct
25 Partially correct 56 ms 9720 KB Partially correct
26 Partially correct 56 ms 9724 KB Partially correct
27 Partially correct 57 ms 9712 KB Partially correct
28 Partially correct 60 ms 9720 KB Partially correct
29 Partially correct 56 ms 9636 KB Partially correct
30 Partially correct 57 ms 9728 KB Partially correct
31 Partially correct 57 ms 9652 KB Partially correct
32 Partially correct 51 ms 9744 KB Partially correct
33 Partially correct 54 ms 9964 KB Partially correct