#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
//#include "temp.cpp"
#include <cstdio>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x) cerr << #x <<" "; print(x); cerr << endl;
#else
#define dbg(x)
#endif
#define sz(x) (int)x.size()
#define len(x) (int)x.length()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define clr(x) (x).clear()
#define uniq(x) x.resize(unique(all(x)) - x.begin());
#define blt __builtin_popcount
#define pb push_back
#define popf pop_front
#define popb pop_back
#define ld long double
void print(long long t) {cerr << t;}
void print(int t) {cerr << t;}
void print(string t) {cerr << t;}
void print(char t) {cerr << t;}
void print(double t) {cerr << t;}
void print(long double t) {cerr << t;}
void print(unsigned long long t) {cerr << t;}
template <class T, class V> void print(pair <T, V> p);
template <class T> void print(vector <T> v);
template <class T> void print(set <T> v);
template <class T, class V> void print(map <T, V> v);
template <class T> void print(multiset <T> v);
template <class T, class V> void print(T v[],V n) {cerr << "["; for(int i = 0; i < n; i++) {print(v[i]); cerr << " "; } cerr << "]";}
template <class T, class V> void print(pair <T, V> p) {cerr << "{"; print(p.first); cerr << ","; print(p.second); cerr << "}";}
template <class T> void print(vector <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]";}
template <class T> void print(set <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]";}
template <class T> void print(multiset <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void print(map <T, V> v) {cerr << "[ "; for (auto i : v) {print(i); cerr << " ";} cerr << "]";}
template <class T> void print(deque <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]";}
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define nl '\n'
// for random generations
// mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
mt19937 myrand(373);
// for grid problems
int dx[8] = {-1,0,1,0,1,-1,1,-1};
int dy[8] = {0,1,0,-1,1,1,-1,-1};
// lowest / (1 << 17) >= 1e5 / (1 << 18) >= 2e5 / (1 << 21) >= 1e6
void fastIO() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
}
// file in/out
void setIO(string str = "") {
fastIO();
if(str == "input") {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
} else {
// freopen("skis.in", "r", stdin);
// freopen("skis.out", "w", stdout);
}
}
// Indexed Set
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int maxN = 3e5 + 10, LOG = 23;
vector<int> st[maxN];
bool start[maxN];
int lst[maxN], dp[2][maxN];
int nxt[maxN], up[maxN][LOG];
int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) {
for(int i = 0; i < M; i++) {
for(int j = 0; j < A[i]; j++) {
st[B[i][j]].push_back(i);
}
}
for(int i = 0; i < N; i++) {
C.push_back(C[i]);
}
for(auto i: st[C[0]]) {
dp[0][i] = 1;
lst[0] = 1;
}
for(int i = 1; i < 2 * N; i++) {
for(auto j: st[C[i]]) {
int last_index = (j - 1 + M) % M;
dp[i & 1][j] = max(dp[i & 1][j], dp[!(i & 1)][last_index] + 1);
dp[i & 1][j] = min(dp[i & 1][j], M);
lst[i] = max(lst[i], dp[i & 1][j]);
}
memset(dp[!(i & 1)], 0, sizeof(dp[!(i & 1)]));
}
for(int i = 0; i < 2 * N; i++) {
if(lst[i] == M) {
dbg(i)
start[i] = true;
}
}
for(int i = 0; i < LOG; i++) up[maxN - 10][i] = maxN - 10;
nxt[maxN - 10] = maxN - 10;
vector<int> xd{maxN - 10};
for(int i = 2 * N - 1; i >= 0; i--) {
if(start[i]) {
xd.push_back(i);
up[i][0] = max(0, i - M);
}
int len = xd.back() - i + 1;
if(len <= M) {
nxt[i] = xd.back();
} else {
nxt[i] = maxN - 10;
}
if(!start[i]) {
up[i][0] = up[nxt[i]][0];
}
}
for(int i = 1; i < LOG; i++) {
for(int j = 2 * N - 1; j >= 0; j--) {
int curr = up[j][i - 1];
curr = nxt[curr];
up[j][i] = up[curr][i - 1];
}
}
int answ = maxN;
for(int i = 2 * N - 1; i >= N; i--) {
if(!start[i]) continue;
int ina = 0, inb = N + 10, aw = -1;
int L = i - N;
while(ina <= inb) {
int mid = (ina + inb) / 2;
int cr = i;
for(int j = 0; j < LOG; j++) {
if(mid & (1 << j)) {
cr = up[cr][j];
}
}
if(cr <= L) {
aw = mid;
inb = mid - 1;
} else {
ina = mid + 1;
}
}
if(aw != -1) {
answ = min(answ, aw);
}
}
if(answ == maxN) answ = -1;
return answ;
}
Compilation message
paint.cpp: In function 'void setIO(std::string)':
paint.cpp:69:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
69 | freopen("input.txt", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
paint.cpp:70:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
70 | freopen("output.txt", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
8532 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9708 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
37 ms |
9804 KB |
Output is correct |
8 |
Correct |
48 ms |
9780 KB |
Output is correct |
9 |
Correct |
36 ms |
9716 KB |
Output is correct |
10 |
Correct |
35 ms |
9804 KB |
Output is correct |
11 |
Correct |
32 ms |
9780 KB |
Output is correct |
12 |
Correct |
35 ms |
9788 KB |
Output is correct |
13 |
Correct |
38 ms |
9784 KB |
Output is correct |
14 |
Correct |
40 ms |
9804 KB |
Output is correct |
15 |
Correct |
40 ms |
9748 KB |
Output is correct |
16 |
Correct |
36 ms |
9768 KB |
Output is correct |
17 |
Correct |
35 ms |
9764 KB |
Output is correct |
18 |
Correct |
34 ms |
9768 KB |
Output is correct |
19 |
Correct |
31 ms |
9776 KB |
Output is correct |
20 |
Correct |
32 ms |
9784 KB |
Output is correct |
21 |
Correct |
33 ms |
9776 KB |
Output is correct |
22 |
Correct |
51 ms |
14208 KB |
Output is correct |
23 |
Correct |
51 ms |
14208 KB |
Output is correct |
24 |
Correct |
48 ms |
14304 KB |
Output is correct |
25 |
Correct |
1303 ms |
14612 KB |
Output is correct |
26 |
Correct |
1484 ms |
14648 KB |
Output is correct |
27 |
Correct |
1154 ms |
14232 KB |
Output is correct |
28 |
Correct |
1164 ms |
14016 KB |
Output is correct |
29 |
Correct |
1073 ms |
13912 KB |
Output is correct |
30 |
Correct |
1200 ms |
13916 KB |
Output is correct |
31 |
Correct |
1314 ms |
15668 KB |
Output is correct |
32 |
Correct |
1355 ms |
15676 KB |
Output is correct |
33 |
Correct |
1258 ms |
15704 KB |
Output is correct |
34 |
Correct |
1287 ms |
15864 KB |
Output is correct |
35 |
Correct |
1353 ms |
15608 KB |
Output is correct |
36 |
Correct |
1380 ms |
15676 KB |
Output is correct |
37 |
Correct |
1169 ms |
18696 KB |
Output is correct |
38 |
Correct |
1132 ms |
18596 KB |
Output is correct |
39 |
Correct |
1075 ms |
18624 KB |
Output is correct |
40 |
Execution timed out |
1592 ms |
11048 KB |
Time limit exceeded |
41 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
8532 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9708 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
37 ms |
9804 KB |
Output is correct |
8 |
Correct |
48 ms |
9780 KB |
Output is correct |
9 |
Correct |
36 ms |
9716 KB |
Output is correct |
10 |
Correct |
35 ms |
9804 KB |
Output is correct |
11 |
Correct |
32 ms |
9780 KB |
Output is correct |
12 |
Correct |
35 ms |
9788 KB |
Output is correct |
13 |
Correct |
38 ms |
9784 KB |
Output is correct |
14 |
Correct |
40 ms |
9804 KB |
Output is correct |
15 |
Correct |
40 ms |
9748 KB |
Output is correct |
16 |
Correct |
36 ms |
9768 KB |
Output is correct |
17 |
Correct |
35 ms |
9764 KB |
Output is correct |
18 |
Correct |
34 ms |
9768 KB |
Output is correct |
19 |
Correct |
31 ms |
9776 KB |
Output is correct |
20 |
Correct |
32 ms |
9784 KB |
Output is correct |
21 |
Correct |
33 ms |
9776 KB |
Output is correct |
22 |
Correct |
5 ms |
9684 KB |
Output is correct |
23 |
Correct |
5 ms |
9684 KB |
Output is correct |
24 |
Correct |
6 ms |
9684 KB |
Output is correct |
25 |
Correct |
5 ms |
9660 KB |
Output is correct |
26 |
Correct |
5 ms |
9660 KB |
Output is correct |
27 |
Correct |
24 ms |
9684 KB |
Output is correct |
28 |
Correct |
31 ms |
9684 KB |
Output is correct |
29 |
Correct |
18 ms |
9660 KB |
Output is correct |
30 |
Correct |
25 ms |
9728 KB |
Output is correct |
31 |
Correct |
34 ms |
9720 KB |
Output is correct |
32 |
Correct |
25 ms |
9728 KB |
Output is correct |
33 |
Correct |
31 ms |
9804 KB |
Output is correct |
34 |
Correct |
38 ms |
9744 KB |
Output is correct |
35 |
Correct |
32 ms |
9720 KB |
Output is correct |
36 |
Correct |
35 ms |
9744 KB |
Output is correct |
37 |
Correct |
24 ms |
9804 KB |
Output is correct |
38 |
Correct |
31 ms |
9740 KB |
Output is correct |
39 |
Correct |
24 ms |
9732 KB |
Output is correct |
40 |
Correct |
23 ms |
9824 KB |
Output is correct |
41 |
Correct |
33 ms |
9740 KB |
Output is correct |
42 |
Correct |
41 ms |
9752 KB |
Output is correct |
43 |
Correct |
22 ms |
9684 KB |
Output is correct |
44 |
Correct |
39 ms |
9712 KB |
Output is correct |
45 |
Correct |
36 ms |
9716 KB |
Output is correct |
46 |
Correct |
39 ms |
9720 KB |
Output is correct |
47 |
Correct |
31 ms |
9776 KB |
Output is correct |
48 |
Correct |
41 ms |
9812 KB |
Output is correct |
49 |
Correct |
36 ms |
9812 KB |
Output is correct |
50 |
Correct |
49 ms |
9760 KB |
Output is correct |
51 |
Correct |
37 ms |
9764 KB |
Output is correct |
52 |
Correct |
42 ms |
9764 KB |
Output is correct |
53 |
Correct |
49 ms |
9760 KB |
Output is correct |
54 |
Correct |
49 ms |
9748 KB |
Output is correct |
55 |
Correct |
50 ms |
9764 KB |
Output is correct |
56 |
Correct |
39 ms |
9784 KB |
Output is correct |
57 |
Correct |
41 ms |
9756 KB |
Output is correct |
58 |
Correct |
33 ms |
9788 KB |
Output is correct |
59 |
Correct |
35 ms |
9752 KB |
Output is correct |
60 |
Correct |
37 ms |
9784 KB |
Output is correct |
61 |
Correct |
37 ms |
9740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
8532 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9708 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
37 ms |
9804 KB |
Output is correct |
10 |
Correct |
48 ms |
9780 KB |
Output is correct |
11 |
Correct |
36 ms |
9716 KB |
Output is correct |
12 |
Correct |
35 ms |
9804 KB |
Output is correct |
13 |
Correct |
32 ms |
9780 KB |
Output is correct |
14 |
Correct |
35 ms |
9788 KB |
Output is correct |
15 |
Correct |
38 ms |
9784 KB |
Output is correct |
16 |
Correct |
40 ms |
9804 KB |
Output is correct |
17 |
Correct |
40 ms |
9748 KB |
Output is correct |
18 |
Correct |
36 ms |
9768 KB |
Output is correct |
19 |
Correct |
35 ms |
9764 KB |
Output is correct |
20 |
Correct |
34 ms |
9768 KB |
Output is correct |
21 |
Correct |
31 ms |
9776 KB |
Output is correct |
22 |
Correct |
32 ms |
9784 KB |
Output is correct |
23 |
Correct |
33 ms |
9776 KB |
Output is correct |
24 |
Correct |
51 ms |
14208 KB |
Output is correct |
25 |
Correct |
51 ms |
14208 KB |
Output is correct |
26 |
Correct |
48 ms |
14304 KB |
Output is correct |
27 |
Correct |
6 ms |
9684 KB |
Output is correct |
28 |
Correct |
5 ms |
9660 KB |
Output is correct |
29 |
Correct |
5 ms |
9660 KB |
Output is correct |
30 |
Correct |
24 ms |
9684 KB |
Output is correct |
31 |
Correct |
31 ms |
9684 KB |
Output is correct |
32 |
Correct |
18 ms |
9660 KB |
Output is correct |
33 |
Correct |
25 ms |
9728 KB |
Output is correct |
34 |
Correct |
34 ms |
9720 KB |
Output is correct |
35 |
Correct |
25 ms |
9728 KB |
Output is correct |
36 |
Correct |
31 ms |
9804 KB |
Output is correct |
37 |
Correct |
38 ms |
9744 KB |
Output is correct |
38 |
Correct |
32 ms |
9720 KB |
Output is correct |
39 |
Correct |
35 ms |
9744 KB |
Output is correct |
40 |
Correct |
24 ms |
9804 KB |
Output is correct |
41 |
Correct |
31 ms |
9740 KB |
Output is correct |
42 |
Correct |
24 ms |
9732 KB |
Output is correct |
43 |
Correct |
23 ms |
9824 KB |
Output is correct |
44 |
Correct |
33 ms |
9740 KB |
Output is correct |
45 |
Correct |
41 ms |
9752 KB |
Output is correct |
46 |
Correct |
22 ms |
9684 KB |
Output is correct |
47 |
Correct |
39 ms |
9712 KB |
Output is correct |
48 |
Correct |
36 ms |
9716 KB |
Output is correct |
49 |
Correct |
39 ms |
9720 KB |
Output is correct |
50 |
Correct |
31 ms |
9776 KB |
Output is correct |
51 |
Correct |
41 ms |
9812 KB |
Output is correct |
52 |
Correct |
36 ms |
9812 KB |
Output is correct |
53 |
Correct |
49 ms |
9760 KB |
Output is correct |
54 |
Correct |
37 ms |
9764 KB |
Output is correct |
55 |
Correct |
42 ms |
9764 KB |
Output is correct |
56 |
Correct |
49 ms |
9760 KB |
Output is correct |
57 |
Correct |
49 ms |
9748 KB |
Output is correct |
58 |
Correct |
50 ms |
9764 KB |
Output is correct |
59 |
Correct |
39 ms |
9784 KB |
Output is correct |
60 |
Correct |
41 ms |
9756 KB |
Output is correct |
61 |
Correct |
33 ms |
9788 KB |
Output is correct |
62 |
Correct |
35 ms |
9752 KB |
Output is correct |
63 |
Correct |
37 ms |
9784 KB |
Output is correct |
64 |
Correct |
37 ms |
9740 KB |
Output is correct |
65 |
Correct |
27 ms |
9796 KB |
Output is correct |
66 |
Correct |
37 ms |
9708 KB |
Output is correct |
67 |
Correct |
41 ms |
9724 KB |
Output is correct |
68 |
Correct |
38 ms |
9736 KB |
Output is correct |
69 |
Correct |
38 ms |
9724 KB |
Output is correct |
70 |
Correct |
34 ms |
9940 KB |
Output is correct |
71 |
Correct |
33 ms |
9976 KB |
Output is correct |
72 |
Correct |
41 ms |
9948 KB |
Output is correct |
73 |
Correct |
35 ms |
9932 KB |
Output is correct |
74 |
Correct |
29 ms |
9960 KB |
Output is correct |
75 |
Correct |
36 ms |
9984 KB |
Output is correct |
76 |
Correct |
61 ms |
13004 KB |
Output is correct |
77 |
Correct |
46 ms |
13516 KB |
Output is correct |
78 |
Correct |
54 ms |
14020 KB |
Output is correct |
79 |
Correct |
39 ms |
9852 KB |
Output is correct |
80 |
Correct |
38 ms |
9748 KB |
Output is correct |
81 |
Correct |
42 ms |
9880 KB |
Output is correct |
82 |
Correct |
37 ms |
9780 KB |
Output is correct |
83 |
Correct |
43 ms |
9756 KB |
Output is correct |
84 |
Correct |
39 ms |
10036 KB |
Output is correct |
85 |
Correct |
47 ms |
10012 KB |
Output is correct |
86 |
Correct |
39 ms |
10024 KB |
Output is correct |
87 |
Correct |
48 ms |
10020 KB |
Output is correct |
88 |
Correct |
47 ms |
10024 KB |
Output is correct |
89 |
Correct |
38 ms |
10028 KB |
Output is correct |
90 |
Correct |
70 ms |
14352 KB |
Output is correct |
91 |
Correct |
71 ms |
14336 KB |
Output is correct |
92 |
Correct |
61 ms |
14392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
8532 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9708 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
37 ms |
9804 KB |
Output is correct |
10 |
Correct |
48 ms |
9780 KB |
Output is correct |
11 |
Correct |
36 ms |
9716 KB |
Output is correct |
12 |
Correct |
35 ms |
9804 KB |
Output is correct |
13 |
Correct |
32 ms |
9780 KB |
Output is correct |
14 |
Correct |
35 ms |
9788 KB |
Output is correct |
15 |
Correct |
38 ms |
9784 KB |
Output is correct |
16 |
Correct |
40 ms |
9804 KB |
Output is correct |
17 |
Correct |
40 ms |
9748 KB |
Output is correct |
18 |
Correct |
36 ms |
9768 KB |
Output is correct |
19 |
Correct |
35 ms |
9764 KB |
Output is correct |
20 |
Correct |
34 ms |
9768 KB |
Output is correct |
21 |
Correct |
31 ms |
9776 KB |
Output is correct |
22 |
Correct |
32 ms |
9784 KB |
Output is correct |
23 |
Correct |
33 ms |
9776 KB |
Output is correct |
24 |
Correct |
51 ms |
14208 KB |
Output is correct |
25 |
Correct |
51 ms |
14208 KB |
Output is correct |
26 |
Correct |
48 ms |
14304 KB |
Output is correct |
27 |
Correct |
1303 ms |
14612 KB |
Output is correct |
28 |
Correct |
1484 ms |
14648 KB |
Output is correct |
29 |
Correct |
1154 ms |
14232 KB |
Output is correct |
30 |
Correct |
1164 ms |
14016 KB |
Output is correct |
31 |
Correct |
1073 ms |
13912 KB |
Output is correct |
32 |
Correct |
1200 ms |
13916 KB |
Output is correct |
33 |
Correct |
1314 ms |
15668 KB |
Output is correct |
34 |
Correct |
1355 ms |
15676 KB |
Output is correct |
35 |
Correct |
1258 ms |
15704 KB |
Output is correct |
36 |
Correct |
1287 ms |
15864 KB |
Output is correct |
37 |
Correct |
1353 ms |
15608 KB |
Output is correct |
38 |
Correct |
1380 ms |
15676 KB |
Output is correct |
39 |
Correct |
1169 ms |
18696 KB |
Output is correct |
40 |
Correct |
1132 ms |
18596 KB |
Output is correct |
41 |
Correct |
1075 ms |
18624 KB |
Output is correct |
42 |
Correct |
6 ms |
9684 KB |
Output is correct |
43 |
Correct |
5 ms |
9660 KB |
Output is correct |
44 |
Correct |
5 ms |
9660 KB |
Output is correct |
45 |
Correct |
24 ms |
9684 KB |
Output is correct |
46 |
Correct |
31 ms |
9684 KB |
Output is correct |
47 |
Correct |
18 ms |
9660 KB |
Output is correct |
48 |
Correct |
25 ms |
9728 KB |
Output is correct |
49 |
Correct |
34 ms |
9720 KB |
Output is correct |
50 |
Correct |
25 ms |
9728 KB |
Output is correct |
51 |
Correct |
31 ms |
9804 KB |
Output is correct |
52 |
Correct |
38 ms |
9744 KB |
Output is correct |
53 |
Correct |
32 ms |
9720 KB |
Output is correct |
54 |
Correct |
35 ms |
9744 KB |
Output is correct |
55 |
Correct |
24 ms |
9804 KB |
Output is correct |
56 |
Correct |
31 ms |
9740 KB |
Output is correct |
57 |
Correct |
24 ms |
9732 KB |
Output is correct |
58 |
Correct |
23 ms |
9824 KB |
Output is correct |
59 |
Correct |
33 ms |
9740 KB |
Output is correct |
60 |
Correct |
41 ms |
9752 KB |
Output is correct |
61 |
Correct |
22 ms |
9684 KB |
Output is correct |
62 |
Correct |
39 ms |
9712 KB |
Output is correct |
63 |
Correct |
36 ms |
9716 KB |
Output is correct |
64 |
Correct |
39 ms |
9720 KB |
Output is correct |
65 |
Correct |
31 ms |
9776 KB |
Output is correct |
66 |
Correct |
41 ms |
9812 KB |
Output is correct |
67 |
Correct |
36 ms |
9812 KB |
Output is correct |
68 |
Correct |
49 ms |
9760 KB |
Output is correct |
69 |
Correct |
37 ms |
9764 KB |
Output is correct |
70 |
Correct |
42 ms |
9764 KB |
Output is correct |
71 |
Correct |
49 ms |
9760 KB |
Output is correct |
72 |
Correct |
49 ms |
9748 KB |
Output is correct |
73 |
Correct |
50 ms |
9764 KB |
Output is correct |
74 |
Correct |
39 ms |
9784 KB |
Output is correct |
75 |
Correct |
41 ms |
9756 KB |
Output is correct |
76 |
Correct |
33 ms |
9788 KB |
Output is correct |
77 |
Correct |
35 ms |
9752 KB |
Output is correct |
78 |
Correct |
37 ms |
9784 KB |
Output is correct |
79 |
Correct |
37 ms |
9740 KB |
Output is correct |
80 |
Correct |
27 ms |
9796 KB |
Output is correct |
81 |
Correct |
37 ms |
9708 KB |
Output is correct |
82 |
Correct |
41 ms |
9724 KB |
Output is correct |
83 |
Correct |
38 ms |
9736 KB |
Output is correct |
84 |
Correct |
38 ms |
9724 KB |
Output is correct |
85 |
Correct |
34 ms |
9940 KB |
Output is correct |
86 |
Correct |
33 ms |
9976 KB |
Output is correct |
87 |
Correct |
41 ms |
9948 KB |
Output is correct |
88 |
Correct |
35 ms |
9932 KB |
Output is correct |
89 |
Correct |
29 ms |
9960 KB |
Output is correct |
90 |
Correct |
36 ms |
9984 KB |
Output is correct |
91 |
Correct |
61 ms |
13004 KB |
Output is correct |
92 |
Correct |
46 ms |
13516 KB |
Output is correct |
93 |
Correct |
54 ms |
14020 KB |
Output is correct |
94 |
Correct |
39 ms |
9852 KB |
Output is correct |
95 |
Correct |
38 ms |
9748 KB |
Output is correct |
96 |
Correct |
42 ms |
9880 KB |
Output is correct |
97 |
Correct |
37 ms |
9780 KB |
Output is correct |
98 |
Correct |
43 ms |
9756 KB |
Output is correct |
99 |
Correct |
39 ms |
10036 KB |
Output is correct |
100 |
Correct |
47 ms |
10012 KB |
Output is correct |
101 |
Correct |
39 ms |
10024 KB |
Output is correct |
102 |
Correct |
48 ms |
10020 KB |
Output is correct |
103 |
Correct |
47 ms |
10024 KB |
Output is correct |
104 |
Correct |
38 ms |
10028 KB |
Output is correct |
105 |
Correct |
70 ms |
14352 KB |
Output is correct |
106 |
Correct |
71 ms |
14336 KB |
Output is correct |
107 |
Correct |
61 ms |
14392 KB |
Output is correct |
108 |
Correct |
1348 ms |
14520 KB |
Output is correct |
109 |
Correct |
1174 ms |
13256 KB |
Output is correct |
110 |
Correct |
727 ms |
12360 KB |
Output is correct |
111 |
Correct |
759 ms |
12212 KB |
Output is correct |
112 |
Correct |
925 ms |
13108 KB |
Output is correct |
113 |
Correct |
614 ms |
12092 KB |
Output is correct |
114 |
Correct |
694 ms |
14072 KB |
Output is correct |
115 |
Correct |
708 ms |
13504 KB |
Output is correct |
116 |
Correct |
1147 ms |
15688 KB |
Output is correct |
117 |
Correct |
668 ms |
13868 KB |
Output is correct |
118 |
Correct |
808 ms |
14448 KB |
Output is correct |
119 |
Correct |
945 ms |
14336 KB |
Output is correct |
120 |
Correct |
634 ms |
15280 KB |
Output is correct |
121 |
Correct |
741 ms |
13136 KB |
Output is correct |
122 |
Correct |
651 ms |
15420 KB |
Output is correct |
123 |
Correct |
761 ms |
12928 KB |
Output is correct |
124 |
Correct |
1062 ms |
17568 KB |
Output is correct |
125 |
Correct |
1179 ms |
15020 KB |
Output is correct |
126 |
Incorrect |
935 ms |
13844 KB |
Output isn't correct |
127 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
5 ms |
9684 KB |
Output is correct |
3 |
Correct |
5 ms |
8532 KB |
Output is correct |
4 |
Correct |
5 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9708 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
37 ms |
9804 KB |
Output is correct |
10 |
Correct |
48 ms |
9780 KB |
Output is correct |
11 |
Correct |
36 ms |
9716 KB |
Output is correct |
12 |
Correct |
35 ms |
9804 KB |
Output is correct |
13 |
Correct |
32 ms |
9780 KB |
Output is correct |
14 |
Correct |
35 ms |
9788 KB |
Output is correct |
15 |
Correct |
38 ms |
9784 KB |
Output is correct |
16 |
Correct |
40 ms |
9804 KB |
Output is correct |
17 |
Correct |
40 ms |
9748 KB |
Output is correct |
18 |
Correct |
36 ms |
9768 KB |
Output is correct |
19 |
Correct |
35 ms |
9764 KB |
Output is correct |
20 |
Correct |
34 ms |
9768 KB |
Output is correct |
21 |
Correct |
31 ms |
9776 KB |
Output is correct |
22 |
Correct |
32 ms |
9784 KB |
Output is correct |
23 |
Correct |
33 ms |
9776 KB |
Output is correct |
24 |
Correct |
51 ms |
14208 KB |
Output is correct |
25 |
Correct |
51 ms |
14208 KB |
Output is correct |
26 |
Correct |
48 ms |
14304 KB |
Output is correct |
27 |
Correct |
1303 ms |
14612 KB |
Output is correct |
28 |
Correct |
1484 ms |
14648 KB |
Output is correct |
29 |
Correct |
1154 ms |
14232 KB |
Output is correct |
30 |
Correct |
1164 ms |
14016 KB |
Output is correct |
31 |
Correct |
1073 ms |
13912 KB |
Output is correct |
32 |
Correct |
1200 ms |
13916 KB |
Output is correct |
33 |
Correct |
1314 ms |
15668 KB |
Output is correct |
34 |
Correct |
1355 ms |
15676 KB |
Output is correct |
35 |
Correct |
1258 ms |
15704 KB |
Output is correct |
36 |
Correct |
1287 ms |
15864 KB |
Output is correct |
37 |
Correct |
1353 ms |
15608 KB |
Output is correct |
38 |
Correct |
1380 ms |
15676 KB |
Output is correct |
39 |
Correct |
1169 ms |
18696 KB |
Output is correct |
40 |
Correct |
1132 ms |
18596 KB |
Output is correct |
41 |
Correct |
1075 ms |
18624 KB |
Output is correct |
42 |
Execution timed out |
1592 ms |
11048 KB |
Time limit exceeded |
43 |
Halted |
0 ms |
0 KB |
- |