#include "Anna.h"
#include <vector>
namespace {
int variable_example = 0;
}
void Anna(int N, std::vector<char> S) {
variable_example++;
char x = 'X';
for(int i = 0; i < N; i++){
if(S[i] == x){
Send(1);
if(x == 'X') x = 'Y';
else if(x == 'Y') x = 'Z';
else x = 'Y';
}
else Send(0);
}
return;
}
//In the name of God
#include <bits/stdc++.h>
using namespace std;
#include "Bruno.h"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 2e5 + 100;
const int mod = 1e9 + 7;
const int inf = 1e9;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io freopen("input.txt", "r+", stdin);freopen("output.txt", "w+", stdout);
#define pb push_back
#define Mp make_pair
#define F first
#define S second
#define Sz(x) ll((x).size())
#define all(x) (x).begin(), (x).end()
ll pw(ll a, ll b){
ll c = 1;
while(b){
if(b & 1) c = c * a % mod;
a = a * a % mod;
b >>= 1;
}
return c;
}
void Bruno(int N, int L, vector<int> A){
assert(N == L);
assert(L == Sz(A));
vector<int> vec;
for(int i = 0; i < N; i++){
if(A[i]) vec.pb(i);
}
for(int i = N; i--;){
if(!A[i]) Remove(i);
}
for(int i = 1; i < Sz(vec); i++){
Remove(vec[i]);
}
if(Sz(vec) > 0) Remove(vec[0]);
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
484 KB |
Output is correct |
2 |
Correct |
0 ms |
484 KB |
Output is correct |
3 |
Correct |
0 ms |
488 KB |
Output is correct |
4 |
Correct |
0 ms |
484 KB |
Output is correct |
5 |
Correct |
1 ms |
492 KB |
Output is correct |
6 |
Correct |
0 ms |
492 KB |
Output is correct |
7 |
Correct |
0 ms |
496 KB |
Output is correct |
8 |
Correct |
0 ms |
492 KB |
Output is correct |
9 |
Correct |
0 ms |
496 KB |
Output is correct |
10 |
Correct |
1 ms |
488 KB |
Output is correct |
11 |
Correct |
0 ms |
488 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
54 ms |
7640 KB |
Partially correct |
2 |
Partially correct |
54 ms |
7668 KB |
Partially correct |
3 |
Partially correct |
54 ms |
7640 KB |
Partially correct |
4 |
Partially correct |
54 ms |
7620 KB |
Partially correct |
5 |
Partially correct |
62 ms |
7696 KB |
Partially correct |
6 |
Partially correct |
54 ms |
7636 KB |
Partially correct |
7 |
Partially correct |
53 ms |
7628 KB |
Partially correct |
8 |
Partially correct |
54 ms |
7720 KB |
Partially correct |
9 |
Partially correct |
54 ms |
7696 KB |
Partially correct |
10 |
Partially correct |
54 ms |
7580 KB |
Partially correct |
11 |
Partially correct |
59 ms |
7688 KB |
Partially correct |
12 |
Partially correct |
67 ms |
7680 KB |
Partially correct |
13 |
Partially correct |
56 ms |
7684 KB |
Partially correct |
14 |
Partially correct |
52 ms |
7816 KB |
Partially correct |
15 |
Partially correct |
47 ms |
7676 KB |
Partially correct |
16 |
Partially correct |
49 ms |
7652 KB |
Partially correct |
17 |
Partially correct |
55 ms |
7544 KB |
Partially correct |
18 |
Partially correct |
55 ms |
7680 KB |
Partially correct |
19 |
Partially correct |
57 ms |
8020 KB |
Partially correct |
20 |
Partially correct |
64 ms |
8076 KB |
Partially correct |
21 |
Partially correct |
55 ms |
8024 KB |
Partially correct |
22 |
Partially correct |
56 ms |
8068 KB |
Partially correct |
23 |
Partially correct |
51 ms |
8088 KB |
Partially correct |
24 |
Partially correct |
51 ms |
8056 KB |
Partially correct |
25 |
Partially correct |
59 ms |
8052 KB |
Partially correct |
26 |
Partially correct |
57 ms |
8096 KB |
Partially correct |
27 |
Partially correct |
56 ms |
8108 KB |
Partially correct |
28 |
Partially correct |
62 ms |
8056 KB |
Partially correct |
29 |
Partially correct |
59 ms |
8096 KB |
Partially correct |
30 |
Partially correct |
60 ms |
8200 KB |
Partially correct |
31 |
Partially correct |
55 ms |
8088 KB |
Partially correct |
32 |
Partially correct |
54 ms |
8100 KB |
Partially correct |
33 |
Partially correct |
54 ms |
8008 KB |
Partially correct |