Submission #1076393

# Submission time Handle Problem Language Result Execution time Memory
1076393 2024-08-26T13:35:22 Z Warinchai Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
43 ms 9736 KB
#include "Anna.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;

void Anna(int N, std::vector<char> S) {
    for(auto x:S){
        if(x=='X')Send(1),Send(0);
        else if(x=='Y')Send(0),Send(1);
        else Send(0),Send(0);
    }
}
#include "Bruno.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
 // namespace

void Bruno(int N, int L, std::vector<int> A) {
    int st=-1;
    string s;
    for(int i=0;i<L;i+=2){
        if(A[i]==0&&A[i+1]==1)s.push_back('Y');
        else if(A[i]==0&&A[i+1]==0)s.push_back('Z');
        else s.push_back('X');
    }
    //cerr<<s<<"\n";
    for(int i=0;i<N;i++){
        if(s[i]=='X'){
            st=i;
            break;
        }
        Remove(i);
    }
    if(st==-1)return;
    //cerr<<"work\n";
    int cur=st;
    int check=0;
    int id=0;
    for(int i=st;i<N;i++){
        if(s[i]=='Z'){
            for(int j=i;j>cur;j--){
                Remove(j);
            }
            cur=i;
        }
    }
    //cerr<<"st:"<<st<<"\n";
    Remove(st);
}

Compilation message

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:26:9: warning: unused variable 'check' [-Wunused-variable]
   26 |     int check=0;
      |         ^~~~~
Bruno.cpp:27:9: warning: unused variable 'id' [-Wunused-variable]
   27 |     int id=0;
      |         ^~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 800 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 9736 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -