#include "paint.h"
#include <iostream>
#include <iomanip>
#include <chrono>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <utility>
#include <string>
#include <vector>
#include <bitset>
using std::min;
using std::max;
using std::sort;
using std::swap;
using std::fixed;
using std::to_string;
using std::make_pair;
using std::upper_bound;
using std::lower_bound;
using std::setprecision;
using std::cin;
using std::cout;
using std::set;
using std::map;
using std::list;
using std::pair;
using std::less;
using std::tuple;
using std::stack;
using std::queue;
using std::deque;
using std::string;
using std::vector;
using std::bitset;
using std::greater;
using std::priority_queue;
typedef long double ld;
typedef unsigned ui;
typedef long long lli;
typedef unsigned long long ulli;
typedef vector<int32_t> vi;
typedef vector<ld> vld;
typedef vector<ui> vui;
typedef vector<lli> vlli;
typedef vector<ulli> vulli;
typedef list<int32_t> lsi;
typedef list<ld> lsld;
typedef list<ui> lsui;
typedef list<lli> lslli;
typedef list<ulli> lsulli;
typedef set<int32_t> si;
typedef set<ld> sld;
typedef set<ui> sui;
typedef set<lli> slli;
typedef set<ulli> sulli;
typedef pair<int32_t, int32_t> pii;
typedef pair<lli, lli> pll;
// #define int int64_t
#define endl "\n"
#define inp(n) int n; cin >> n
#define Inp(n) lli n; cin >> n
#define inpstr(s) string s; cin >> s
#define inp2(a,b) int a,b; cin >> a >> b
#define Inp2(a,b) lli a,b; cin >> a >> b
#define inparr(arr,n) int arr[n]; f0(t_ind, n) cin >> arr[t_ind]
#define Inparr(arr,n) lli arr[n]; f0(t_ind, n) cin >> arr[t_ind]
#define f0(i,n) for(int32_t i = 0; i < (n); i++)
#define f1(i,n) for(int32_t i = 1; i <= (n); i++)
#define rep0(i,l,r) for(int32_t i=(l); i < (r); i++)
#define rep1(i,l,r) for(int32_t i=(l); i <= (r); i++)
#define testIn cin >> test
#define tests for(int32_t testNo=1; testNo <= (test); testNo++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define asrt(v) sort(all(v))
#define dsrt(v) sort(rall(v))
#define revStr(str) string(rall(str))
#define len(a) ((int64_t)(a).size())
#define front_zero(n) __builtin_clzll(n)
#define back_zero(n) __builtin_ctzll(n)
#define total_one(n) __builtin_popcountll(n)
#define lcm(a, b) (((a)*(b))/gcd(a,b))
#define mem(a, b) memset(a, b, sizeof(a))
#define pb push_back
#define pf push_front
#define mp make_pair
#define ff first
#define ss second
#define yes cout << "yes" << endl
#define no cout << "no" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define finish return 0
#define clean fflush(stdout)
#define Inf (int32_t)(1e9)
#define INF (lli)(1e18)
#define Eps (ld)(1e-9)
#define EPS (ld)(1e-18)
#define PI (ld)(3.141592653589793238462643383279502884197169L)
#define MOD (int32_t)(1e9+7)
#define MXN (int32_t)(1e5+7)
int likedby[100005];
int likedby2[100005];
int minimumInstructions(
int N, int M, int K, std::vector<int> C,
std::vector<int> A, std::vector<std::vector<int>> B) {
bool valid[N] = {0};
int lstvalid[N];
int cur = -1, ans = 0;
bool sbtsk1 = true;
f0(i, 100005) likedby[i] = -1, likedby2[i] = 0;
f0(i, M) {
f0(j, A[i]) {
likedby[B[i][j]] = i;
likedby2[B[i][j]]++;
if(likedby2[B[i][j]] == 2) sbtsk1 = false;
}
}
if(sbtsk1){f0(i, N) {
if(likedby[C[i]] == -1) return -1;
if(i % M != 0) {
int df = likedby[C[i]] - likedby[C[i-1]];
df %= M;
df += M;
df %= M;
if(df != 1) {
return -1;
}
}
}
// cur = 0;
// while(cur < N) {
// if(lstvalid[cur] == -1) return -1;
// if(lstvalid[cur] < cur - M + 1) return -1;
// ans++;
// cur = lstvalid[cur] + M;
// }
if(N % M == 0) {
return N/M;
}
int i = N/M;
i *= M;
int df = likedby[C[i]] - likedby[C[i-1]];
df %= M;
df += M;
df %= M;
if(df != 1) {
return -1;
}
return (int)((N+M-1)/M);}
// vector<si> B(M);
// f0(i, M) {
// for(int c: bbb[i]) B[i].insert(c);
// }
// bool valid[N] = {0};
// int lstvalid[N];
f0(st, M) {
int lstbreak = -1;
f0(i, N) {
// int color = C[i];
auto it = lower_bound(B[(st+i)%M].begin(), B[(st+i)%M].end(), C[i]);
if (it == B[(st+i)%M].end()) {
lstbreak = i;
} else if ((*it) != C[i]) {
lstbreak = i;
}
if(i - lstbreak >= M) {
valid[i - M + 1] = true;
}
}
}
cur = -1, ans = 0;
f0(i, N) {
if(valid[i]) {
cur = i;
}
lstvalid[i] = cur;
}
cur = 0;
while(cur < N) {
if(lstvalid[cur] == -1) return -1;
if(lstvalid[cur] < cur - M + 1) return -1;
ans++;
cur = lstvalid[cur] + M;
}
return ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
980 KB |
Output is correct |
2 |
Correct |
1 ms |
980 KB |
Output is correct |
3 |
Correct |
1 ms |
980 KB |
Output is correct |
4 |
Correct |
1 ms |
980 KB |
Output is correct |
5 |
Correct |
1 ms |
980 KB |
Output is correct |
6 |
Correct |
1 ms |
980 KB |
Output is correct |
7 |
Correct |
1 ms |
980 KB |
Output is correct |
8 |
Correct |
1 ms |
980 KB |
Output is correct |
9 |
Correct |
1 ms |
980 KB |
Output is correct |
10 |
Correct |
1 ms |
980 KB |
Output is correct |
11 |
Correct |
1 ms |
980 KB |
Output is correct |
12 |
Correct |
1 ms |
980 KB |
Output is correct |
13 |
Correct |
1 ms |
1108 KB |
Output is correct |
14 |
Correct |
1 ms |
1108 KB |
Output is correct |
15 |
Correct |
1 ms |
1108 KB |
Output is correct |
16 |
Correct |
1 ms |
980 KB |
Output is correct |
17 |
Correct |
1 ms |
1108 KB |
Output is correct |
18 |
Correct |
1 ms |
1108 KB |
Output is correct |
19 |
Correct |
1 ms |
1108 KB |
Output is correct |
20 |
Correct |
1 ms |
1108 KB |
Output is correct |
21 |
Correct |
1 ms |
1108 KB |
Output is correct |
22 |
Correct |
9 ms |
1828 KB |
Output is correct |
23 |
Correct |
12 ms |
1876 KB |
Output is correct |
24 |
Correct |
9 ms |
1876 KB |
Output is correct |
25 |
Correct |
2 ms |
1236 KB |
Output is correct |
26 |
Correct |
2 ms |
1236 KB |
Output is correct |
27 |
Correct |
2 ms |
1280 KB |
Output is correct |
28 |
Correct |
2 ms |
1236 KB |
Output is correct |
29 |
Correct |
2 ms |
1236 KB |
Output is correct |
30 |
Correct |
2 ms |
1236 KB |
Output is correct |
31 |
Correct |
5 ms |
1620 KB |
Output is correct |
32 |
Correct |
5 ms |
1608 KB |
Output is correct |
33 |
Correct |
5 ms |
1620 KB |
Output is correct |
34 |
Correct |
6 ms |
1620 KB |
Output is correct |
35 |
Correct |
5 ms |
1620 KB |
Output is correct |
36 |
Correct |
5 ms |
1620 KB |
Output is correct |
37 |
Correct |
11 ms |
2260 KB |
Output is correct |
38 |
Correct |
12 ms |
2160 KB |
Output is correct |
39 |
Correct |
12 ms |
2260 KB |
Output is correct |
40 |
Correct |
8 ms |
2132 KB |
Output is correct |
41 |
Correct |
5 ms |
1696 KB |
Output is correct |
42 |
Correct |
8 ms |
2260 KB |
Output is correct |
43 |
Correct |
6 ms |
1856 KB |
Output is correct |
44 |
Correct |
5 ms |
1748 KB |
Output is correct |
45 |
Correct |
8 ms |
2260 KB |
Output is correct |
46 |
Correct |
29 ms |
7816 KB |
Output is correct |
47 |
Correct |
17 ms |
4560 KB |
Output is correct |
48 |
Correct |
21 ms |
7108 KB |
Output is correct |
49 |
Correct |
23 ms |
6440 KB |
Output is correct |
50 |
Correct |
23 ms |
5908 KB |
Output is correct |
51 |
Correct |
18 ms |
4312 KB |
Output is correct |
52 |
Correct |
8 ms |
2252 KB |
Output is correct |
53 |
Correct |
8 ms |
2260 KB |
Output is correct |
54 |
Correct |
7 ms |
2260 KB |
Output is correct |
55 |
Correct |
8 ms |
2260 KB |
Output is correct |
56 |
Correct |
8 ms |
2260 KB |
Output is correct |
57 |
Correct |
8 ms |
2260 KB |
Output is correct |
58 |
Correct |
29 ms |
8148 KB |
Output is correct |
59 |
Correct |
29 ms |
8132 KB |
Output is correct |
60 |
Correct |
30 ms |
8124 KB |
Output is correct |
61 |
Correct |
29 ms |
8172 KB |
Output is correct |
62 |
Correct |
33 ms |
8148 KB |
Output is correct |
63 |
Correct |
30 ms |
8128 KB |
Output is correct |
64 |
Correct |
29 ms |
7356 KB |
Output is correct |
65 |
Correct |
29 ms |
7408 KB |
Output is correct |
66 |
Correct |
28 ms |
7372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
980 KB |
Output is correct |
2 |
Correct |
1 ms |
980 KB |
Output is correct |
3 |
Correct |
1 ms |
980 KB |
Output is correct |
4 |
Correct |
1 ms |
980 KB |
Output is correct |
5 |
Correct |
1 ms |
980 KB |
Output is correct |
6 |
Correct |
1 ms |
980 KB |
Output is correct |
7 |
Correct |
1 ms |
980 KB |
Output is correct |
8 |
Correct |
1 ms |
980 KB |
Output is correct |
9 |
Correct |
1 ms |
980 KB |
Output is correct |
10 |
Correct |
1 ms |
980 KB |
Output is correct |
11 |
Correct |
1 ms |
980 KB |
Output is correct |
12 |
Correct |
1 ms |
980 KB |
Output is correct |
13 |
Correct |
1 ms |
1108 KB |
Output is correct |
14 |
Correct |
1 ms |
1108 KB |
Output is correct |
15 |
Correct |
1 ms |
1108 KB |
Output is correct |
16 |
Correct |
1 ms |
980 KB |
Output is correct |
17 |
Correct |
1 ms |
1108 KB |
Output is correct |
18 |
Correct |
1 ms |
1108 KB |
Output is correct |
19 |
Correct |
1 ms |
1108 KB |
Output is correct |
20 |
Correct |
1 ms |
1108 KB |
Output is correct |
21 |
Correct |
1 ms |
1108 KB |
Output is correct |
22 |
Correct |
1 ms |
980 KB |
Output is correct |
23 |
Correct |
1 ms |
980 KB |
Output is correct |
24 |
Correct |
1 ms |
980 KB |
Output is correct |
25 |
Correct |
1 ms |
980 KB |
Output is correct |
26 |
Correct |
1 ms |
980 KB |
Output is correct |
27 |
Correct |
1 ms |
980 KB |
Output is correct |
28 |
Correct |
1 ms |
980 KB |
Output is correct |
29 |
Correct |
1 ms |
980 KB |
Output is correct |
30 |
Correct |
1 ms |
980 KB |
Output is correct |
31 |
Correct |
1 ms |
980 KB |
Output is correct |
32 |
Correct |
1 ms |
980 KB |
Output is correct |
33 |
Correct |
2 ms |
980 KB |
Output is correct |
34 |
Correct |
2 ms |
1108 KB |
Output is correct |
35 |
Correct |
1 ms |
980 KB |
Output is correct |
36 |
Correct |
2 ms |
980 KB |
Output is correct |
37 |
Correct |
2 ms |
1108 KB |
Output is correct |
38 |
Correct |
1 ms |
980 KB |
Output is correct |
39 |
Correct |
1 ms |
980 KB |
Output is correct |
40 |
Correct |
2 ms |
1108 KB |
Output is correct |
41 |
Correct |
2 ms |
980 KB |
Output is correct |
42 |
Correct |
2 ms |
980 KB |
Output is correct |
43 |
Correct |
1 ms |
980 KB |
Output is correct |
44 |
Correct |
1 ms |
980 KB |
Output is correct |
45 |
Correct |
1 ms |
980 KB |
Output is correct |
46 |
Correct |
1 ms |
980 KB |
Output is correct |
47 |
Correct |
1 ms |
980 KB |
Output is correct |
48 |
Correct |
1 ms |
980 KB |
Output is correct |
49 |
Correct |
1 ms |
980 KB |
Output is correct |
50 |
Correct |
3 ms |
1108 KB |
Output is correct |
51 |
Correct |
3 ms |
1108 KB |
Output is correct |
52 |
Correct |
3 ms |
1108 KB |
Output is correct |
53 |
Correct |
3 ms |
1108 KB |
Output is correct |
54 |
Correct |
3 ms |
1108 KB |
Output is correct |
55 |
Correct |
3 ms |
1108 KB |
Output is correct |
56 |
Correct |
3 ms |
1108 KB |
Output is correct |
57 |
Correct |
2 ms |
1108 KB |
Output is correct |
58 |
Correct |
3 ms |
980 KB |
Output is correct |
59 |
Correct |
3 ms |
1108 KB |
Output is correct |
60 |
Correct |
3 ms |
1108 KB |
Output is correct |
61 |
Correct |
2 ms |
1108 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
980 KB |
Output is correct |
2 |
Correct |
1 ms |
980 KB |
Output is correct |
3 |
Correct |
1 ms |
980 KB |
Output is correct |
4 |
Correct |
1 ms |
980 KB |
Output is correct |
5 |
Correct |
1 ms |
980 KB |
Output is correct |
6 |
Correct |
1 ms |
980 KB |
Output is correct |
7 |
Correct |
1 ms |
980 KB |
Output is correct |
8 |
Correct |
1 ms |
980 KB |
Output is correct |
9 |
Correct |
1 ms |
980 KB |
Output is correct |
10 |
Correct |
1 ms |
980 KB |
Output is correct |
11 |
Correct |
1 ms |
980 KB |
Output is correct |
12 |
Correct |
1 ms |
980 KB |
Output is correct |
13 |
Correct |
1 ms |
980 KB |
Output is correct |
14 |
Correct |
1 ms |
980 KB |
Output is correct |
15 |
Correct |
1 ms |
1108 KB |
Output is correct |
16 |
Correct |
1 ms |
1108 KB |
Output is correct |
17 |
Correct |
1 ms |
1108 KB |
Output is correct |
18 |
Correct |
1 ms |
980 KB |
Output is correct |
19 |
Correct |
1 ms |
1108 KB |
Output is correct |
20 |
Correct |
1 ms |
1108 KB |
Output is correct |
21 |
Correct |
1 ms |
1108 KB |
Output is correct |
22 |
Correct |
1 ms |
1108 KB |
Output is correct |
23 |
Correct |
1 ms |
1108 KB |
Output is correct |
24 |
Correct |
9 ms |
1828 KB |
Output is correct |
25 |
Correct |
12 ms |
1876 KB |
Output is correct |
26 |
Correct |
9 ms |
1876 KB |
Output is correct |
27 |
Correct |
1 ms |
980 KB |
Output is correct |
28 |
Correct |
1 ms |
980 KB |
Output is correct |
29 |
Correct |
1 ms |
980 KB |
Output is correct |
30 |
Correct |
1 ms |
980 KB |
Output is correct |
31 |
Correct |
1 ms |
980 KB |
Output is correct |
32 |
Correct |
1 ms |
980 KB |
Output is correct |
33 |
Correct |
1 ms |
980 KB |
Output is correct |
34 |
Correct |
1 ms |
980 KB |
Output is correct |
35 |
Correct |
1 ms |
980 KB |
Output is correct |
36 |
Correct |
2 ms |
980 KB |
Output is correct |
37 |
Correct |
2 ms |
1108 KB |
Output is correct |
38 |
Correct |
1 ms |
980 KB |
Output is correct |
39 |
Correct |
2 ms |
980 KB |
Output is correct |
40 |
Correct |
2 ms |
1108 KB |
Output is correct |
41 |
Correct |
1 ms |
980 KB |
Output is correct |
42 |
Correct |
1 ms |
980 KB |
Output is correct |
43 |
Correct |
2 ms |
1108 KB |
Output is correct |
44 |
Correct |
2 ms |
980 KB |
Output is correct |
45 |
Correct |
2 ms |
980 KB |
Output is correct |
46 |
Correct |
1 ms |
980 KB |
Output is correct |
47 |
Correct |
1 ms |
980 KB |
Output is correct |
48 |
Correct |
1 ms |
980 KB |
Output is correct |
49 |
Correct |
1 ms |
980 KB |
Output is correct |
50 |
Correct |
1 ms |
980 KB |
Output is correct |
51 |
Correct |
1 ms |
980 KB |
Output is correct |
52 |
Correct |
1 ms |
980 KB |
Output is correct |
53 |
Correct |
3 ms |
1108 KB |
Output is correct |
54 |
Correct |
3 ms |
1108 KB |
Output is correct |
55 |
Correct |
3 ms |
1108 KB |
Output is correct |
56 |
Correct |
3 ms |
1108 KB |
Output is correct |
57 |
Correct |
3 ms |
1108 KB |
Output is correct |
58 |
Correct |
3 ms |
1108 KB |
Output is correct |
59 |
Correct |
3 ms |
1108 KB |
Output is correct |
60 |
Correct |
2 ms |
1108 KB |
Output is correct |
61 |
Correct |
3 ms |
980 KB |
Output is correct |
62 |
Correct |
3 ms |
1108 KB |
Output is correct |
63 |
Correct |
3 ms |
1108 KB |
Output is correct |
64 |
Correct |
2 ms |
1108 KB |
Output is correct |
65 |
Correct |
1 ms |
1108 KB |
Output is correct |
66 |
Correct |
1 ms |
980 KB |
Output is correct |
67 |
Correct |
2 ms |
980 KB |
Output is correct |
68 |
Correct |
1 ms |
980 KB |
Output is correct |
69 |
Correct |
1 ms |
980 KB |
Output is correct |
70 |
Correct |
6 ms |
1184 KB |
Output is correct |
71 |
Correct |
5 ms |
1108 KB |
Output is correct |
72 |
Correct |
4 ms |
1108 KB |
Output is correct |
73 |
Correct |
1 ms |
1108 KB |
Output is correct |
74 |
Correct |
4 ms |
1108 KB |
Output is correct |
75 |
Correct |
4 ms |
1108 KB |
Output is correct |
76 |
Correct |
12 ms |
1892 KB |
Output is correct |
77 |
Correct |
11 ms |
2032 KB |
Output is correct |
78 |
Correct |
14 ms |
2132 KB |
Output is correct |
79 |
Correct |
1 ms |
980 KB |
Output is correct |
80 |
Correct |
2 ms |
1108 KB |
Output is correct |
81 |
Correct |
2 ms |
1108 KB |
Output is correct |
82 |
Correct |
2 ms |
1108 KB |
Output is correct |
83 |
Correct |
2 ms |
1108 KB |
Output is correct |
84 |
Correct |
7 ms |
1108 KB |
Output is correct |
85 |
Correct |
7 ms |
1108 KB |
Output is correct |
86 |
Correct |
6 ms |
1108 KB |
Output is correct |
87 |
Correct |
6 ms |
1108 KB |
Output is correct |
88 |
Correct |
7 ms |
1108 KB |
Output is correct |
89 |
Correct |
7 ms |
1108 KB |
Output is correct |
90 |
Correct |
22 ms |
2252 KB |
Output is correct |
91 |
Correct |
22 ms |
2260 KB |
Output is correct |
92 |
Correct |
24 ms |
2312 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
980 KB |
Output is correct |
2 |
Correct |
1 ms |
980 KB |
Output is correct |
3 |
Correct |
1 ms |
980 KB |
Output is correct |
4 |
Correct |
1 ms |
980 KB |
Output is correct |
5 |
Correct |
1 ms |
980 KB |
Output is correct |
6 |
Correct |
1 ms |
980 KB |
Output is correct |
7 |
Correct |
1 ms |
980 KB |
Output is correct |
8 |
Correct |
1 ms |
980 KB |
Output is correct |
9 |
Correct |
1 ms |
980 KB |
Output is correct |
10 |
Correct |
1 ms |
980 KB |
Output is correct |
11 |
Correct |
1 ms |
980 KB |
Output is correct |
12 |
Correct |
1 ms |
980 KB |
Output is correct |
13 |
Correct |
1 ms |
980 KB |
Output is correct |
14 |
Correct |
1 ms |
980 KB |
Output is correct |
15 |
Correct |
1 ms |
1108 KB |
Output is correct |
16 |
Correct |
1 ms |
1108 KB |
Output is correct |
17 |
Correct |
1 ms |
1108 KB |
Output is correct |
18 |
Correct |
1 ms |
980 KB |
Output is correct |
19 |
Correct |
1 ms |
1108 KB |
Output is correct |
20 |
Correct |
1 ms |
1108 KB |
Output is correct |
21 |
Correct |
1 ms |
1108 KB |
Output is correct |
22 |
Correct |
1 ms |
1108 KB |
Output is correct |
23 |
Correct |
1 ms |
1108 KB |
Output is correct |
24 |
Correct |
9 ms |
1828 KB |
Output is correct |
25 |
Correct |
12 ms |
1876 KB |
Output is correct |
26 |
Correct |
9 ms |
1876 KB |
Output is correct |
27 |
Correct |
2 ms |
1236 KB |
Output is correct |
28 |
Correct |
2 ms |
1236 KB |
Output is correct |
29 |
Correct |
2 ms |
1280 KB |
Output is correct |
30 |
Correct |
2 ms |
1236 KB |
Output is correct |
31 |
Correct |
2 ms |
1236 KB |
Output is correct |
32 |
Correct |
2 ms |
1236 KB |
Output is correct |
33 |
Correct |
5 ms |
1620 KB |
Output is correct |
34 |
Correct |
5 ms |
1608 KB |
Output is correct |
35 |
Correct |
5 ms |
1620 KB |
Output is correct |
36 |
Correct |
6 ms |
1620 KB |
Output is correct |
37 |
Correct |
5 ms |
1620 KB |
Output is correct |
38 |
Correct |
5 ms |
1620 KB |
Output is correct |
39 |
Correct |
11 ms |
2260 KB |
Output is correct |
40 |
Correct |
12 ms |
2160 KB |
Output is correct |
41 |
Correct |
12 ms |
2260 KB |
Output is correct |
42 |
Correct |
1 ms |
980 KB |
Output is correct |
43 |
Correct |
1 ms |
980 KB |
Output is correct |
44 |
Correct |
1 ms |
980 KB |
Output is correct |
45 |
Correct |
1 ms |
980 KB |
Output is correct |
46 |
Correct |
1 ms |
980 KB |
Output is correct |
47 |
Correct |
1 ms |
980 KB |
Output is correct |
48 |
Correct |
1 ms |
980 KB |
Output is correct |
49 |
Correct |
1 ms |
980 KB |
Output is correct |
50 |
Correct |
1 ms |
980 KB |
Output is correct |
51 |
Correct |
2 ms |
980 KB |
Output is correct |
52 |
Correct |
2 ms |
1108 KB |
Output is correct |
53 |
Correct |
1 ms |
980 KB |
Output is correct |
54 |
Correct |
2 ms |
980 KB |
Output is correct |
55 |
Correct |
2 ms |
1108 KB |
Output is correct |
56 |
Correct |
1 ms |
980 KB |
Output is correct |
57 |
Correct |
1 ms |
980 KB |
Output is correct |
58 |
Correct |
2 ms |
1108 KB |
Output is correct |
59 |
Correct |
2 ms |
980 KB |
Output is correct |
60 |
Correct |
2 ms |
980 KB |
Output is correct |
61 |
Correct |
1 ms |
980 KB |
Output is correct |
62 |
Correct |
1 ms |
980 KB |
Output is correct |
63 |
Correct |
1 ms |
980 KB |
Output is correct |
64 |
Correct |
1 ms |
980 KB |
Output is correct |
65 |
Correct |
1 ms |
980 KB |
Output is correct |
66 |
Correct |
1 ms |
980 KB |
Output is correct |
67 |
Correct |
1 ms |
980 KB |
Output is correct |
68 |
Correct |
3 ms |
1108 KB |
Output is correct |
69 |
Correct |
3 ms |
1108 KB |
Output is correct |
70 |
Correct |
3 ms |
1108 KB |
Output is correct |
71 |
Correct |
3 ms |
1108 KB |
Output is correct |
72 |
Correct |
3 ms |
1108 KB |
Output is correct |
73 |
Correct |
3 ms |
1108 KB |
Output is correct |
74 |
Correct |
3 ms |
1108 KB |
Output is correct |
75 |
Correct |
2 ms |
1108 KB |
Output is correct |
76 |
Correct |
3 ms |
980 KB |
Output is correct |
77 |
Correct |
3 ms |
1108 KB |
Output is correct |
78 |
Correct |
3 ms |
1108 KB |
Output is correct |
79 |
Correct |
2 ms |
1108 KB |
Output is correct |
80 |
Correct |
1 ms |
1108 KB |
Output is correct |
81 |
Correct |
1 ms |
980 KB |
Output is correct |
82 |
Correct |
2 ms |
980 KB |
Output is correct |
83 |
Correct |
1 ms |
980 KB |
Output is correct |
84 |
Correct |
1 ms |
980 KB |
Output is correct |
85 |
Correct |
6 ms |
1184 KB |
Output is correct |
86 |
Correct |
5 ms |
1108 KB |
Output is correct |
87 |
Correct |
4 ms |
1108 KB |
Output is correct |
88 |
Correct |
1 ms |
1108 KB |
Output is correct |
89 |
Correct |
4 ms |
1108 KB |
Output is correct |
90 |
Correct |
4 ms |
1108 KB |
Output is correct |
91 |
Correct |
12 ms |
1892 KB |
Output is correct |
92 |
Correct |
11 ms |
2032 KB |
Output is correct |
93 |
Correct |
14 ms |
2132 KB |
Output is correct |
94 |
Correct |
1 ms |
980 KB |
Output is correct |
95 |
Correct |
2 ms |
1108 KB |
Output is correct |
96 |
Correct |
2 ms |
1108 KB |
Output is correct |
97 |
Correct |
2 ms |
1108 KB |
Output is correct |
98 |
Correct |
2 ms |
1108 KB |
Output is correct |
99 |
Correct |
7 ms |
1108 KB |
Output is correct |
100 |
Correct |
7 ms |
1108 KB |
Output is correct |
101 |
Correct |
6 ms |
1108 KB |
Output is correct |
102 |
Correct |
6 ms |
1108 KB |
Output is correct |
103 |
Correct |
7 ms |
1108 KB |
Output is correct |
104 |
Correct |
7 ms |
1108 KB |
Output is correct |
105 |
Correct |
22 ms |
2252 KB |
Output is correct |
106 |
Correct |
22 ms |
2260 KB |
Output is correct |
107 |
Correct |
24 ms |
2312 KB |
Output is correct |
108 |
Correct |
3 ms |
1364 KB |
Output is correct |
109 |
Correct |
52 ms |
1352 KB |
Output is correct |
110 |
Correct |
118 ms |
1316 KB |
Output is correct |
111 |
Correct |
131 ms |
1316 KB |
Output is correct |
112 |
Correct |
205 ms |
1372 KB |
Output is correct |
113 |
Correct |
175 ms |
1336 KB |
Output is correct |
114 |
Correct |
450 ms |
2124 KB |
Output is correct |
115 |
Correct |
60 ms |
2004 KB |
Output is correct |
116 |
Correct |
633 ms |
2448 KB |
Output is correct |
117 |
Correct |
333 ms |
2060 KB |
Output is correct |
118 |
Correct |
88 ms |
2168 KB |
Output is correct |
119 |
Correct |
738 ms |
2124 KB |
Output is correct |
120 |
Correct |
921 ms |
2668 KB |
Output is correct |
121 |
Correct |
524 ms |
1564 KB |
Output is correct |
122 |
Correct |
394 ms |
2908 KB |
Output is correct |
123 |
Correct |
204 ms |
1460 KB |
Output is correct |
124 |
Correct |
239 ms |
3208 KB |
Output is correct |
125 |
Correct |
147 ms |
1620 KB |
Output is correct |
126 |
Correct |
23 ms |
1740 KB |
Output is correct |
127 |
Correct |
394 ms |
1836 KB |
Output is correct |
128 |
Correct |
99 ms |
1596 KB |
Output is correct |
129 |
Correct |
137 ms |
1624 KB |
Output is correct |
130 |
Correct |
2 ms |
1340 KB |
Output is correct |
131 |
Correct |
73 ms |
1364 KB |
Output is correct |
132 |
Correct |
212 ms |
1456 KB |
Output is correct |
133 |
Correct |
280 ms |
1472 KB |
Output is correct |
134 |
Correct |
324 ms |
1492 KB |
Output is correct |
135 |
Correct |
369 ms |
1492 KB |
Output is correct |
136 |
Correct |
1455 ms |
2764 KB |
Output is correct |
137 |
Correct |
1469 ms |
2696 KB |
Output is correct |
138 |
Correct |
1464 ms |
2696 KB |
Output is correct |
139 |
Correct |
1450 ms |
2696 KB |
Output is correct |
140 |
Correct |
1461 ms |
2696 KB |
Output is correct |
141 |
Correct |
1468 ms |
2700 KB |
Output is correct |
142 |
Execution timed out |
1579 ms |
3648 KB |
Time limit exceeded |
143 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
980 KB |
Output is correct |
2 |
Correct |
1 ms |
980 KB |
Output is correct |
3 |
Correct |
1 ms |
980 KB |
Output is correct |
4 |
Correct |
1 ms |
980 KB |
Output is correct |
5 |
Correct |
1 ms |
980 KB |
Output is correct |
6 |
Correct |
1 ms |
980 KB |
Output is correct |
7 |
Correct |
1 ms |
980 KB |
Output is correct |
8 |
Correct |
1 ms |
980 KB |
Output is correct |
9 |
Correct |
1 ms |
980 KB |
Output is correct |
10 |
Correct |
1 ms |
980 KB |
Output is correct |
11 |
Correct |
1 ms |
980 KB |
Output is correct |
12 |
Correct |
1 ms |
980 KB |
Output is correct |
13 |
Correct |
1 ms |
980 KB |
Output is correct |
14 |
Correct |
1 ms |
980 KB |
Output is correct |
15 |
Correct |
1 ms |
1108 KB |
Output is correct |
16 |
Correct |
1 ms |
1108 KB |
Output is correct |
17 |
Correct |
1 ms |
1108 KB |
Output is correct |
18 |
Correct |
1 ms |
980 KB |
Output is correct |
19 |
Correct |
1 ms |
1108 KB |
Output is correct |
20 |
Correct |
1 ms |
1108 KB |
Output is correct |
21 |
Correct |
1 ms |
1108 KB |
Output is correct |
22 |
Correct |
1 ms |
1108 KB |
Output is correct |
23 |
Correct |
1 ms |
1108 KB |
Output is correct |
24 |
Correct |
9 ms |
1828 KB |
Output is correct |
25 |
Correct |
12 ms |
1876 KB |
Output is correct |
26 |
Correct |
9 ms |
1876 KB |
Output is correct |
27 |
Correct |
2 ms |
1236 KB |
Output is correct |
28 |
Correct |
2 ms |
1236 KB |
Output is correct |
29 |
Correct |
2 ms |
1280 KB |
Output is correct |
30 |
Correct |
2 ms |
1236 KB |
Output is correct |
31 |
Correct |
2 ms |
1236 KB |
Output is correct |
32 |
Correct |
2 ms |
1236 KB |
Output is correct |
33 |
Correct |
5 ms |
1620 KB |
Output is correct |
34 |
Correct |
5 ms |
1608 KB |
Output is correct |
35 |
Correct |
5 ms |
1620 KB |
Output is correct |
36 |
Correct |
6 ms |
1620 KB |
Output is correct |
37 |
Correct |
5 ms |
1620 KB |
Output is correct |
38 |
Correct |
5 ms |
1620 KB |
Output is correct |
39 |
Correct |
11 ms |
2260 KB |
Output is correct |
40 |
Correct |
12 ms |
2160 KB |
Output is correct |
41 |
Correct |
12 ms |
2260 KB |
Output is correct |
42 |
Correct |
8 ms |
2132 KB |
Output is correct |
43 |
Correct |
5 ms |
1696 KB |
Output is correct |
44 |
Correct |
8 ms |
2260 KB |
Output is correct |
45 |
Correct |
6 ms |
1856 KB |
Output is correct |
46 |
Correct |
5 ms |
1748 KB |
Output is correct |
47 |
Correct |
8 ms |
2260 KB |
Output is correct |
48 |
Correct |
29 ms |
7816 KB |
Output is correct |
49 |
Correct |
17 ms |
4560 KB |
Output is correct |
50 |
Correct |
21 ms |
7108 KB |
Output is correct |
51 |
Correct |
23 ms |
6440 KB |
Output is correct |
52 |
Correct |
23 ms |
5908 KB |
Output is correct |
53 |
Correct |
18 ms |
4312 KB |
Output is correct |
54 |
Correct |
8 ms |
2252 KB |
Output is correct |
55 |
Correct |
8 ms |
2260 KB |
Output is correct |
56 |
Correct |
7 ms |
2260 KB |
Output is correct |
57 |
Correct |
8 ms |
2260 KB |
Output is correct |
58 |
Correct |
8 ms |
2260 KB |
Output is correct |
59 |
Correct |
8 ms |
2260 KB |
Output is correct |
60 |
Correct |
29 ms |
8148 KB |
Output is correct |
61 |
Correct |
29 ms |
8132 KB |
Output is correct |
62 |
Correct |
30 ms |
8124 KB |
Output is correct |
63 |
Correct |
29 ms |
8172 KB |
Output is correct |
64 |
Correct |
33 ms |
8148 KB |
Output is correct |
65 |
Correct |
30 ms |
8128 KB |
Output is correct |
66 |
Correct |
29 ms |
7356 KB |
Output is correct |
67 |
Correct |
29 ms |
7408 KB |
Output is correct |
68 |
Correct |
28 ms |
7372 KB |
Output is correct |
69 |
Correct |
1 ms |
980 KB |
Output is correct |
70 |
Correct |
1 ms |
980 KB |
Output is correct |
71 |
Correct |
1 ms |
980 KB |
Output is correct |
72 |
Correct |
1 ms |
980 KB |
Output is correct |
73 |
Correct |
1 ms |
980 KB |
Output is correct |
74 |
Correct |
1 ms |
980 KB |
Output is correct |
75 |
Correct |
1 ms |
980 KB |
Output is correct |
76 |
Correct |
1 ms |
980 KB |
Output is correct |
77 |
Correct |
1 ms |
980 KB |
Output is correct |
78 |
Correct |
2 ms |
980 KB |
Output is correct |
79 |
Correct |
2 ms |
1108 KB |
Output is correct |
80 |
Correct |
1 ms |
980 KB |
Output is correct |
81 |
Correct |
2 ms |
980 KB |
Output is correct |
82 |
Correct |
2 ms |
1108 KB |
Output is correct |
83 |
Correct |
1 ms |
980 KB |
Output is correct |
84 |
Correct |
1 ms |
980 KB |
Output is correct |
85 |
Correct |
2 ms |
1108 KB |
Output is correct |
86 |
Correct |
2 ms |
980 KB |
Output is correct |
87 |
Correct |
2 ms |
980 KB |
Output is correct |
88 |
Correct |
1 ms |
980 KB |
Output is correct |
89 |
Correct |
1 ms |
980 KB |
Output is correct |
90 |
Correct |
1 ms |
980 KB |
Output is correct |
91 |
Correct |
1 ms |
980 KB |
Output is correct |
92 |
Correct |
1 ms |
980 KB |
Output is correct |
93 |
Correct |
1 ms |
980 KB |
Output is correct |
94 |
Correct |
1 ms |
980 KB |
Output is correct |
95 |
Correct |
3 ms |
1108 KB |
Output is correct |
96 |
Correct |
3 ms |
1108 KB |
Output is correct |
97 |
Correct |
3 ms |
1108 KB |
Output is correct |
98 |
Correct |
3 ms |
1108 KB |
Output is correct |
99 |
Correct |
3 ms |
1108 KB |
Output is correct |
100 |
Correct |
3 ms |
1108 KB |
Output is correct |
101 |
Correct |
3 ms |
1108 KB |
Output is correct |
102 |
Correct |
2 ms |
1108 KB |
Output is correct |
103 |
Correct |
3 ms |
980 KB |
Output is correct |
104 |
Correct |
3 ms |
1108 KB |
Output is correct |
105 |
Correct |
3 ms |
1108 KB |
Output is correct |
106 |
Correct |
2 ms |
1108 KB |
Output is correct |
107 |
Correct |
1 ms |
1108 KB |
Output is correct |
108 |
Correct |
1 ms |
980 KB |
Output is correct |
109 |
Correct |
2 ms |
980 KB |
Output is correct |
110 |
Correct |
1 ms |
980 KB |
Output is correct |
111 |
Correct |
1 ms |
980 KB |
Output is correct |
112 |
Correct |
6 ms |
1184 KB |
Output is correct |
113 |
Correct |
5 ms |
1108 KB |
Output is correct |
114 |
Correct |
4 ms |
1108 KB |
Output is correct |
115 |
Correct |
1 ms |
1108 KB |
Output is correct |
116 |
Correct |
4 ms |
1108 KB |
Output is correct |
117 |
Correct |
4 ms |
1108 KB |
Output is correct |
118 |
Correct |
12 ms |
1892 KB |
Output is correct |
119 |
Correct |
11 ms |
2032 KB |
Output is correct |
120 |
Correct |
14 ms |
2132 KB |
Output is correct |
121 |
Correct |
1 ms |
980 KB |
Output is correct |
122 |
Correct |
2 ms |
1108 KB |
Output is correct |
123 |
Correct |
2 ms |
1108 KB |
Output is correct |
124 |
Correct |
2 ms |
1108 KB |
Output is correct |
125 |
Correct |
2 ms |
1108 KB |
Output is correct |
126 |
Correct |
7 ms |
1108 KB |
Output is correct |
127 |
Correct |
7 ms |
1108 KB |
Output is correct |
128 |
Correct |
6 ms |
1108 KB |
Output is correct |
129 |
Correct |
6 ms |
1108 KB |
Output is correct |
130 |
Correct |
7 ms |
1108 KB |
Output is correct |
131 |
Correct |
7 ms |
1108 KB |
Output is correct |
132 |
Correct |
22 ms |
2252 KB |
Output is correct |
133 |
Correct |
22 ms |
2260 KB |
Output is correct |
134 |
Correct |
24 ms |
2312 KB |
Output is correct |
135 |
Correct |
3 ms |
1364 KB |
Output is correct |
136 |
Correct |
52 ms |
1352 KB |
Output is correct |
137 |
Correct |
118 ms |
1316 KB |
Output is correct |
138 |
Correct |
131 ms |
1316 KB |
Output is correct |
139 |
Correct |
205 ms |
1372 KB |
Output is correct |
140 |
Correct |
175 ms |
1336 KB |
Output is correct |
141 |
Correct |
450 ms |
2124 KB |
Output is correct |
142 |
Correct |
60 ms |
2004 KB |
Output is correct |
143 |
Correct |
633 ms |
2448 KB |
Output is correct |
144 |
Correct |
333 ms |
2060 KB |
Output is correct |
145 |
Correct |
88 ms |
2168 KB |
Output is correct |
146 |
Correct |
738 ms |
2124 KB |
Output is correct |
147 |
Correct |
921 ms |
2668 KB |
Output is correct |
148 |
Correct |
524 ms |
1564 KB |
Output is correct |
149 |
Correct |
394 ms |
2908 KB |
Output is correct |
150 |
Correct |
204 ms |
1460 KB |
Output is correct |
151 |
Correct |
239 ms |
3208 KB |
Output is correct |
152 |
Correct |
147 ms |
1620 KB |
Output is correct |
153 |
Correct |
23 ms |
1740 KB |
Output is correct |
154 |
Correct |
394 ms |
1836 KB |
Output is correct |
155 |
Correct |
99 ms |
1596 KB |
Output is correct |
156 |
Correct |
137 ms |
1624 KB |
Output is correct |
157 |
Correct |
2 ms |
1340 KB |
Output is correct |
158 |
Correct |
73 ms |
1364 KB |
Output is correct |
159 |
Correct |
212 ms |
1456 KB |
Output is correct |
160 |
Correct |
280 ms |
1472 KB |
Output is correct |
161 |
Correct |
324 ms |
1492 KB |
Output is correct |
162 |
Correct |
369 ms |
1492 KB |
Output is correct |
163 |
Correct |
1455 ms |
2764 KB |
Output is correct |
164 |
Correct |
1469 ms |
2696 KB |
Output is correct |
165 |
Correct |
1464 ms |
2696 KB |
Output is correct |
166 |
Correct |
1450 ms |
2696 KB |
Output is correct |
167 |
Correct |
1461 ms |
2696 KB |
Output is correct |
168 |
Correct |
1468 ms |
2700 KB |
Output is correct |
169 |
Execution timed out |
1579 ms |
3648 KB |
Time limit exceeded |
170 |
Halted |
0 ms |
0 KB |
- |