#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif
#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
namespace {
}
void Anna(int n,vector<char>S)
{
int xd=n;
FOR(i,0,n-1)
{
if(S[i]=='X')
{
xd=i;
break;
}
}
vector<int>a(n-1,0);
if(xd<n-1)
{
a[xd]=1;
FOR(i,xd+1,n-2) if(S[i]=='Z'&&(i==n-1||S[i+1]!='Z')) a[i]=1;
}
FOR(i,0,n-2) Send(a[i]);
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif
#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
namespace {
}
void Bruno(int n,int l,vector<int>A)
{
A.pb(1);
int last=-1,k=-1;
bool xd=0;
FOR(i,0,n-1)
{
if(A[i])
{
if(!xd)
{
k=i;
last=i;
xd=1;
}
else
{
ROF(j,i-1,last+1) Remove(j);
Remove(i);
last=i;
}
}
}
FOR(i,0,k) Remove(i);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
784 KB |
Output is correct |
2 |
Correct |
0 ms |
796 KB |
Output is correct |
3 |
Correct |
0 ms |
796 KB |
Output is correct |
4 |
Correct |
0 ms |
784 KB |
Output is correct |
5 |
Correct |
0 ms |
784 KB |
Output is correct |
6 |
Correct |
0 ms |
884 KB |
Output is correct |
7 |
Correct |
0 ms |
796 KB |
Output is correct |
8 |
Correct |
1 ms |
796 KB |
Output is correct |
9 |
Correct |
0 ms |
796 KB |
Output is correct |
10 |
Correct |
0 ms |
880 KB |
Output is correct |
11 |
Correct |
0 ms |
784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
35 ms |
8636 KB |
Partially correct |
2 |
Partially correct |
34 ms |
8644 KB |
Partially correct |
3 |
Partially correct |
37 ms |
8560 KB |
Partially correct |
4 |
Partially correct |
34 ms |
8804 KB |
Partially correct |
5 |
Partially correct |
33 ms |
8752 KB |
Partially correct |
6 |
Partially correct |
33 ms |
8624 KB |
Partially correct |
7 |
Partially correct |
33 ms |
8724 KB |
Partially correct |
8 |
Partially correct |
36 ms |
8640 KB |
Partially correct |
9 |
Partially correct |
33 ms |
8712 KB |
Partially correct |
10 |
Partially correct |
33 ms |
8664 KB |
Partially correct |
11 |
Partially correct |
33 ms |
8680 KB |
Partially correct |
12 |
Partially correct |
33 ms |
8684 KB |
Partially correct |
13 |
Partially correct |
45 ms |
8572 KB |
Partially correct |
14 |
Partially correct |
41 ms |
8580 KB |
Partially correct |
15 |
Partially correct |
38 ms |
8684 KB |
Partially correct |
16 |
Partially correct |
35 ms |
8680 KB |
Partially correct |
17 |
Partially correct |
41 ms |
8712 KB |
Partially correct |
18 |
Partially correct |
41 ms |
8684 KB |
Partially correct |
19 |
Partially correct |
39 ms |
8568 KB |
Partially correct |
20 |
Partially correct |
33 ms |
8548 KB |
Partially correct |
21 |
Partially correct |
34 ms |
8708 KB |
Partially correct |
22 |
Partially correct |
40 ms |
8724 KB |
Partially correct |
23 |
Partially correct |
39 ms |
8668 KB |
Partially correct |
24 |
Partially correct |
34 ms |
8720 KB |
Partially correct |
25 |
Partially correct |
42 ms |
8632 KB |
Partially correct |
26 |
Partially correct |
41 ms |
8500 KB |
Partially correct |
27 |
Partially correct |
39 ms |
8708 KB |
Partially correct |
28 |
Partially correct |
39 ms |
8504 KB |
Partially correct |
29 |
Partially correct |
39 ms |
8720 KB |
Partially correct |
30 |
Partially correct |
41 ms |
8632 KB |
Partially correct |
31 |
Partially correct |
44 ms |
8644 KB |
Partially correct |
32 |
Partially correct |
33 ms |
8636 KB |
Partially correct |
33 |
Partially correct |
33 ms |
8636 KB |
Partially correct |