#include <bits/stdc++.h>
#include "paint.h"
// #pragma GCC optimize ("Ofast,unroll-loops")
// #pragma GCC target ("avx2")
using namespace std;
typedef long long ll;
typedef pair<int, int> pp;
#define per(i,r,l) for(int i = (r); i >= (l); i--)
#define rep(i,l,r) for(int i = (l); i < (r); i++)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define ss second
#define ff first
void err(istringstream *iss){}template<typename T,typename ...Args> void err(istringstream *iss,const T &_val, const Args&...args){string _name;*iss>>_name;if(_name.back()==',')_name.pop_back();cerr<<_name<<" = "<<_val<<", ",err(iss,args...);}
void IOS(){
cin.tie(0) -> sync_with_stdio(0);
#ifndef ONLINE_JUDGE
#define er(args ...) cerr << __LINE__ << ": ", err(new istringstream(string(#args)), args), cerr << endl
#else
#define er(args ...) 0
#endif
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll mod = 1e9 + 7, maxn = 3e5 + 5, lg = 22, inf = ll(1e9) + 5;
ll pw(ll a,ll b,ll md=mod){if(!b)return 1;ll k=pw(a,b>>1ll,md);return k*k%md*(b&1ll?a:1)%md;}
int vl[maxn], m, c[maxn];
vector<int> lik[maxn];
int add(int x, int y){
// x += y;
// if(x >= m) x -= m;
// return x;
return (x + y)%m;
}
int rem(int x, int y){
// x -= y;
// if(x < 0) x += m;
return (x - y + m)%m;
}
int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b){
::m = m;
rep(i,0,m){
rep(j,0,a[i]){
lik[b[i][j]].pb(i);
}
}
int bs = 0, cntm = 0;
auto upd = [&](int p, int k){
cntm -= vl[p] == m;
vl[p] += k;
cntm += vl[p] == m;
};
rep(i,0,m){
for(int x: lik[c[i]]){
upd(rem(x, i), 1);
}
}
int lst = -1, mx = -1, ans = 0;
rep(i,0,n-m+1){
if(cntm) mx = i + m - 1;
if(i > lst){
lst = mx;
ans++;
if(i > lst){
return -1;
}
}
if(i == n - m) break;
for(int x: lik[c[i]]){
upd(add(bs, x), -1);
}
for(int x: lik[c[i + m]]){
upd(add(bs, x), 1);
}
bs = rem(bs, 1);
}
if(lst - n + 1) {
if(mx == n-1) ans++;
else {
return -1;
}
}
return ans;
}
// int main(){ IOS();
// int n, k; cin >> n >> m >> k;
// rep(i,0,n){
// cin >> c[i];
// }
// rep(i,0,m){
// int a; cin >> a;
// rep(j,0,a){
// int cl; cin >> cl;
// lik[cl].pb(i);
// }
// }
// int bs = 0, cntm = 0;
// auto upd = [&](int p, int k){
// cntm -= vl[p] == m;
// vl[p] += k;
// cntm += vl[p] == m;
// };
// rep(i,0,m){
// for(int x: lik[c[i]]){
// // er(c[i], i, x);
// upd(rem(x, i), 1);
// }
// }
// int lst = -1, mx = -1, ans = 0;
// rep(i,0,n-m+1){
// // er(i, cntm);
// rep(i,0,m) cerr << vl[add(bs, i)] << ' ';
// cerr << endl;
// if(cntm) mx = i + m - 1;
// if(i > lst){
// lst = mx;
// ans++;
// if(i > lst){
// cout << -1 << '\n';
// return 0;
// }
// }
// if(i == n - m) break;
// for(int x: lik[c[i]]){
// upd(add(bs, x), -1);
// }
// for(int x: lik[c[i + m]]){
// upd(add(bs, x), 1);
// }
// bs = rem(bs, 1);
// }
// if(lst - n + 1) {
// if(mx == n-1) ans++;
// else {
// cout << -1 << '\n';
// return 0;
// }
// }
// cout << ans << '\n';
// return 0-0;
// }
/*
5 4 4
1 0 1 2 2
2 0 1
1 1
1 2
1 3
8 3 5
3 3 1 3 4 4 2 2
3 0 1 2
2 2 3
2 3 4
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
7252 KB |
Output is correct |
2 |
Correct |
4 ms |
7252 KB |
Output is correct |
3 |
Correct |
3 ms |
7252 KB |
Output is correct |
4 |
Correct |
3 ms |
7252 KB |
Output is correct |
5 |
Correct |
4 ms |
7252 KB |
Output is correct |
6 |
Correct |
4 ms |
7252 KB |
Output is correct |
7 |
Correct |
3 ms |
7252 KB |
Output is correct |
8 |
Correct |
4 ms |
7284 KB |
Output is correct |
9 |
Correct |
5 ms |
7364 KB |
Output is correct |
10 |
Correct |
4 ms |
7252 KB |
Output is correct |
11 |
Correct |
4 ms |
7352 KB |
Output is correct |
12 |
Correct |
3 ms |
7252 KB |
Output is correct |
13 |
Correct |
4 ms |
7380 KB |
Output is correct |
14 |
Correct |
4 ms |
7400 KB |
Output is correct |
15 |
Correct |
4 ms |
7380 KB |
Output is correct |
16 |
Correct |
4 ms |
7380 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
5 ms |
7408 KB |
Output is correct |
19 |
Correct |
4 ms |
7380 KB |
Output is correct |
20 |
Correct |
4 ms |
7408 KB |
Output is correct |
21 |
Correct |
5 ms |
7380 KB |
Output is correct |
22 |
Correct |
22 ms |
11200 KB |
Output is correct |
23 |
Correct |
22 ms |
11220 KB |
Output is correct |
24 |
Correct |
22 ms |
11224 KB |
Output is correct |
25 |
Correct |
5 ms |
7508 KB |
Output is correct |
26 |
Correct |
6 ms |
7508 KB |
Output is correct |
27 |
Correct |
5 ms |
7508 KB |
Output is correct |
28 |
Correct |
5 ms |
7508 KB |
Output is correct |
29 |
Correct |
6 ms |
7508 KB |
Output is correct |
30 |
Correct |
5 ms |
7508 KB |
Output is correct |
31 |
Correct |
16 ms |
8332 KB |
Output is correct |
32 |
Correct |
11 ms |
8328 KB |
Output is correct |
33 |
Correct |
11 ms |
8404 KB |
Output is correct |
34 |
Correct |
11 ms |
8396 KB |
Output is correct |
35 |
Correct |
10 ms |
8404 KB |
Output is correct |
36 |
Correct |
10 ms |
8368 KB |
Output is correct |
37 |
Correct |
23 ms |
11608 KB |
Output is correct |
38 |
Correct |
24 ms |
11592 KB |
Output is correct |
39 |
Correct |
24 ms |
11572 KB |
Output is correct |
40 |
Correct |
12 ms |
8044 KB |
Output is correct |
41 |
Correct |
9 ms |
7764 KB |
Output is correct |
42 |
Correct |
11 ms |
8136 KB |
Output is correct |
43 |
Correct |
9 ms |
7880 KB |
Output is correct |
44 |
Correct |
8 ms |
7736 KB |
Output is correct |
45 |
Correct |
11 ms |
8144 KB |
Output is correct |
46 |
Correct |
40 ms |
16392 KB |
Output is correct |
47 |
Correct |
35 ms |
12364 KB |
Output is correct |
48 |
Correct |
29 ms |
14928 KB |
Output is correct |
49 |
Correct |
36 ms |
15184 KB |
Output is correct |
50 |
Correct |
36 ms |
14788 KB |
Output is correct |
51 |
Correct |
29 ms |
12464 KB |
Output is correct |
52 |
Correct |
13 ms |
8148 KB |
Output is correct |
53 |
Correct |
15 ms |
8148 KB |
Output is correct |
54 |
Correct |
11 ms |
8144 KB |
Output is correct |
55 |
Correct |
11 ms |
8148 KB |
Output is correct |
56 |
Correct |
10 ms |
8136 KB |
Output is correct |
57 |
Correct |
12 ms |
8140 KB |
Output is correct |
58 |
Correct |
48 ms |
17120 KB |
Output is correct |
59 |
Correct |
45 ms |
17136 KB |
Output is correct |
60 |
Correct |
57 ms |
17100 KB |
Output is correct |
61 |
Correct |
45 ms |
17132 KB |
Output is correct |
62 |
Correct |
44 ms |
17088 KB |
Output is correct |
63 |
Correct |
44 ms |
17072 KB |
Output is correct |
64 |
Correct |
44 ms |
16504 KB |
Output is correct |
65 |
Correct |
47 ms |
16456 KB |
Output is correct |
66 |
Correct |
44 ms |
16548 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
7252 KB |
Output is correct |
2 |
Correct |
4 ms |
7252 KB |
Output is correct |
3 |
Correct |
3 ms |
7252 KB |
Output is correct |
4 |
Correct |
3 ms |
7252 KB |
Output is correct |
5 |
Correct |
4 ms |
7252 KB |
Output is correct |
6 |
Correct |
4 ms |
7252 KB |
Output is correct |
7 |
Correct |
3 ms |
7252 KB |
Output is correct |
8 |
Correct |
4 ms |
7284 KB |
Output is correct |
9 |
Correct |
5 ms |
7364 KB |
Output is correct |
10 |
Correct |
4 ms |
7252 KB |
Output is correct |
11 |
Correct |
4 ms |
7352 KB |
Output is correct |
12 |
Correct |
3 ms |
7252 KB |
Output is correct |
13 |
Correct |
4 ms |
7380 KB |
Output is correct |
14 |
Correct |
4 ms |
7400 KB |
Output is correct |
15 |
Correct |
4 ms |
7380 KB |
Output is correct |
16 |
Correct |
4 ms |
7380 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
5 ms |
7408 KB |
Output is correct |
19 |
Correct |
4 ms |
7380 KB |
Output is correct |
20 |
Correct |
4 ms |
7408 KB |
Output is correct |
21 |
Correct |
5 ms |
7380 KB |
Output is correct |
22 |
Correct |
4 ms |
7252 KB |
Output is correct |
23 |
Correct |
4 ms |
7252 KB |
Output is correct |
24 |
Correct |
3 ms |
7252 KB |
Output is correct |
25 |
Correct |
4 ms |
7252 KB |
Output is correct |
26 |
Correct |
3 ms |
7252 KB |
Output is correct |
27 |
Correct |
4 ms |
7252 KB |
Output is correct |
28 |
Correct |
5 ms |
7252 KB |
Output is correct |
29 |
Correct |
4 ms |
7252 KB |
Output is correct |
30 |
Correct |
4 ms |
7380 KB |
Output is correct |
31 |
Correct |
4 ms |
7252 KB |
Output is correct |
32 |
Correct |
5 ms |
7252 KB |
Output is correct |
33 |
Correct |
4 ms |
7380 KB |
Output is correct |
34 |
Correct |
4 ms |
7380 KB |
Output is correct |
35 |
Correct |
4 ms |
7380 KB |
Output is correct |
36 |
Correct |
4 ms |
7380 KB |
Output is correct |
37 |
Correct |
4 ms |
7380 KB |
Output is correct |
38 |
Correct |
4 ms |
7380 KB |
Output is correct |
39 |
Correct |
4 ms |
7252 KB |
Output is correct |
40 |
Correct |
4 ms |
7380 KB |
Output is correct |
41 |
Correct |
4 ms |
7380 KB |
Output is correct |
42 |
Correct |
4 ms |
7380 KB |
Output is correct |
43 |
Correct |
4 ms |
7480 KB |
Output is correct |
44 |
Correct |
4 ms |
7252 KB |
Output is correct |
45 |
Correct |
4 ms |
7252 KB |
Output is correct |
46 |
Correct |
4 ms |
7252 KB |
Output is correct |
47 |
Correct |
4 ms |
7252 KB |
Output is correct |
48 |
Correct |
5 ms |
7344 KB |
Output is correct |
49 |
Correct |
4 ms |
7252 KB |
Output is correct |
50 |
Correct |
6 ms |
7312 KB |
Output is correct |
51 |
Correct |
4 ms |
7380 KB |
Output is correct |
52 |
Correct |
4 ms |
7368 KB |
Output is correct |
53 |
Correct |
4 ms |
7380 KB |
Output is correct |
54 |
Correct |
4 ms |
7380 KB |
Output is correct |
55 |
Correct |
4 ms |
7380 KB |
Output is correct |
56 |
Correct |
4 ms |
7380 KB |
Output is correct |
57 |
Correct |
4 ms |
7380 KB |
Output is correct |
58 |
Correct |
4 ms |
7380 KB |
Output is correct |
59 |
Correct |
4 ms |
7380 KB |
Output is correct |
60 |
Correct |
4 ms |
7380 KB |
Output is correct |
61 |
Correct |
4 ms |
7380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Correct |
4 ms |
7252 KB |
Output is correct |
3 |
Correct |
3 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7252 KB |
Output is correct |
5 |
Correct |
3 ms |
7252 KB |
Output is correct |
6 |
Correct |
3 ms |
7252 KB |
Output is correct |
7 |
Correct |
4 ms |
7252 KB |
Output is correct |
8 |
Correct |
4 ms |
7252 KB |
Output is correct |
9 |
Correct |
3 ms |
7252 KB |
Output is correct |
10 |
Correct |
4 ms |
7284 KB |
Output is correct |
11 |
Correct |
5 ms |
7364 KB |
Output is correct |
12 |
Correct |
4 ms |
7252 KB |
Output is correct |
13 |
Correct |
4 ms |
7352 KB |
Output is correct |
14 |
Correct |
3 ms |
7252 KB |
Output is correct |
15 |
Correct |
4 ms |
7380 KB |
Output is correct |
16 |
Correct |
4 ms |
7400 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
4 ms |
7380 KB |
Output is correct |
19 |
Correct |
4 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7408 KB |
Output is correct |
21 |
Correct |
4 ms |
7380 KB |
Output is correct |
22 |
Correct |
4 ms |
7408 KB |
Output is correct |
23 |
Correct |
5 ms |
7380 KB |
Output is correct |
24 |
Correct |
22 ms |
11200 KB |
Output is correct |
25 |
Correct |
22 ms |
11220 KB |
Output is correct |
26 |
Correct |
22 ms |
11224 KB |
Output is correct |
27 |
Correct |
3 ms |
7252 KB |
Output is correct |
28 |
Correct |
4 ms |
7252 KB |
Output is correct |
29 |
Correct |
3 ms |
7252 KB |
Output is correct |
30 |
Correct |
4 ms |
7252 KB |
Output is correct |
31 |
Correct |
5 ms |
7252 KB |
Output is correct |
32 |
Correct |
4 ms |
7252 KB |
Output is correct |
33 |
Correct |
4 ms |
7380 KB |
Output is correct |
34 |
Correct |
4 ms |
7252 KB |
Output is correct |
35 |
Correct |
5 ms |
7252 KB |
Output is correct |
36 |
Correct |
4 ms |
7380 KB |
Output is correct |
37 |
Correct |
4 ms |
7380 KB |
Output is correct |
38 |
Correct |
4 ms |
7380 KB |
Output is correct |
39 |
Correct |
4 ms |
7380 KB |
Output is correct |
40 |
Correct |
4 ms |
7380 KB |
Output is correct |
41 |
Correct |
4 ms |
7380 KB |
Output is correct |
42 |
Correct |
4 ms |
7252 KB |
Output is correct |
43 |
Correct |
4 ms |
7380 KB |
Output is correct |
44 |
Correct |
4 ms |
7380 KB |
Output is correct |
45 |
Correct |
4 ms |
7380 KB |
Output is correct |
46 |
Correct |
4 ms |
7480 KB |
Output is correct |
47 |
Correct |
4 ms |
7252 KB |
Output is correct |
48 |
Correct |
4 ms |
7252 KB |
Output is correct |
49 |
Correct |
4 ms |
7252 KB |
Output is correct |
50 |
Correct |
4 ms |
7252 KB |
Output is correct |
51 |
Correct |
5 ms |
7344 KB |
Output is correct |
52 |
Correct |
4 ms |
7252 KB |
Output is correct |
53 |
Correct |
6 ms |
7312 KB |
Output is correct |
54 |
Correct |
4 ms |
7380 KB |
Output is correct |
55 |
Correct |
4 ms |
7368 KB |
Output is correct |
56 |
Correct |
4 ms |
7380 KB |
Output is correct |
57 |
Correct |
4 ms |
7380 KB |
Output is correct |
58 |
Correct |
4 ms |
7380 KB |
Output is correct |
59 |
Correct |
4 ms |
7380 KB |
Output is correct |
60 |
Correct |
4 ms |
7380 KB |
Output is correct |
61 |
Correct |
4 ms |
7380 KB |
Output is correct |
62 |
Correct |
4 ms |
7380 KB |
Output is correct |
63 |
Correct |
4 ms |
7380 KB |
Output is correct |
64 |
Correct |
4 ms |
7380 KB |
Output is correct |
65 |
Correct |
4 ms |
7380 KB |
Output is correct |
66 |
Correct |
4 ms |
7252 KB |
Output is correct |
67 |
Correct |
4 ms |
7380 KB |
Output is correct |
68 |
Correct |
4 ms |
7380 KB |
Output is correct |
69 |
Correct |
5 ms |
7380 KB |
Output is correct |
70 |
Correct |
5 ms |
7508 KB |
Output is correct |
71 |
Correct |
5 ms |
7508 KB |
Output is correct |
72 |
Correct |
5 ms |
7508 KB |
Output is correct |
73 |
Correct |
5 ms |
7388 KB |
Output is correct |
74 |
Correct |
6 ms |
7508 KB |
Output is correct |
75 |
Correct |
5 ms |
7508 KB |
Output is correct |
76 |
Correct |
24 ms |
10024 KB |
Output is correct |
77 |
Correct |
20 ms |
10384 KB |
Output is correct |
78 |
Correct |
25 ms |
10808 KB |
Output is correct |
79 |
Correct |
5 ms |
7380 KB |
Output is correct |
80 |
Correct |
5 ms |
7380 KB |
Output is correct |
81 |
Correct |
5 ms |
7380 KB |
Output is correct |
82 |
Correct |
5 ms |
7396 KB |
Output is correct |
83 |
Correct |
5 ms |
7380 KB |
Output is correct |
84 |
Correct |
6 ms |
7508 KB |
Output is correct |
85 |
Correct |
6 ms |
7508 KB |
Output is correct |
86 |
Correct |
6 ms |
7508 KB |
Output is correct |
87 |
Correct |
6 ms |
7508 KB |
Output is correct |
88 |
Correct |
5 ms |
7508 KB |
Output is correct |
89 |
Correct |
6 ms |
7508 KB |
Output is correct |
90 |
Correct |
30 ms |
11084 KB |
Output is correct |
91 |
Correct |
33 ms |
11092 KB |
Output is correct |
92 |
Correct |
30 ms |
10972 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Correct |
4 ms |
7252 KB |
Output is correct |
3 |
Correct |
3 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7252 KB |
Output is correct |
5 |
Correct |
3 ms |
7252 KB |
Output is correct |
6 |
Correct |
3 ms |
7252 KB |
Output is correct |
7 |
Correct |
4 ms |
7252 KB |
Output is correct |
8 |
Correct |
4 ms |
7252 KB |
Output is correct |
9 |
Correct |
3 ms |
7252 KB |
Output is correct |
10 |
Correct |
4 ms |
7284 KB |
Output is correct |
11 |
Correct |
5 ms |
7364 KB |
Output is correct |
12 |
Correct |
4 ms |
7252 KB |
Output is correct |
13 |
Correct |
4 ms |
7352 KB |
Output is correct |
14 |
Correct |
3 ms |
7252 KB |
Output is correct |
15 |
Correct |
4 ms |
7380 KB |
Output is correct |
16 |
Correct |
4 ms |
7400 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
4 ms |
7380 KB |
Output is correct |
19 |
Correct |
4 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7408 KB |
Output is correct |
21 |
Correct |
4 ms |
7380 KB |
Output is correct |
22 |
Correct |
4 ms |
7408 KB |
Output is correct |
23 |
Correct |
5 ms |
7380 KB |
Output is correct |
24 |
Correct |
22 ms |
11200 KB |
Output is correct |
25 |
Correct |
22 ms |
11220 KB |
Output is correct |
26 |
Correct |
22 ms |
11224 KB |
Output is correct |
27 |
Correct |
5 ms |
7508 KB |
Output is correct |
28 |
Correct |
6 ms |
7508 KB |
Output is correct |
29 |
Correct |
5 ms |
7508 KB |
Output is correct |
30 |
Correct |
5 ms |
7508 KB |
Output is correct |
31 |
Correct |
6 ms |
7508 KB |
Output is correct |
32 |
Correct |
5 ms |
7508 KB |
Output is correct |
33 |
Correct |
16 ms |
8332 KB |
Output is correct |
34 |
Correct |
11 ms |
8328 KB |
Output is correct |
35 |
Correct |
11 ms |
8404 KB |
Output is correct |
36 |
Correct |
11 ms |
8396 KB |
Output is correct |
37 |
Correct |
10 ms |
8404 KB |
Output is correct |
38 |
Correct |
10 ms |
8368 KB |
Output is correct |
39 |
Correct |
23 ms |
11608 KB |
Output is correct |
40 |
Correct |
24 ms |
11592 KB |
Output is correct |
41 |
Correct |
24 ms |
11572 KB |
Output is correct |
42 |
Correct |
3 ms |
7252 KB |
Output is correct |
43 |
Correct |
4 ms |
7252 KB |
Output is correct |
44 |
Correct |
3 ms |
7252 KB |
Output is correct |
45 |
Correct |
4 ms |
7252 KB |
Output is correct |
46 |
Correct |
5 ms |
7252 KB |
Output is correct |
47 |
Correct |
4 ms |
7252 KB |
Output is correct |
48 |
Correct |
4 ms |
7380 KB |
Output is correct |
49 |
Correct |
4 ms |
7252 KB |
Output is correct |
50 |
Correct |
5 ms |
7252 KB |
Output is correct |
51 |
Correct |
4 ms |
7380 KB |
Output is correct |
52 |
Correct |
4 ms |
7380 KB |
Output is correct |
53 |
Correct |
4 ms |
7380 KB |
Output is correct |
54 |
Correct |
4 ms |
7380 KB |
Output is correct |
55 |
Correct |
4 ms |
7380 KB |
Output is correct |
56 |
Correct |
4 ms |
7380 KB |
Output is correct |
57 |
Correct |
4 ms |
7252 KB |
Output is correct |
58 |
Correct |
4 ms |
7380 KB |
Output is correct |
59 |
Correct |
4 ms |
7380 KB |
Output is correct |
60 |
Correct |
4 ms |
7380 KB |
Output is correct |
61 |
Correct |
4 ms |
7480 KB |
Output is correct |
62 |
Correct |
4 ms |
7252 KB |
Output is correct |
63 |
Correct |
4 ms |
7252 KB |
Output is correct |
64 |
Correct |
4 ms |
7252 KB |
Output is correct |
65 |
Correct |
4 ms |
7252 KB |
Output is correct |
66 |
Correct |
5 ms |
7344 KB |
Output is correct |
67 |
Correct |
4 ms |
7252 KB |
Output is correct |
68 |
Correct |
6 ms |
7312 KB |
Output is correct |
69 |
Correct |
4 ms |
7380 KB |
Output is correct |
70 |
Correct |
4 ms |
7368 KB |
Output is correct |
71 |
Correct |
4 ms |
7380 KB |
Output is correct |
72 |
Correct |
4 ms |
7380 KB |
Output is correct |
73 |
Correct |
4 ms |
7380 KB |
Output is correct |
74 |
Correct |
4 ms |
7380 KB |
Output is correct |
75 |
Correct |
4 ms |
7380 KB |
Output is correct |
76 |
Correct |
4 ms |
7380 KB |
Output is correct |
77 |
Correct |
4 ms |
7380 KB |
Output is correct |
78 |
Correct |
4 ms |
7380 KB |
Output is correct |
79 |
Correct |
4 ms |
7380 KB |
Output is correct |
80 |
Correct |
4 ms |
7380 KB |
Output is correct |
81 |
Correct |
4 ms |
7252 KB |
Output is correct |
82 |
Correct |
4 ms |
7380 KB |
Output is correct |
83 |
Correct |
4 ms |
7380 KB |
Output is correct |
84 |
Correct |
5 ms |
7380 KB |
Output is correct |
85 |
Correct |
5 ms |
7508 KB |
Output is correct |
86 |
Correct |
5 ms |
7508 KB |
Output is correct |
87 |
Correct |
5 ms |
7508 KB |
Output is correct |
88 |
Correct |
5 ms |
7388 KB |
Output is correct |
89 |
Correct |
6 ms |
7508 KB |
Output is correct |
90 |
Correct |
5 ms |
7508 KB |
Output is correct |
91 |
Correct |
24 ms |
10024 KB |
Output is correct |
92 |
Correct |
20 ms |
10384 KB |
Output is correct |
93 |
Correct |
25 ms |
10808 KB |
Output is correct |
94 |
Correct |
5 ms |
7380 KB |
Output is correct |
95 |
Correct |
5 ms |
7380 KB |
Output is correct |
96 |
Correct |
5 ms |
7380 KB |
Output is correct |
97 |
Correct |
5 ms |
7396 KB |
Output is correct |
98 |
Correct |
5 ms |
7380 KB |
Output is correct |
99 |
Correct |
6 ms |
7508 KB |
Output is correct |
100 |
Correct |
6 ms |
7508 KB |
Output is correct |
101 |
Correct |
6 ms |
7508 KB |
Output is correct |
102 |
Correct |
6 ms |
7508 KB |
Output is correct |
103 |
Correct |
5 ms |
7508 KB |
Output is correct |
104 |
Correct |
6 ms |
7508 KB |
Output is correct |
105 |
Correct |
30 ms |
11084 KB |
Output is correct |
106 |
Correct |
33 ms |
11092 KB |
Output is correct |
107 |
Correct |
30 ms |
10972 KB |
Output is correct |
108 |
Correct |
6 ms |
7508 KB |
Output is correct |
109 |
Correct |
126 ms |
7528 KB |
Output is correct |
110 |
Correct |
7 ms |
7464 KB |
Output is correct |
111 |
Correct |
7 ms |
7636 KB |
Output is correct |
112 |
Correct |
7 ms |
7584 KB |
Output is correct |
113 |
Correct |
6 ms |
7508 KB |
Output is correct |
114 |
Correct |
15 ms |
8532 KB |
Output is correct |
115 |
Correct |
15 ms |
8404 KB |
Output is correct |
116 |
Correct |
18 ms |
8632 KB |
Output is correct |
117 |
Correct |
15 ms |
8532 KB |
Output is correct |
118 |
Correct |
16 ms |
8660 KB |
Output is correct |
119 |
Correct |
14 ms |
8380 KB |
Output is correct |
120 |
Correct |
21 ms |
9812 KB |
Output is correct |
121 |
Correct |
8 ms |
7892 KB |
Output is correct |
122 |
Correct |
23 ms |
9884 KB |
Output is correct |
123 |
Correct |
7 ms |
7764 KB |
Output is correct |
124 |
Correct |
26 ms |
10500 KB |
Output is correct |
125 |
Correct |
10 ms |
8020 KB |
Output is correct |
126 |
Correct |
10 ms |
8020 KB |
Output is correct |
127 |
Correct |
12 ms |
8348 KB |
Output is correct |
128 |
Correct |
10 ms |
8020 KB |
Output is correct |
129 |
Correct |
10 ms |
8092 KB |
Output is correct |
130 |
Correct |
6 ms |
7508 KB |
Output is correct |
131 |
Correct |
179 ms |
7576 KB |
Output is correct |
132 |
Correct |
9 ms |
7620 KB |
Output is correct |
133 |
Correct |
8 ms |
7636 KB |
Output is correct |
134 |
Correct |
8 ms |
7600 KB |
Output is correct |
135 |
Correct |
8 ms |
7568 KB |
Output is correct |
136 |
Correct |
20 ms |
8924 KB |
Output is correct |
137 |
Correct |
20 ms |
8944 KB |
Output is correct |
138 |
Correct |
21 ms |
8916 KB |
Output is correct |
139 |
Correct |
20 ms |
8872 KB |
Output is correct |
140 |
Correct |
21 ms |
8916 KB |
Output is correct |
141 |
Correct |
20 ms |
8916 KB |
Output is correct |
142 |
Correct |
34 ms |
11400 KB |
Output is correct |
143 |
Correct |
10 ms |
8116 KB |
Output is correct |
144 |
Correct |
31 ms |
11308 KB |
Output is correct |
145 |
Correct |
10 ms |
8148 KB |
Output is correct |
146 |
Correct |
32 ms |
11324 KB |
Output is correct |
147 |
Correct |
11 ms |
8148 KB |
Output is correct |
148 |
Correct |
13 ms |
8532 KB |
Output is correct |
149 |
Correct |
13 ms |
8480 KB |
Output is correct |
150 |
Correct |
12 ms |
8404 KB |
Output is correct |
151 |
Correct |
14 ms |
8404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Correct |
4 ms |
7252 KB |
Output is correct |
3 |
Correct |
3 ms |
7252 KB |
Output is correct |
4 |
Correct |
4 ms |
7252 KB |
Output is correct |
5 |
Correct |
3 ms |
7252 KB |
Output is correct |
6 |
Correct |
3 ms |
7252 KB |
Output is correct |
7 |
Correct |
4 ms |
7252 KB |
Output is correct |
8 |
Correct |
4 ms |
7252 KB |
Output is correct |
9 |
Correct |
3 ms |
7252 KB |
Output is correct |
10 |
Correct |
4 ms |
7284 KB |
Output is correct |
11 |
Correct |
5 ms |
7364 KB |
Output is correct |
12 |
Correct |
4 ms |
7252 KB |
Output is correct |
13 |
Correct |
4 ms |
7352 KB |
Output is correct |
14 |
Correct |
3 ms |
7252 KB |
Output is correct |
15 |
Correct |
4 ms |
7380 KB |
Output is correct |
16 |
Correct |
4 ms |
7400 KB |
Output is correct |
17 |
Correct |
4 ms |
7380 KB |
Output is correct |
18 |
Correct |
4 ms |
7380 KB |
Output is correct |
19 |
Correct |
4 ms |
7380 KB |
Output is correct |
20 |
Correct |
5 ms |
7408 KB |
Output is correct |
21 |
Correct |
4 ms |
7380 KB |
Output is correct |
22 |
Correct |
4 ms |
7408 KB |
Output is correct |
23 |
Correct |
5 ms |
7380 KB |
Output is correct |
24 |
Correct |
22 ms |
11200 KB |
Output is correct |
25 |
Correct |
22 ms |
11220 KB |
Output is correct |
26 |
Correct |
22 ms |
11224 KB |
Output is correct |
27 |
Correct |
5 ms |
7508 KB |
Output is correct |
28 |
Correct |
6 ms |
7508 KB |
Output is correct |
29 |
Correct |
5 ms |
7508 KB |
Output is correct |
30 |
Correct |
5 ms |
7508 KB |
Output is correct |
31 |
Correct |
6 ms |
7508 KB |
Output is correct |
32 |
Correct |
5 ms |
7508 KB |
Output is correct |
33 |
Correct |
16 ms |
8332 KB |
Output is correct |
34 |
Correct |
11 ms |
8328 KB |
Output is correct |
35 |
Correct |
11 ms |
8404 KB |
Output is correct |
36 |
Correct |
11 ms |
8396 KB |
Output is correct |
37 |
Correct |
10 ms |
8404 KB |
Output is correct |
38 |
Correct |
10 ms |
8368 KB |
Output is correct |
39 |
Correct |
23 ms |
11608 KB |
Output is correct |
40 |
Correct |
24 ms |
11592 KB |
Output is correct |
41 |
Correct |
24 ms |
11572 KB |
Output is correct |
42 |
Correct |
12 ms |
8044 KB |
Output is correct |
43 |
Correct |
9 ms |
7764 KB |
Output is correct |
44 |
Correct |
11 ms |
8136 KB |
Output is correct |
45 |
Correct |
9 ms |
7880 KB |
Output is correct |
46 |
Correct |
8 ms |
7736 KB |
Output is correct |
47 |
Correct |
11 ms |
8144 KB |
Output is correct |
48 |
Correct |
40 ms |
16392 KB |
Output is correct |
49 |
Correct |
35 ms |
12364 KB |
Output is correct |
50 |
Correct |
29 ms |
14928 KB |
Output is correct |
51 |
Correct |
36 ms |
15184 KB |
Output is correct |
52 |
Correct |
36 ms |
14788 KB |
Output is correct |
53 |
Correct |
29 ms |
12464 KB |
Output is correct |
54 |
Correct |
13 ms |
8148 KB |
Output is correct |
55 |
Correct |
15 ms |
8148 KB |
Output is correct |
56 |
Correct |
11 ms |
8144 KB |
Output is correct |
57 |
Correct |
11 ms |
8148 KB |
Output is correct |
58 |
Correct |
10 ms |
8136 KB |
Output is correct |
59 |
Correct |
12 ms |
8140 KB |
Output is correct |
60 |
Correct |
48 ms |
17120 KB |
Output is correct |
61 |
Correct |
45 ms |
17136 KB |
Output is correct |
62 |
Correct |
57 ms |
17100 KB |
Output is correct |
63 |
Correct |
45 ms |
17132 KB |
Output is correct |
64 |
Correct |
44 ms |
17088 KB |
Output is correct |
65 |
Correct |
44 ms |
17072 KB |
Output is correct |
66 |
Correct |
44 ms |
16504 KB |
Output is correct |
67 |
Correct |
47 ms |
16456 KB |
Output is correct |
68 |
Correct |
44 ms |
16548 KB |
Output is correct |
69 |
Correct |
3 ms |
7252 KB |
Output is correct |
70 |
Correct |
4 ms |
7252 KB |
Output is correct |
71 |
Correct |
3 ms |
7252 KB |
Output is correct |
72 |
Correct |
4 ms |
7252 KB |
Output is correct |
73 |
Correct |
5 ms |
7252 KB |
Output is correct |
74 |
Correct |
4 ms |
7252 KB |
Output is correct |
75 |
Correct |
4 ms |
7380 KB |
Output is correct |
76 |
Correct |
4 ms |
7252 KB |
Output is correct |
77 |
Correct |
5 ms |
7252 KB |
Output is correct |
78 |
Correct |
4 ms |
7380 KB |
Output is correct |
79 |
Correct |
4 ms |
7380 KB |
Output is correct |
80 |
Correct |
4 ms |
7380 KB |
Output is correct |
81 |
Correct |
4 ms |
7380 KB |
Output is correct |
82 |
Correct |
4 ms |
7380 KB |
Output is correct |
83 |
Correct |
4 ms |
7380 KB |
Output is correct |
84 |
Correct |
4 ms |
7252 KB |
Output is correct |
85 |
Correct |
4 ms |
7380 KB |
Output is correct |
86 |
Correct |
4 ms |
7380 KB |
Output is correct |
87 |
Correct |
4 ms |
7380 KB |
Output is correct |
88 |
Correct |
4 ms |
7480 KB |
Output is correct |
89 |
Correct |
4 ms |
7252 KB |
Output is correct |
90 |
Correct |
4 ms |
7252 KB |
Output is correct |
91 |
Correct |
4 ms |
7252 KB |
Output is correct |
92 |
Correct |
4 ms |
7252 KB |
Output is correct |
93 |
Correct |
5 ms |
7344 KB |
Output is correct |
94 |
Correct |
4 ms |
7252 KB |
Output is correct |
95 |
Correct |
6 ms |
7312 KB |
Output is correct |
96 |
Correct |
4 ms |
7380 KB |
Output is correct |
97 |
Correct |
4 ms |
7368 KB |
Output is correct |
98 |
Correct |
4 ms |
7380 KB |
Output is correct |
99 |
Correct |
4 ms |
7380 KB |
Output is correct |
100 |
Correct |
4 ms |
7380 KB |
Output is correct |
101 |
Correct |
4 ms |
7380 KB |
Output is correct |
102 |
Correct |
4 ms |
7380 KB |
Output is correct |
103 |
Correct |
4 ms |
7380 KB |
Output is correct |
104 |
Correct |
4 ms |
7380 KB |
Output is correct |
105 |
Correct |
4 ms |
7380 KB |
Output is correct |
106 |
Correct |
4 ms |
7380 KB |
Output is correct |
107 |
Correct |
4 ms |
7380 KB |
Output is correct |
108 |
Correct |
4 ms |
7252 KB |
Output is correct |
109 |
Correct |
4 ms |
7380 KB |
Output is correct |
110 |
Correct |
4 ms |
7380 KB |
Output is correct |
111 |
Correct |
5 ms |
7380 KB |
Output is correct |
112 |
Correct |
5 ms |
7508 KB |
Output is correct |
113 |
Correct |
5 ms |
7508 KB |
Output is correct |
114 |
Correct |
5 ms |
7508 KB |
Output is correct |
115 |
Correct |
5 ms |
7388 KB |
Output is correct |
116 |
Correct |
6 ms |
7508 KB |
Output is correct |
117 |
Correct |
5 ms |
7508 KB |
Output is correct |
118 |
Correct |
24 ms |
10024 KB |
Output is correct |
119 |
Correct |
20 ms |
10384 KB |
Output is correct |
120 |
Correct |
25 ms |
10808 KB |
Output is correct |
121 |
Correct |
5 ms |
7380 KB |
Output is correct |
122 |
Correct |
5 ms |
7380 KB |
Output is correct |
123 |
Correct |
5 ms |
7380 KB |
Output is correct |
124 |
Correct |
5 ms |
7396 KB |
Output is correct |
125 |
Correct |
5 ms |
7380 KB |
Output is correct |
126 |
Correct |
6 ms |
7508 KB |
Output is correct |
127 |
Correct |
6 ms |
7508 KB |
Output is correct |
128 |
Correct |
6 ms |
7508 KB |
Output is correct |
129 |
Correct |
6 ms |
7508 KB |
Output is correct |
130 |
Correct |
5 ms |
7508 KB |
Output is correct |
131 |
Correct |
6 ms |
7508 KB |
Output is correct |
132 |
Correct |
30 ms |
11084 KB |
Output is correct |
133 |
Correct |
33 ms |
11092 KB |
Output is correct |
134 |
Correct |
30 ms |
10972 KB |
Output is correct |
135 |
Correct |
6 ms |
7508 KB |
Output is correct |
136 |
Correct |
126 ms |
7528 KB |
Output is correct |
137 |
Correct |
7 ms |
7464 KB |
Output is correct |
138 |
Correct |
7 ms |
7636 KB |
Output is correct |
139 |
Correct |
7 ms |
7584 KB |
Output is correct |
140 |
Correct |
6 ms |
7508 KB |
Output is correct |
141 |
Correct |
15 ms |
8532 KB |
Output is correct |
142 |
Correct |
15 ms |
8404 KB |
Output is correct |
143 |
Correct |
18 ms |
8632 KB |
Output is correct |
144 |
Correct |
15 ms |
8532 KB |
Output is correct |
145 |
Correct |
16 ms |
8660 KB |
Output is correct |
146 |
Correct |
14 ms |
8380 KB |
Output is correct |
147 |
Correct |
21 ms |
9812 KB |
Output is correct |
148 |
Correct |
8 ms |
7892 KB |
Output is correct |
149 |
Correct |
23 ms |
9884 KB |
Output is correct |
150 |
Correct |
7 ms |
7764 KB |
Output is correct |
151 |
Correct |
26 ms |
10500 KB |
Output is correct |
152 |
Correct |
10 ms |
8020 KB |
Output is correct |
153 |
Correct |
10 ms |
8020 KB |
Output is correct |
154 |
Correct |
12 ms |
8348 KB |
Output is correct |
155 |
Correct |
10 ms |
8020 KB |
Output is correct |
156 |
Correct |
10 ms |
8092 KB |
Output is correct |
157 |
Correct |
6 ms |
7508 KB |
Output is correct |
158 |
Correct |
179 ms |
7576 KB |
Output is correct |
159 |
Correct |
9 ms |
7620 KB |
Output is correct |
160 |
Correct |
8 ms |
7636 KB |
Output is correct |
161 |
Correct |
8 ms |
7600 KB |
Output is correct |
162 |
Correct |
8 ms |
7568 KB |
Output is correct |
163 |
Correct |
20 ms |
8924 KB |
Output is correct |
164 |
Correct |
20 ms |
8944 KB |
Output is correct |
165 |
Correct |
21 ms |
8916 KB |
Output is correct |
166 |
Correct |
20 ms |
8872 KB |
Output is correct |
167 |
Correct |
21 ms |
8916 KB |
Output is correct |
168 |
Correct |
20 ms |
8916 KB |
Output is correct |
169 |
Correct |
34 ms |
11400 KB |
Output is correct |
170 |
Correct |
10 ms |
8116 KB |
Output is correct |
171 |
Correct |
31 ms |
11308 KB |
Output is correct |
172 |
Correct |
10 ms |
8148 KB |
Output is correct |
173 |
Correct |
32 ms |
11324 KB |
Output is correct |
174 |
Correct |
11 ms |
8148 KB |
Output is correct |
175 |
Correct |
13 ms |
8532 KB |
Output is correct |
176 |
Correct |
13 ms |
8480 KB |
Output is correct |
177 |
Correct |
12 ms |
8404 KB |
Output is correct |
178 |
Correct |
14 ms |
8404 KB |
Output is correct |
179 |
Correct |
10 ms |
7764 KB |
Output is correct |
180 |
Correct |
348 ms |
7824 KB |
Output is correct |
181 |
Correct |
11 ms |
8020 KB |
Output is correct |
182 |
Correct |
13 ms |
8268 KB |
Output is correct |
183 |
Correct |
11 ms |
8028 KB |
Output is correct |
184 |
Correct |
10 ms |
7992 KB |
Output is correct |
185 |
Correct |
30 ms |
10568 KB |
Output is correct |
186 |
Correct |
28 ms |
12248 KB |
Output is correct |
187 |
Correct |
34 ms |
11220 KB |
Output is correct |
188 |
Correct |
31 ms |
10708 KB |
Output is correct |
189 |
Correct |
34 ms |
10656 KB |
Output is correct |
190 |
Correct |
33 ms |
11804 KB |
Output is correct |
191 |
Correct |
34 ms |
11640 KB |
Output is correct |
192 |
Correct |
24 ms |
10204 KB |
Output is correct |
193 |
Correct |
25 ms |
9684 KB |
Output is correct |
194 |
Correct |
14 ms |
8140 KB |
Output is correct |
195 |
Correct |
857 ms |
8228 KB |
Output is correct |
196 |
Correct |
15 ms |
8148 KB |
Output is correct |
197 |
Correct |
15 ms |
8268 KB |
Output is correct |
198 |
Correct |
16 ms |
8276 KB |
Output is correct |
199 |
Correct |
14 ms |
8268 KB |
Output is correct |
200 |
Correct |
65 ms |
17076 KB |
Output is correct |
201 |
Correct |
78 ms |
17096 KB |
Output is correct |
202 |
Correct |
61 ms |
17092 KB |
Output is correct |
203 |
Correct |
66 ms |
17088 KB |
Output is correct |
204 |
Correct |
61 ms |
17140 KB |
Output is correct |
205 |
Correct |
61 ms |
17020 KB |
Output is correct |
206 |
Correct |
53 ms |
16460 KB |
Output is correct |
207 |
Correct |
50 ms |
16164 KB |
Output is correct |
208 |
Correct |
53 ms |
16480 KB |
Output is correct |
209 |
Correct |
47 ms |
16076 KB |
Output is correct |
210 |
Correct |
52 ms |
16476 KB |
Output is correct |
211 |
Correct |
47 ms |
16104 KB |
Output is correct |
212 |
Correct |
56 ms |
17100 KB |
Output is correct |
213 |
Correct |
50 ms |
14168 KB |
Output is correct |
214 |
Correct |
49 ms |
13772 KB |
Output is correct |
215 |
Correct |
52 ms |
13544 KB |
Output is correct |