Submission #798382

# Submission time Handle Problem Language Result Execution time Memory
798382 2023-07-30T16:24:10 Z fatemetmhr Ancient Machine (JOI21_ancient_machine) C++17
5 / 100
81 ms 9036 KB
#include "Anna.h"

#include <bits/stdc++.h>

//#pragma GCC optimize ("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,Ofast")

using namespace std;

typedef long long ll;

#define pb       push_back
#define mp       make_pair
#define all(x)   x.begin(), x.end()
#define fi       first
#define se       second

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

    }
}
//  ~ Be Name Khoda ~  //

#include "Bruno.h"
#include <bits/stdc++.h>

//#pragma GCC optimize ("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,Ofast")

using namespace std;

typedef long long ll;

#define pb       push_back
#define mp       make_pair
#define all(x)   x.begin(), x.end()
#define fi       first
#define se       second


void Bruno(int n, int l, std::vector<int> a){
    vector <int> av;
    for(int i = 0; i < n; i++){
        int cnt = a[2 * i] + a[2 * i + 1];
        if(cnt == 0){
            if(av.size() && av.back() == 0)
                Remove(i);
            else
                av.pb(i);
        }
        if(cnt == 1){
            if(av.empty() || av.back() == 1)
                Remove(i);
            else
                av.pb(i);
        }
        if(cnt == 2){
            while(av.size() > 1){
                Remove(av.back());
                av.pop_back();
            }
            Remove(i);
        }
    }
    while(av.size()){
        Remove(av.back());
        av.pop_back();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 516 KB Output is correct
2 Correct 1 ms 508 KB Output is correct
3 Correct 1 ms 520 KB Output is correct
4 Correct 0 ms 516 KB Output is correct
5 Correct 0 ms 508 KB Output is correct
6 Correct 0 ms 508 KB Output is correct
7 Correct 0 ms 508 KB Output is correct
8 Correct 0 ms 516 KB Output is correct
9 Correct 0 ms 512 KB Output is correct
10 Correct 0 ms 516 KB Output is correct
11 Correct 1 ms 508 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 53 ms 9028 KB Partially correct
2 Incorrect 81 ms 9036 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -