#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 300000;
ll dp[(1<<23)];
int ima[N+5];
const ll INF = 1000000000000000000LL;
const int K = 200;
const int BLOCK = 400;
struct qvry{
int l, r, ind;
bool operator <(const qvry &b){
if(l/BLOCK == b.l/BLOCK) return r < b.r;
return l/BLOCK < b.l/BLOCK;
}
};
bool ins[N+5];
int cnt[N+5];
int tren[N+5];
ll pref[K+5][N+5];
vector <int> vals;
void Dodaj(int i){
cnt[tren[i]]--;
tren[i]++;
cnt[tren[i]]++;
if(cnt[tren[i]] == 1) vals.push_back(tren[i]);
}
void Brisi(int i){
cnt[tren[i]]--;
tren[i]--;
cnt[tren[i]]++;
if(cnt[tren[i]] == 1) vals.push_back(tren[i]);
}
ll sol[N+5];
int niz[N+5];
int main(){
ios_base::sync_with_stdio(false), cin.tie(0);
cout.precision(10);
cout << fixed;
for(int i=1; i<=K; i++){
for(int j=1; j<=N; j++){
pref[i][j] = 1LL*j*(j+1)/2;
if(j > i) pref[i][j] += pref[i][j-i];
}
}
int n, qrs;
cin >> n >> qrs;
vector <int> vec;
for(int i=1; i<=n; i++){
cin >> niz[i];
}
vector <qvry> queries;
for(int i=1; i<=qrs; i++){
int l, r;
cin >> l >> r;
queries.push_back({l, r, i});
}
sort(queries.begin(), queries.end());
int tl = 1, tr = 1;
Dodaj(niz[1]);
for(auto qry : queries){
int l = qry.l;
int r = qry.r;
int ind = qry.ind;
while(tr < r) tr++, Dodaj(niz[tr]);
while(tl > l) tl--, Dodaj(niz[tl]);
while(tr > r) Brisi(niz[tr]), tr--;
while(tl < l) Brisi(niz[tl]), tl++;
vector <int> nvals;
for(auto c : vals){
if(!cnt[c] || c == 0 || ins[c]) continue;
ins[c] = 1;
nvals.push_back(c);
}
swap(vals, nvals);
nvals.clear();
sort(vals.begin(), vals.end());
int tl = 0, tr = 0, bl = 0, br = 0;
int len = r - l + 1;
ll res = 0;
for(auto x : vals){
int c = cnt[x];
res += 1LL*len*(len+1)*c/2;
if(x > K){
while(c--){
if(br < bl){
res -= 1LL*tr*(tr+1)/2;
res -= 1LL*(len-tr-x)*(len-tr-x+1)/2;
tr += x;
br++;
}
else{
res -= 1LL*tl*(tl+1)/2;
res -= 1LL*(len-tl-x)*(len-tl-x+1)/2;
tl += x;
bl++;
}
}
continue;
}
if(br < bl){
res -= 1LL*tr*(tr+1)/2;
res -= 1LL*(len-tr-x)*(len-tr-x+1)/2;
tr += x;
br++;
c--;
}
int dod = (c+1)/2;
if(dod == 0) continue;
/// tl, tl + x, ..., tl + (dod-1)* x
res -= pref[x][tl + (dod-1)*x];
if(tl > x) res += pref[x][tl-x];
/// len - tl - x, len - tl - 2*x, ..., len - tl - dod*x
res -= pref[x][len - tl - x];
if(len - tl - dod*x > x) res += pref[x][len - tl - dod*x - x];
tl += dod*x;
bl += dod;
dod = c/2;
if(dod == 0) continue;
/// tr, tr + x, ..., tr + (dod-1)*x
res -= pref[x][tr + (dod-1)*x];
if(tr > x) res += pref[x][tr-x];
/// len - tr - x, len - tr - 2*x, ..., len - tr - dod*x
res -= pref[x][len - tr - x];
if(len - tr - dod*x > x) res += pref[x][len - tr - dod*x - x];
tr += dod*x;
br += dod;
}
for(auto c : vals) ins[c] = 0;
sol[ind] = res;
}
for(int i=1; i<=qrs; i++) cout << sol[i] << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
334 ms |
469920 KB |
Output is correct |
2 |
Correct |
275 ms |
469980 KB |
Output is correct |
3 |
Correct |
293 ms |
469896 KB |
Output is correct |
4 |
Correct |
292 ms |
470000 KB |
Output is correct |
5 |
Correct |
275 ms |
469996 KB |
Output is correct |
6 |
Correct |
314 ms |
469920 KB |
Output is correct |
7 |
Correct |
280 ms |
469956 KB |
Output is correct |
8 |
Correct |
292 ms |
470068 KB |
Output is correct |
9 |
Correct |
275 ms |
469956 KB |
Output is correct |
10 |
Correct |
290 ms |
469976 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
269 ms |
469956 KB |
Output is correct |
2 |
Correct |
279 ms |
469952 KB |
Output is correct |
3 |
Correct |
293 ms |
470092 KB |
Output is correct |
4 |
Correct |
282 ms |
471264 KB |
Output is correct |
5 |
Correct |
354 ms |
472436 KB |
Output is correct |
6 |
Correct |
309 ms |
474180 KB |
Output is correct |
7 |
Correct |
306 ms |
474420 KB |
Output is correct |
8 |
Correct |
301 ms |
474152 KB |
Output is correct |
9 |
Correct |
312 ms |
474120 KB |
Output is correct |
10 |
Correct |
325 ms |
474388 KB |
Output is correct |
11 |
Correct |
330 ms |
474176 KB |
Output is correct |
12 |
Correct |
332 ms |
474148 KB |
Output is correct |
13 |
Correct |
318 ms |
474092 KB |
Output is correct |
14 |
Correct |
345 ms |
474232 KB |
Output is correct |
15 |
Correct |
319 ms |
474292 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
269 ms |
469956 KB |
Output is correct |
2 |
Correct |
279 ms |
469952 KB |
Output is correct |
3 |
Correct |
293 ms |
470092 KB |
Output is correct |
4 |
Correct |
282 ms |
471264 KB |
Output is correct |
5 |
Correct |
354 ms |
472436 KB |
Output is correct |
6 |
Correct |
309 ms |
474180 KB |
Output is correct |
7 |
Correct |
306 ms |
474420 KB |
Output is correct |
8 |
Correct |
301 ms |
474152 KB |
Output is correct |
9 |
Correct |
312 ms |
474120 KB |
Output is correct |
10 |
Correct |
325 ms |
474388 KB |
Output is correct |
11 |
Correct |
330 ms |
474176 KB |
Output is correct |
12 |
Correct |
332 ms |
474148 KB |
Output is correct |
13 |
Correct |
318 ms |
474092 KB |
Output is correct |
14 |
Correct |
345 ms |
474232 KB |
Output is correct |
15 |
Correct |
319 ms |
474292 KB |
Output is correct |
16 |
Correct |
280 ms |
470000 KB |
Output is correct |
17 |
Correct |
286 ms |
469932 KB |
Output is correct |
18 |
Correct |
298 ms |
470144 KB |
Output is correct |
19 |
Correct |
285 ms |
471268 KB |
Output is correct |
20 |
Correct |
294 ms |
472540 KB |
Output is correct |
21 |
Correct |
335 ms |
474384 KB |
Output is correct |
22 |
Correct |
340 ms |
474264 KB |
Output is correct |
23 |
Correct |
317 ms |
474248 KB |
Output is correct |
24 |
Correct |
293 ms |
474272 KB |
Output is correct |
25 |
Correct |
303 ms |
474304 KB |
Output is correct |
26 |
Correct |
448 ms |
474244 KB |
Output is correct |
27 |
Correct |
322 ms |
474248 KB |
Output is correct |
28 |
Correct |
337 ms |
474288 KB |
Output is correct |
29 |
Correct |
370 ms |
474216 KB |
Output is correct |
30 |
Correct |
307 ms |
474280 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
269 ms |
469956 KB |
Output is correct |
2 |
Correct |
279 ms |
469952 KB |
Output is correct |
3 |
Correct |
293 ms |
470092 KB |
Output is correct |
4 |
Correct |
282 ms |
471264 KB |
Output is correct |
5 |
Correct |
354 ms |
472436 KB |
Output is correct |
6 |
Correct |
309 ms |
474180 KB |
Output is correct |
7 |
Correct |
306 ms |
474420 KB |
Output is correct |
8 |
Correct |
301 ms |
474152 KB |
Output is correct |
9 |
Correct |
312 ms |
474120 KB |
Output is correct |
10 |
Correct |
325 ms |
474388 KB |
Output is correct |
11 |
Correct |
330 ms |
474176 KB |
Output is correct |
12 |
Correct |
332 ms |
474148 KB |
Output is correct |
13 |
Correct |
318 ms |
474092 KB |
Output is correct |
14 |
Correct |
345 ms |
474232 KB |
Output is correct |
15 |
Correct |
319 ms |
474292 KB |
Output is correct |
16 |
Correct |
280 ms |
470000 KB |
Output is correct |
17 |
Correct |
286 ms |
469932 KB |
Output is correct |
18 |
Correct |
298 ms |
470144 KB |
Output is correct |
19 |
Correct |
285 ms |
471268 KB |
Output is correct |
20 |
Correct |
294 ms |
472540 KB |
Output is correct |
21 |
Correct |
335 ms |
474384 KB |
Output is correct |
22 |
Correct |
340 ms |
474264 KB |
Output is correct |
23 |
Correct |
317 ms |
474248 KB |
Output is correct |
24 |
Correct |
293 ms |
474272 KB |
Output is correct |
25 |
Correct |
303 ms |
474304 KB |
Output is correct |
26 |
Correct |
448 ms |
474244 KB |
Output is correct |
27 |
Correct |
322 ms |
474248 KB |
Output is correct |
28 |
Correct |
337 ms |
474288 KB |
Output is correct |
29 |
Correct |
370 ms |
474216 KB |
Output is correct |
30 |
Correct |
307 ms |
474280 KB |
Output is correct |
31 |
Correct |
299 ms |
469988 KB |
Output is correct |
32 |
Correct |
287 ms |
469992 KB |
Output is correct |
33 |
Correct |
274 ms |
469956 KB |
Output is correct |
34 |
Correct |
284 ms |
470172 KB |
Output is correct |
35 |
Correct |
274 ms |
470004 KB |
Output is correct |
36 |
Correct |
276 ms |
470064 KB |
Output is correct |
37 |
Correct |
274 ms |
470440 KB |
Output is correct |
38 |
Correct |
274 ms |
470340 KB |
Output is correct |
39 |
Correct |
359 ms |
470944 KB |
Output is correct |
40 |
Correct |
295 ms |
471880 KB |
Output is correct |
41 |
Correct |
369 ms |
473004 KB |
Output is correct |
42 |
Correct |
359 ms |
472904 KB |
Output is correct |
43 |
Correct |
334 ms |
472868 KB |
Output is correct |
44 |
Correct |
304 ms |
472904 KB |
Output is correct |
45 |
Correct |
298 ms |
472868 KB |
Output is correct |
46 |
Correct |
318 ms |
472992 KB |
Output is correct |
47 |
Correct |
326 ms |
472956 KB |
Output is correct |
48 |
Correct |
313 ms |
473032 KB |
Output is correct |
49 |
Correct |
326 ms |
472908 KB |
Output is correct |
50 |
Correct |
327 ms |
472916 KB |
Output is correct |
51 |
Correct |
326 ms |
472944 KB |
Output is correct |
52 |
Correct |
303 ms |
472912 KB |
Output is correct |
53 |
Correct |
308 ms |
472880 KB |
Output is correct |
54 |
Correct |
317 ms |
472888 KB |
Output is correct |
55 |
Correct |
315 ms |
472944 KB |
Output is correct |
56 |
Correct |
309 ms |
472964 KB |
Output is correct |
57 |
Correct |
317 ms |
472932 KB |
Output is correct |
58 |
Correct |
316 ms |
472884 KB |
Output is correct |
59 |
Correct |
310 ms |
472928 KB |
Output is correct |
60 |
Correct |
303 ms |
472912 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
334 ms |
469920 KB |
Output is correct |
2 |
Correct |
275 ms |
469980 KB |
Output is correct |
3 |
Correct |
293 ms |
469896 KB |
Output is correct |
4 |
Correct |
292 ms |
470000 KB |
Output is correct |
5 |
Correct |
275 ms |
469996 KB |
Output is correct |
6 |
Correct |
314 ms |
469920 KB |
Output is correct |
7 |
Correct |
280 ms |
469956 KB |
Output is correct |
8 |
Correct |
292 ms |
470068 KB |
Output is correct |
9 |
Correct |
275 ms |
469956 KB |
Output is correct |
10 |
Correct |
290 ms |
469976 KB |
Output is correct |
11 |
Correct |
269 ms |
469956 KB |
Output is correct |
12 |
Correct |
279 ms |
469952 KB |
Output is correct |
13 |
Correct |
293 ms |
470092 KB |
Output is correct |
14 |
Correct |
282 ms |
471264 KB |
Output is correct |
15 |
Correct |
354 ms |
472436 KB |
Output is correct |
16 |
Correct |
309 ms |
474180 KB |
Output is correct |
17 |
Correct |
306 ms |
474420 KB |
Output is correct |
18 |
Correct |
301 ms |
474152 KB |
Output is correct |
19 |
Correct |
312 ms |
474120 KB |
Output is correct |
20 |
Correct |
325 ms |
474388 KB |
Output is correct |
21 |
Correct |
330 ms |
474176 KB |
Output is correct |
22 |
Correct |
332 ms |
474148 KB |
Output is correct |
23 |
Correct |
318 ms |
474092 KB |
Output is correct |
24 |
Correct |
345 ms |
474232 KB |
Output is correct |
25 |
Correct |
319 ms |
474292 KB |
Output is correct |
26 |
Correct |
280 ms |
470000 KB |
Output is correct |
27 |
Correct |
286 ms |
469932 KB |
Output is correct |
28 |
Correct |
298 ms |
470144 KB |
Output is correct |
29 |
Correct |
285 ms |
471268 KB |
Output is correct |
30 |
Correct |
294 ms |
472540 KB |
Output is correct |
31 |
Correct |
335 ms |
474384 KB |
Output is correct |
32 |
Correct |
340 ms |
474264 KB |
Output is correct |
33 |
Correct |
317 ms |
474248 KB |
Output is correct |
34 |
Correct |
293 ms |
474272 KB |
Output is correct |
35 |
Correct |
303 ms |
474304 KB |
Output is correct |
36 |
Correct |
448 ms |
474244 KB |
Output is correct |
37 |
Correct |
322 ms |
474248 KB |
Output is correct |
38 |
Correct |
337 ms |
474288 KB |
Output is correct |
39 |
Correct |
370 ms |
474216 KB |
Output is correct |
40 |
Correct |
307 ms |
474280 KB |
Output is correct |
41 |
Correct |
299 ms |
469988 KB |
Output is correct |
42 |
Correct |
287 ms |
469992 KB |
Output is correct |
43 |
Correct |
274 ms |
469956 KB |
Output is correct |
44 |
Correct |
284 ms |
470172 KB |
Output is correct |
45 |
Correct |
274 ms |
470004 KB |
Output is correct |
46 |
Correct |
276 ms |
470064 KB |
Output is correct |
47 |
Correct |
274 ms |
470440 KB |
Output is correct |
48 |
Correct |
274 ms |
470340 KB |
Output is correct |
49 |
Correct |
359 ms |
470944 KB |
Output is correct |
50 |
Correct |
295 ms |
471880 KB |
Output is correct |
51 |
Correct |
369 ms |
473004 KB |
Output is correct |
52 |
Correct |
359 ms |
472904 KB |
Output is correct |
53 |
Correct |
334 ms |
472868 KB |
Output is correct |
54 |
Correct |
304 ms |
472904 KB |
Output is correct |
55 |
Correct |
298 ms |
472868 KB |
Output is correct |
56 |
Correct |
318 ms |
472992 KB |
Output is correct |
57 |
Correct |
326 ms |
472956 KB |
Output is correct |
58 |
Correct |
313 ms |
473032 KB |
Output is correct |
59 |
Correct |
326 ms |
472908 KB |
Output is correct |
60 |
Correct |
327 ms |
472916 KB |
Output is correct |
61 |
Correct |
326 ms |
472944 KB |
Output is correct |
62 |
Correct |
303 ms |
472912 KB |
Output is correct |
63 |
Correct |
308 ms |
472880 KB |
Output is correct |
64 |
Correct |
317 ms |
472888 KB |
Output is correct |
65 |
Correct |
315 ms |
472944 KB |
Output is correct |
66 |
Correct |
309 ms |
472964 KB |
Output is correct |
67 |
Correct |
317 ms |
472932 KB |
Output is correct |
68 |
Correct |
316 ms |
472884 KB |
Output is correct |
69 |
Correct |
310 ms |
472928 KB |
Output is correct |
70 |
Correct |
303 ms |
472912 KB |
Output is correct |
71 |
Correct |
280 ms |
470396 KB |
Output is correct |
72 |
Correct |
284 ms |
470416 KB |
Output is correct |
73 |
Correct |
307 ms |
470400 KB |
Output is correct |
74 |
Correct |
272 ms |
470528 KB |
Output is correct |
75 |
Correct |
278 ms |
470476 KB |
Output is correct |
76 |
Correct |
283 ms |
470908 KB |
Output is correct |
77 |
Correct |
277 ms |
470916 KB |
Output is correct |
78 |
Correct |
279 ms |
470888 KB |
Output is correct |
79 |
Correct |
284 ms |
470852 KB |
Output is correct |
80 |
Correct |
277 ms |
470836 KB |
Output is correct |
81 |
Correct |
322 ms |
471748 KB |
Output is correct |
82 |
Correct |
296 ms |
471708 KB |
Output is correct |
83 |
Correct |
296 ms |
471792 KB |
Output is correct |
84 |
Correct |
284 ms |
471752 KB |
Output is correct |
85 |
Correct |
296 ms |
471804 KB |
Output is correct |
86 |
Correct |
289 ms |
471824 KB |
Output is correct |
87 |
Correct |
297 ms |
472000 KB |
Output is correct |
88 |
Correct |
291 ms |
471916 KB |
Output is correct |
89 |
Correct |
324 ms |
471872 KB |
Output is correct |
90 |
Correct |
292 ms |
471824 KB |
Output is correct |
91 |
Correct |
341 ms |
473268 KB |
Output is correct |
92 |
Correct |
307 ms |
473224 KB |
Output is correct |
93 |
Correct |
307 ms |
473192 KB |
Output is correct |
94 |
Correct |
317 ms |
473260 KB |
Output is correct |
95 |
Correct |
302 ms |
473280 KB |
Output is correct |
96 |
Correct |
316 ms |
474052 KB |
Output is correct |
97 |
Correct |
310 ms |
473908 KB |
Output is correct |
98 |
Correct |
310 ms |
473816 KB |
Output is correct |
99 |
Correct |
309 ms |
473924 KB |
Output is correct |
100 |
Correct |
308 ms |
473848 KB |
Output is correct |
101 |
Correct |
329 ms |
473800 KB |
Output is correct |
102 |
Correct |
328 ms |
473876 KB |
Output is correct |
103 |
Correct |
323 ms |
473764 KB |
Output is correct |
104 |
Correct |
318 ms |
473756 KB |
Output is correct |
105 |
Correct |
308 ms |
473796 KB |
Output is correct |
106 |
Correct |
327 ms |
474264 KB |
Output is correct |
107 |
Correct |
314 ms |
474028 KB |
Output is correct |
108 |
Correct |
329 ms |
474172 KB |
Output is correct |
109 |
Correct |
311 ms |
474180 KB |
Output is correct |
110 |
Correct |
313 ms |
474028 KB |
Output is correct |
111 |
Correct |
317 ms |
474108 KB |
Output is correct |
112 |
Correct |
309 ms |
474052 KB |
Output is correct |
113 |
Correct |
312 ms |
473980 KB |
Output is correct |
114 |
Correct |
312 ms |
474016 KB |
Output is correct |
115 |
Correct |
312 ms |
474020 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
334 ms |
469920 KB |
Output is correct |
2 |
Correct |
275 ms |
469980 KB |
Output is correct |
3 |
Correct |
293 ms |
469896 KB |
Output is correct |
4 |
Correct |
292 ms |
470000 KB |
Output is correct |
5 |
Correct |
275 ms |
469996 KB |
Output is correct |
6 |
Correct |
314 ms |
469920 KB |
Output is correct |
7 |
Correct |
280 ms |
469956 KB |
Output is correct |
8 |
Correct |
292 ms |
470068 KB |
Output is correct |
9 |
Correct |
275 ms |
469956 KB |
Output is correct |
10 |
Correct |
290 ms |
469976 KB |
Output is correct |
11 |
Correct |
269 ms |
469956 KB |
Output is correct |
12 |
Correct |
279 ms |
469952 KB |
Output is correct |
13 |
Correct |
293 ms |
470092 KB |
Output is correct |
14 |
Correct |
282 ms |
471264 KB |
Output is correct |
15 |
Correct |
354 ms |
472436 KB |
Output is correct |
16 |
Correct |
309 ms |
474180 KB |
Output is correct |
17 |
Correct |
306 ms |
474420 KB |
Output is correct |
18 |
Correct |
301 ms |
474152 KB |
Output is correct |
19 |
Correct |
312 ms |
474120 KB |
Output is correct |
20 |
Correct |
325 ms |
474388 KB |
Output is correct |
21 |
Correct |
330 ms |
474176 KB |
Output is correct |
22 |
Correct |
332 ms |
474148 KB |
Output is correct |
23 |
Correct |
318 ms |
474092 KB |
Output is correct |
24 |
Correct |
345 ms |
474232 KB |
Output is correct |
25 |
Correct |
319 ms |
474292 KB |
Output is correct |
26 |
Correct |
280 ms |
470000 KB |
Output is correct |
27 |
Correct |
286 ms |
469932 KB |
Output is correct |
28 |
Correct |
298 ms |
470144 KB |
Output is correct |
29 |
Correct |
285 ms |
471268 KB |
Output is correct |
30 |
Correct |
294 ms |
472540 KB |
Output is correct |
31 |
Correct |
335 ms |
474384 KB |
Output is correct |
32 |
Correct |
340 ms |
474264 KB |
Output is correct |
33 |
Correct |
317 ms |
474248 KB |
Output is correct |
34 |
Correct |
293 ms |
474272 KB |
Output is correct |
35 |
Correct |
303 ms |
474304 KB |
Output is correct |
36 |
Correct |
448 ms |
474244 KB |
Output is correct |
37 |
Correct |
322 ms |
474248 KB |
Output is correct |
38 |
Correct |
337 ms |
474288 KB |
Output is correct |
39 |
Correct |
370 ms |
474216 KB |
Output is correct |
40 |
Correct |
307 ms |
474280 KB |
Output is correct |
41 |
Correct |
299 ms |
469988 KB |
Output is correct |
42 |
Correct |
287 ms |
469992 KB |
Output is correct |
43 |
Correct |
274 ms |
469956 KB |
Output is correct |
44 |
Correct |
284 ms |
470172 KB |
Output is correct |
45 |
Correct |
274 ms |
470004 KB |
Output is correct |
46 |
Correct |
276 ms |
470064 KB |
Output is correct |
47 |
Correct |
274 ms |
470440 KB |
Output is correct |
48 |
Correct |
274 ms |
470340 KB |
Output is correct |
49 |
Correct |
359 ms |
470944 KB |
Output is correct |
50 |
Correct |
295 ms |
471880 KB |
Output is correct |
51 |
Correct |
369 ms |
473004 KB |
Output is correct |
52 |
Correct |
359 ms |
472904 KB |
Output is correct |
53 |
Correct |
334 ms |
472868 KB |
Output is correct |
54 |
Correct |
304 ms |
472904 KB |
Output is correct |
55 |
Correct |
298 ms |
472868 KB |
Output is correct |
56 |
Correct |
318 ms |
472992 KB |
Output is correct |
57 |
Correct |
326 ms |
472956 KB |
Output is correct |
58 |
Correct |
313 ms |
473032 KB |
Output is correct |
59 |
Correct |
326 ms |
472908 KB |
Output is correct |
60 |
Correct |
327 ms |
472916 KB |
Output is correct |
61 |
Correct |
326 ms |
472944 KB |
Output is correct |
62 |
Correct |
303 ms |
472912 KB |
Output is correct |
63 |
Correct |
308 ms |
472880 KB |
Output is correct |
64 |
Correct |
317 ms |
472888 KB |
Output is correct |
65 |
Correct |
315 ms |
472944 KB |
Output is correct |
66 |
Correct |
309 ms |
472964 KB |
Output is correct |
67 |
Correct |
317 ms |
472932 KB |
Output is correct |
68 |
Correct |
316 ms |
472884 KB |
Output is correct |
69 |
Correct |
310 ms |
472928 KB |
Output is correct |
70 |
Correct |
303 ms |
472912 KB |
Output is correct |
71 |
Correct |
280 ms |
470396 KB |
Output is correct |
72 |
Correct |
284 ms |
470416 KB |
Output is correct |
73 |
Correct |
307 ms |
470400 KB |
Output is correct |
74 |
Correct |
272 ms |
470528 KB |
Output is correct |
75 |
Correct |
278 ms |
470476 KB |
Output is correct |
76 |
Correct |
283 ms |
470908 KB |
Output is correct |
77 |
Correct |
277 ms |
470916 KB |
Output is correct |
78 |
Correct |
279 ms |
470888 KB |
Output is correct |
79 |
Correct |
284 ms |
470852 KB |
Output is correct |
80 |
Correct |
277 ms |
470836 KB |
Output is correct |
81 |
Correct |
322 ms |
471748 KB |
Output is correct |
82 |
Correct |
296 ms |
471708 KB |
Output is correct |
83 |
Correct |
296 ms |
471792 KB |
Output is correct |
84 |
Correct |
284 ms |
471752 KB |
Output is correct |
85 |
Correct |
296 ms |
471804 KB |
Output is correct |
86 |
Correct |
289 ms |
471824 KB |
Output is correct |
87 |
Correct |
297 ms |
472000 KB |
Output is correct |
88 |
Correct |
291 ms |
471916 KB |
Output is correct |
89 |
Correct |
324 ms |
471872 KB |
Output is correct |
90 |
Correct |
292 ms |
471824 KB |
Output is correct |
91 |
Correct |
341 ms |
473268 KB |
Output is correct |
92 |
Correct |
307 ms |
473224 KB |
Output is correct |
93 |
Correct |
307 ms |
473192 KB |
Output is correct |
94 |
Correct |
317 ms |
473260 KB |
Output is correct |
95 |
Correct |
302 ms |
473280 KB |
Output is correct |
96 |
Correct |
316 ms |
474052 KB |
Output is correct |
97 |
Correct |
310 ms |
473908 KB |
Output is correct |
98 |
Correct |
310 ms |
473816 KB |
Output is correct |
99 |
Correct |
309 ms |
473924 KB |
Output is correct |
100 |
Correct |
308 ms |
473848 KB |
Output is correct |
101 |
Correct |
329 ms |
473800 KB |
Output is correct |
102 |
Correct |
328 ms |
473876 KB |
Output is correct |
103 |
Correct |
323 ms |
473764 KB |
Output is correct |
104 |
Correct |
318 ms |
473756 KB |
Output is correct |
105 |
Correct |
308 ms |
473796 KB |
Output is correct |
106 |
Correct |
327 ms |
474264 KB |
Output is correct |
107 |
Correct |
314 ms |
474028 KB |
Output is correct |
108 |
Correct |
329 ms |
474172 KB |
Output is correct |
109 |
Correct |
311 ms |
474180 KB |
Output is correct |
110 |
Correct |
313 ms |
474028 KB |
Output is correct |
111 |
Correct |
317 ms |
474108 KB |
Output is correct |
112 |
Correct |
309 ms |
474052 KB |
Output is correct |
113 |
Correct |
312 ms |
473980 KB |
Output is correct |
114 |
Correct |
312 ms |
474016 KB |
Output is correct |
115 |
Correct |
312 ms |
474020 KB |
Output is correct |
116 |
Correct |
536 ms |
472120 KB |
Output is correct |
117 |
Correct |
548 ms |
472144 KB |
Output is correct |
118 |
Correct |
839 ms |
472760 KB |
Output is correct |
119 |
Correct |
962 ms |
472628 KB |
Output is correct |
120 |
Correct |
807 ms |
472600 KB |
Output is correct |
121 |
Correct |
1319 ms |
473080 KB |
Output is correct |
122 |
Correct |
1108 ms |
473064 KB |
Output is correct |
123 |
Correct |
2586 ms |
474308 KB |
Output is correct |
124 |
Correct |
1727 ms |
474132 KB |
Output is correct |
125 |
Correct |
1593 ms |
474188 KB |
Output is correct |
126 |
Correct |
4520 ms |
475980 KB |
Output is correct |
127 |
Correct |
4505 ms |
475996 KB |
Output is correct |
128 |
Correct |
4425 ms |
475864 KB |
Output is correct |
129 |
Correct |
4440 ms |
475928 KB |
Output is correct |
130 |
Correct |
4447 ms |
476032 KB |
Output is correct |
131 |
Correct |
4751 ms |
475888 KB |
Output is correct |
132 |
Correct |
4767 ms |
475880 KB |
Output is correct |
133 |
Correct |
4882 ms |
475992 KB |
Output is correct |
134 |
Correct |
4977 ms |
475708 KB |
Output is correct |
135 |
Correct |
4842 ms |
475704 KB |
Output is correct |
136 |
Correct |
4833 ms |
475772 KB |
Output is correct |
137 |
Correct |
4937 ms |
475724 KB |
Output is correct |
138 |
Correct |
4834 ms |
475752 KB |
Output is correct |
139 |
Correct |
4840 ms |
475792 KB |
Output is correct |
140 |
Correct |
4869 ms |
475860 KB |
Output is correct |
141 |
Correct |
4396 ms |
475320 KB |
Output is correct |
142 |
Correct |
4416 ms |
475132 KB |
Output is correct |
143 |
Correct |
4343 ms |
475192 KB |
Output is correct |
144 |
Correct |
4322 ms |
475132 KB |
Output is correct |
145 |
Correct |
4463 ms |
475140 KB |
Output is correct |
146 |
Correct |
2933 ms |
475260 KB |
Output is correct |
147 |
Correct |
2990 ms |
475076 KB |
Output is correct |
148 |
Correct |
2961 ms |
475104 KB |
Output is correct |
149 |
Correct |
3065 ms |
475012 KB |
Output is correct |
150 |
Correct |
3013 ms |
475008 KB |
Output is correct |
151 |
Correct |
2872 ms |
475072 KB |
Output is correct |
152 |
Correct |
2821 ms |
475060 KB |
Output is correct |
153 |
Correct |
2894 ms |
475136 KB |
Output is correct |
154 |
Correct |
2872 ms |
475072 KB |
Output is correct |
155 |
Correct |
2879 ms |
475108 KB |
Output is correct |
156 |
Correct |
4335 ms |
476044 KB |
Output is correct |
157 |
Correct |
4329 ms |
476244 KB |
Output is correct |
158 |
Correct |
4360 ms |
476012 KB |
Output is correct |
159 |
Correct |
4336 ms |
475980 KB |
Output is correct |
160 |
Correct |
4380 ms |
475972 KB |
Output is correct |
161 |
Correct |
3807 ms |
476384 KB |
Output is correct |
162 |
Correct |
3772 ms |
476112 KB |
Output is correct |
163 |
Correct |
3736 ms |
476164 KB |
Output is correct |
164 |
Correct |
3752 ms |
476316 KB |
Output is correct |
165 |
Correct |
3810 ms |
476140 KB |
Output is correct |
166 |
Correct |
4869 ms |
476280 KB |
Output is correct |
167 |
Correct |
4853 ms |
476176 KB |
Output is correct |
168 |
Correct |
4815 ms |
476184 KB |
Output is correct |
169 |
Correct |
4891 ms |
476320 KB |
Output is correct |
170 |
Correct |
4859 ms |
476436 KB |
Output is correct |
171 |
Correct |
4637 ms |
476616 KB |
Output is correct |
172 |
Correct |
4692 ms |
476504 KB |
Output is correct |
173 |
Correct |
4661 ms |
476512 KB |
Output is correct |
174 |
Correct |
4659 ms |
476596 KB |
Output is correct |
175 |
Correct |
4720 ms |
476548 KB |
Output is correct |