#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, have;
int done = 0;
for(int i = 0; i < n; i++){
int cnt = a[2 * i] + a[2 * i + 1];
have.pb(cnt);
if(cnt == 0){
done++;
av.pb(i);
}
if(cnt == 1){
av.pb(i);
}
if(cnt == 2){
while(done >= 1){
done -= (1 ^ have[av.back()]);
if(done == 0){
done++;
break;
}
Remove(av.back());
av.pop_back();
}
Remove(i);
}
}
while(av.size()){
Remove(av.back());
av.pop_back();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
512 KB |
Output is correct |
2 |
Correct |
1 ms |
512 KB |
Output is correct |
3 |
Correct |
1 ms |
512 KB |
Output is correct |
4 |
Correct |
1 ms |
532 KB |
Output is correct |
5 |
Correct |
1 ms |
504 KB |
Output is correct |
6 |
Correct |
1 ms |
512 KB |
Output is correct |
7 |
Correct |
0 ms |
512 KB |
Output is correct |
8 |
Correct |
1 ms |
512 KB |
Output is correct |
9 |
Correct |
0 ms |
512 KB |
Output is correct |
10 |
Correct |
1 ms |
608 KB |
Output is correct |
11 |
Correct |
0 ms |
512 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
56 ms |
9944 KB |
Partially correct |
2 |
Partially correct |
54 ms |
9828 KB |
Partially correct |
3 |
Partially correct |
57 ms |
9772 KB |
Partially correct |
4 |
Partially correct |
66 ms |
9968 KB |
Partially correct |
5 |
Partially correct |
53 ms |
9812 KB |
Partially correct |
6 |
Partially correct |
54 ms |
9892 KB |
Partially correct |
7 |
Partially correct |
65 ms |
9912 KB |
Partially correct |
8 |
Partially correct |
56 ms |
9880 KB |
Partially correct |
9 |
Partially correct |
63 ms |
9864 KB |
Partially correct |
10 |
Partially correct |
66 ms |
9936 KB |
Partially correct |
11 |
Partially correct |
53 ms |
9824 KB |
Partially correct |
12 |
Partially correct |
57 ms |
9840 KB |
Partially correct |
13 |
Partially correct |
61 ms |
10260 KB |
Partially correct |
14 |
Partially correct |
67 ms |
9924 KB |
Partially correct |
15 |
Partially correct |
59 ms |
9936 KB |
Partially correct |
16 |
Partially correct |
68 ms |
9844 KB |
Partially correct |
17 |
Partially correct |
71 ms |
10172 KB |
Partially correct |
18 |
Partially correct |
60 ms |
10276 KB |
Partially correct |
19 |
Partially correct |
70 ms |
9872 KB |
Partially correct |
20 |
Partially correct |
53 ms |
9828 KB |
Partially correct |
21 |
Partially correct |
65 ms |
9904 KB |
Partially correct |
22 |
Partially correct |
61 ms |
10336 KB |
Partially correct |
23 |
Partially correct |
53 ms |
9976 KB |
Partially correct |
24 |
Partially correct |
55 ms |
9956 KB |
Partially correct |
25 |
Partially correct |
61 ms |
10172 KB |
Partially correct |
26 |
Partially correct |
61 ms |
10144 KB |
Partially correct |
27 |
Partially correct |
58 ms |
10336 KB |
Partially correct |
28 |
Partially correct |
59 ms |
10148 KB |
Partially correct |
29 |
Partially correct |
62 ms |
10172 KB |
Partially correct |
30 |
Partially correct |
59 ms |
10104 KB |
Partially correct |
31 |
Partially correct |
61 ms |
10048 KB |
Partially correct |
32 |
Partially correct |
54 ms |
9724 KB |
Partially correct |
33 |
Partially correct |
62 ms |
9744 KB |
Partially correct |