/*
High hopes and noble endeavors...
Will shine with all the twinkling stars.
We hold you next to us...
The galaxy, so glorious.
We'll build with all of our dreams...
A new world that bravely gleams.
Char is fighting for our prayers!
Char is fighting for our prayers!
*/
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef complex<double> point;
namespace {
void debug_out(){cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T){
cerr << H << ' ';
debug_out(T...);
}
#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)
const int maxn = 1e5 + 10;
int n;
string s;
}
void Anna(int N, std::vector<char> S) {
n = N;
for (int i = 0; i < n; i++){
s.push_back(S[i]);
}
for (int i = 0; i < n; i++){
debug(s[i]);
if (s[i] == 'X'){
Send(0);
Send(0);
}
if (s[i] == 'Y'){
Send(0);
Send(1);
}
if (s[i] == 'Z'){
Send(1);
Send(0);
}
}
}
/*
High hopes and noble endeavors...
Will shine with all the twinkling stars.
We hold you next to us...
The galaxy, so glorious.
We'll build with all of our dreams...
A new world that bravely gleams.
Char is fighting for our prayers!
Char is fighting for our prayers!
*/
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef complex<double> point;
namespace {
void debug_out(){cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T){
cerr << H << ' ';
debug_out(T...);
}
#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)
const int maxn = 1e5 + 10;
int n;
string s;
}
void Bruno(int N, int L, std::vector<int> A) {
n = N;
for (int i = 1; i < L; i += 2){
if (A[i-1] == 0 && A[i] == 0) s.push_back('X');
if (A[i-1] == 0 && A[i] == 1) s.push_back('Y');
if (A[i-1] == 1 && A[i] == 0) s.push_back('Z');
debug(s.back());
}
debug(s.size());
vector<int> v;
for (int i = 0; i < n; i++){
if (v.empty() && s[i] == 'X'){
v.push_back(i);
}
else if (v.empty()){
Remove(i);
}
else{
if (s[i] != 'Z'){
v.push_back(i);
}
else{
while(v.size() > 1){
Remove(v.back());
v.pop_back();
}
Remove(i);
}
}
}
while(!v.empty()){
Remove(v.back());
v.pop_back();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
520 KB |
Output is correct |
2 |
Correct |
1 ms |
512 KB |
Output is correct |
3 |
Correct |
1 ms |
516 KB |
Output is correct |
4 |
Correct |
2 ms |
512 KB |
Output is correct |
5 |
Correct |
1 ms |
516 KB |
Output is correct |
6 |
Correct |
1 ms |
512 KB |
Output is correct |
7 |
Correct |
0 ms |
512 KB |
Output is correct |
8 |
Correct |
0 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
520 KB |
Output is correct |
10 |
Correct |
1 ms |
600 KB |
Output is correct |
11 |
Correct |
1 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1197 ms |
11920 KB |
Partially correct |
2 |
Partially correct |
1172 ms |
12128 KB |
Partially correct |
3 |
Partially correct |
1173 ms |
12240 KB |
Partially correct |
4 |
Partially correct |
1184 ms |
12280 KB |
Partially correct |
5 |
Partially correct |
1218 ms |
12236 KB |
Partially correct |
6 |
Partially correct |
1190 ms |
12308 KB |
Partially correct |
7 |
Partially correct |
1268 ms |
12292 KB |
Partially correct |
8 |
Partially correct |
1259 ms |
12236 KB |
Partially correct |
9 |
Partially correct |
1246 ms |
12228 KB |
Partially correct |
10 |
Partially correct |
1206 ms |
12308 KB |
Partially correct |
11 |
Partially correct |
1214 ms |
12292 KB |
Partially correct |
12 |
Partially correct |
1213 ms |
12268 KB |
Partially correct |
13 |
Partially correct |
1225 ms |
12780 KB |
Partially correct |
14 |
Partially correct |
1272 ms |
12452 KB |
Partially correct |
15 |
Partially correct |
1241 ms |
12312 KB |
Partially correct |
16 |
Partially correct |
1276 ms |
12316 KB |
Partially correct |
17 |
Partially correct |
1287 ms |
12580 KB |
Partially correct |
18 |
Partially correct |
1244 ms |
12228 KB |
Partially correct |
19 |
Partially correct |
1212 ms |
12312 KB |
Partially correct |
20 |
Partially correct |
1200 ms |
12204 KB |
Partially correct |
21 |
Partially correct |
1249 ms |
12268 KB |
Partially correct |
22 |
Partially correct |
1246 ms |
12740 KB |
Partially correct |
23 |
Partially correct |
1210 ms |
12412 KB |
Partially correct |
24 |
Partially correct |
1208 ms |
12380 KB |
Partially correct |
25 |
Partially correct |
1238 ms |
12312 KB |
Partially correct |
26 |
Partially correct |
1249 ms |
12728 KB |
Partially correct |
27 |
Partially correct |
1226 ms |
12208 KB |
Partially correct |
28 |
Partially correct |
1186 ms |
12624 KB |
Partially correct |
29 |
Partially correct |
1232 ms |
12312 KB |
Partially correct |
30 |
Partially correct |
1230 ms |
12396 KB |
Partially correct |
31 |
Partially correct |
1238 ms |
12340 KB |
Partially correct |
32 |
Partially correct |
1202 ms |
12352 KB |
Partially correct |
33 |
Partially correct |
1226 ms |
12300 KB |
Partially correct |