#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-1;j>cur;j--){
Remove(j);
}
Remove(i);
cur=i;
}
}
for(int i=N-1;i>cur;i--)Remove(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;
| ^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
796 KB |
Output is correct |
2 |
Correct |
1 ms |
1300 KB |
Output is correct |
3 |
Correct |
0 ms |
780 KB |
Output is correct |
4 |
Correct |
0 ms |
780 KB |
Output is correct |
5 |
Correct |
0 ms |
796 KB |
Output is correct |
6 |
Correct |
1 ms |
796 KB |
Output is correct |
7 |
Correct |
1 ms |
784 KB |
Output is correct |
8 |
Correct |
1 ms |
784 KB |
Output is correct |
9 |
Correct |
1 ms |
796 KB |
Output is correct |
10 |
Correct |
0 ms |
796 KB |
Output is correct |
11 |
Correct |
1 ms |
784 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
49 ms |
9728 KB |
Partially correct |
2 |
Partially correct |
47 ms |
9808 KB |
Partially correct |
3 |
Partially correct |
47 ms |
9660 KB |
Partially correct |
4 |
Partially correct |
46 ms |
9728 KB |
Partially correct |
5 |
Partially correct |
46 ms |
9728 KB |
Partially correct |
6 |
Partially correct |
50 ms |
10008 KB |
Partially correct |
7 |
Partially correct |
46 ms |
9780 KB |
Partially correct |
8 |
Partially correct |
47 ms |
9712 KB |
Partially correct |
9 |
Partially correct |
46 ms |
9784 KB |
Partially correct |
10 |
Partially correct |
47 ms |
9796 KB |
Partially correct |
11 |
Partially correct |
48 ms |
9608 KB |
Partially correct |
12 |
Partially correct |
46 ms |
9676 KB |
Partially correct |
13 |
Partially correct |
55 ms |
9868 KB |
Partially correct |
14 |
Partially correct |
57 ms |
9592 KB |
Partially correct |
15 |
Partially correct |
42 ms |
9852 KB |
Partially correct |
16 |
Partially correct |
51 ms |
9832 KB |
Partially correct |
17 |
Partially correct |
51 ms |
9744 KB |
Partially correct |
18 |
Partially correct |
53 ms |
9872 KB |
Partially correct |
19 |
Partially correct |
54 ms |
9824 KB |
Partially correct |
20 |
Partially correct |
52 ms |
9796 KB |
Partially correct |
21 |
Partially correct |
45 ms |
9796 KB |
Partially correct |
22 |
Partially correct |
51 ms |
9820 KB |
Partially correct |
23 |
Partially correct |
45 ms |
9748 KB |
Partially correct |
24 |
Partially correct |
45 ms |
9812 KB |
Partially correct |
25 |
Partially correct |
54 ms |
9736 KB |
Partially correct |
26 |
Partially correct |
54 ms |
9588 KB |
Partially correct |
27 |
Partially correct |
54 ms |
9724 KB |
Partially correct |
28 |
Partially correct |
54 ms |
9884 KB |
Partially correct |
29 |
Partially correct |
60 ms |
9720 KB |
Partially correct |
30 |
Partially correct |
53 ms |
9780 KB |
Partially correct |
31 |
Partially correct |
52 ms |
9716 KB |
Partially correct |
32 |
Partially correct |
46 ms |
9800 KB |
Partially correct |
33 |
Partially correct |
46 ms |
9768 KB |
Partially correct |