/*************************************
* author: marvinthang *
* created: 21.03.2023 23:00:23 *
*************************************/
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define left ___left
#define right ___right
#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
#define MASK(i) (1LL << (i))
#define BIT(x, i) ((x) >> (i) & 1)
#define __builtin_popcount __builtin_popcountll
#define ALL(v) (v).begin(), (v).end()
#define REP(i, n) for (int i = 0, _n = (n); i < _n; ++i)
#define REPD(i, n) for (int i = (n); i--; )
#define FOR(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)
#define FORD(i, b, a) for (int i = (b), _a = (a); --i >= _a; )
#define FORE(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)
#define FORDE(i, b, a) for (int i = (b), _a = (a); i >= _a; --i)
namespace {
}
void Anna(int n, vector <char> s) {
bool first_x = false;
for (char c: s) {
if (!first_x && c == 'X') {
first_x = true;
Send(1);
} else if (first_x && c == 'Z') Send(1);
else Send(0);
}
}
/*************************************
* author: marvinthang *
* created: 21.03.2023 23:03:23 *
*************************************/
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define left ___left
#define right ___right
#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
#define MASK(i) (1LL << (i))
#define BIT(x, i) ((x) >> (i) & 1)
#define __builtin_popcount __builtin_popcountll
#define ALL(v) (v).begin(), (v).end()
#define REP(i, n) for (int i = 0, _n = (n); i < _n; ++i)
#define REPD(i, n) for (int i = (n); i--; )
#define FOR(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)
#define FORD(i, b, a) for (int i = (b), _a = (a); --i >= _a; )
#define FORE(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)
#define FORDE(i, b, a) for (int i = (b), _a = (a); i >= _a; --i)
namespace {
}
void Bruno(int N, int L, std::vector<int> A) {
int first_x = -1;
int last = -1;
REP(i, N) if (A[i]) {
if (first_x == -1) {
first_x = i;
REP(j, i) Remove(j);
} else {
FORD(j, i, last + 1) Remove(j);
Remove(i);
}
last = i;
}
FOR(j, last + 1, N) Remove(j);
Remove(first_x);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
512 KB |
Output is correct |
2 |
Correct |
1 ms |
512 KB |
Output is correct |
3 |
Correct |
0 ms |
520 KB |
Output is correct |
4 |
Correct |
1 ms |
520 KB |
Output is correct |
5 |
Correct |
0 ms |
512 KB |
Output is correct |
6 |
Correct |
1 ms |
520 KB |
Output is correct |
7 |
Correct |
1 ms |
520 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
1 ms |
512 KB |
Output is correct |
10 |
Incorrect |
2 ms |
520 KB |
Wrong Answer [3] |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
49 ms |
8096 KB |
Partially correct |
2 |
Partially correct |
52 ms |
8076 KB |
Partially correct |
3 |
Partially correct |
49 ms |
8076 KB |
Partially correct |
4 |
Partially correct |
53 ms |
8060 KB |
Partially correct |
5 |
Partially correct |
53 ms |
8092 KB |
Partially correct |
6 |
Partially correct |
51 ms |
8116 KB |
Partially correct |
7 |
Partially correct |
55 ms |
8072 KB |
Partially correct |
8 |
Partially correct |
53 ms |
8092 KB |
Partially correct |
9 |
Partially correct |
54 ms |
8064 KB |
Partially correct |
10 |
Partially correct |
52 ms |
7988 KB |
Partially correct |
11 |
Partially correct |
49 ms |
8092 KB |
Partially correct |
12 |
Partially correct |
51 ms |
8040 KB |
Partially correct |
13 |
Partially correct |
59 ms |
8072 KB |
Partially correct |
14 |
Partially correct |
57 ms |
8092 KB |
Partially correct |
15 |
Partially correct |
54 ms |
8080 KB |
Partially correct |
16 |
Partially correct |
61 ms |
8092 KB |
Partially correct |
17 |
Partially correct |
68 ms |
8140 KB |
Partially correct |
18 |
Incorrect |
48 ms |
7868 KB |
Wrong Answer [3] |
19 |
Halted |
0 ms |
0 KB |
- |