#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Anna(int n, vector<char>T) {
vector<int>P(n);
bool xd=false;
rep(i, n) if(T[i]=='X') {
xd=true;
P[i]=1;
for(int j=i+1; j<n; ++j) {
if(T[j]=='Z') P[j]=1;
}
for(int j=n-1; j; --j) if(P[j-1] && P[j]) P[j-1]=0;
if(P[i]==0) Send(1); else Send(0);
break;
}
if(xd==false) Send(0);
rep(i, n) Send(P[i]);
}
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Bruno(int n, int m, vector<int>T) {
int x=-1;
rep(i, n) {
if(T[i+1]) {
x=i;
break;
}
}
if(T[0]) --x;
if(x==-1) {
rep(i, n) Remove(i);
return;
}
int lst=x;
for(int i=x+1; i<n; ++i) if(T[i+1]) {
for(int j=i-1; j>lst; --j) Remove(j);
Remove(i);
lst=i;
}
Remove(x);
for(int i=lst+1; i<n; ++i) Remove(i);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
46 ms |
8624 KB |
Partially correct |
2 |
Incorrect |
42 ms |
8472 KB |
Wrong Answer [5] |
3 |
Halted |
0 ms |
0 KB |
- |