Submission #852995

#TimeUsernameProblemLanguageResultExecution timeMemory
852995danikoynovAncient Machine (JOI21_ancient_machine)C++17
30 / 100
67 ms9964 KiB
#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 (stderr)

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;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...