답안 #852979

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
852979 2023-09-23T09:46:34 Z danikoynov Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
54 ms 9556 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 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 foundX = -1, foundY = -1;
    for (int i = 0; i < N; i ++)
    {
        if (c[i] == 'X')
        {
            if (foundX == -1)
                foundX = i;
            else
                Remove(i);
        }
        else
        if (c[i] == 'Y')
        {
            if (foundX == -1)
                Remove(i);
            else
            if (foundY == -1)
                foundY = i;
            else
                Remove(i);
        }
        else
        if (c[i] == 'Z')
        {
            if (foundX != -1 && foundY != -1)
            {
                Remove(foundY);
                Remove(i);
                foundY = -1;
            }
            else
                Remove(i);
        }
    }

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

Compilation message

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 1 ms 792 KB Output is correct
2 Correct 0 ms 804 KB Output is correct
3 Correct 0 ms 796 KB Output is correct
4 Correct 0 ms 796 KB Output is correct
5 Incorrect 1 ms 780 KB Wrong Answer [6]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 54 ms 9556 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -