#include <bits/stdc++.h>
#define gibon ios::sync_with_stdio(false); cin.tie(0);
#define fir first
#define sec second
#define pdd pair<double, double>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pmax pair<__int128, __int128>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
using namespace std;
int dx[4]={0, 1, 0, -1}, dy[4]={1, 0, -1 , 0};
const int mxN=300003;
const int mxM=1010;
const int mxK=105;
const int MOD=1000000007;
const ll INF=1e18;
const ll P1=1000000007;
const ll P2=1000000009;
typedef struct query{
int s, e, idx;
ll ans;
}query;
int N, M, K, Q, L;
int A[mxN];
query T[mxN];
int ncnt[mxN]; ///number
int tcnt[mxN]; ///type
int typ_cnt;
int ns=1, ne;
multiset <int> s;
ll ans;
ll lval, rval;
int nsum;
bool cmp1(query a, query b)
{
if(a.s/M!=b.s/M) return a.s<b.s;
return a.e<b.e;
}
void set_remove(int now)
{
if(now<=K) tcnt[now]--;
else s.erase(s.lower_bound(now));
}
void set_insert(int now)
{
if(now<=K) tcnt[now]++;
else s.insert(now);
}
void mo(int pos, int typ)
{
int pre=ncnt[A[pos]], now=ncnt[A[pos]]+typ;
ncnt[A[pos]]+=typ;
if(pre==0) typ_cnt++;
if(now==0) typ_cnt--;
set_remove(pre);
set_insert(now);
}
ll sum(ll a, ll d, ll n)
{
return (a*(a+1)*n+(2*a+1)*d*n*(n-1)/2+d*d*(n-1)*n*(2*n-1)/6)/2;
}
void typ_insert(int now, int num)
{
if(num==0) return;
nsum+=num;
if(nsum==typ_cnt) num--;
if(num==0) return;
if(lval>rval) swap(lval, rval);
int lcnt=0, rcnt=0;
lcnt+=min((ll)num, (rval-lval)/now);
num-=lcnt;
if(num%2==0) lcnt+=num/2, rcnt+=num/2;
else lcnt+=num/2+1, rcnt+=num/2;
ans-=sum(lval+now, now, lcnt);
ans-=sum(L-lval-lcnt*now, now, lcnt);
lval+=lcnt*now;
ans-=sum(rval+now, now, rcnt);
ans-=sum(L-rval-rcnt*now, now, rcnt);
rval+=rcnt*now;
}
void print()
{
for(int i=1;i<=M;i++) printf("cnt[%d]=%d\n", i, tcnt[i]);
for(auto iter=s.begin();iter!=s.end();iter++) printf("%d ", *iter);
printf("\n");
}
int main()
{
gibon
cin >> N >> Q;
M=sqrt(Q);
K=min(N, (int)(2*sqrt(N)*log2(N)));
for(int i=1;i<=N;i++) cin >> A[i];
for(int i=0;i<Q;i++)
{
cin >> T[i].s >> T[i].e;
T[i].idx=i;
}
sort(T, T+Q, cmp1);
for(int i=0;i<Q;i++)
{
while(ne<T[i].e)
{
ne++;
mo(ne, 1);
}
while(ns>T[i].s)
{
ns--;
mo(ns, 1);
}
while(ne>T[i].e)
{
mo(ne, -1);
ne--;
}
while(ns<T[i].s)
{
mo(ns, -1);
ns++;
}
L=T[i].e-T[i].s+1;
nsum=0;
ans=(ll)L*(L+1)/2*typ_cnt;
lval=0, rval=0;
for(int i=1;i<=K;i++)
{
typ_insert(i, tcnt[i]);
}
for(auto iter=s.begin();iter!=s.end();iter++)
{
typ_insert(*iter, 1);
}
T[i].ans=ans;
}
sort(T, T+Q, [](query a, query b){return a.idx<b.idx;});
for(int i=0;i<Q;i++) cout << T[i].ans << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
312 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
10 ms |
848 KB |
Output is correct |
5 |
Correct |
17 ms |
1220 KB |
Output is correct |
6 |
Correct |
32 ms |
1692 KB |
Output is correct |
7 |
Correct |
25 ms |
1616 KB |
Output is correct |
8 |
Correct |
27 ms |
1696 KB |
Output is correct |
9 |
Correct |
36 ms |
1692 KB |
Output is correct |
10 |
Correct |
28 ms |
1676 KB |
Output is correct |
11 |
Correct |
26 ms |
1704 KB |
Output is correct |
12 |
Correct |
35 ms |
1612 KB |
Output is correct |
13 |
Correct |
39 ms |
1688 KB |
Output is correct |
14 |
Correct |
31 ms |
1740 KB |
Output is correct |
15 |
Correct |
34 ms |
1600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
10 ms |
848 KB |
Output is correct |
5 |
Correct |
17 ms |
1220 KB |
Output is correct |
6 |
Correct |
32 ms |
1692 KB |
Output is correct |
7 |
Correct |
25 ms |
1616 KB |
Output is correct |
8 |
Correct |
27 ms |
1696 KB |
Output is correct |
9 |
Correct |
36 ms |
1692 KB |
Output is correct |
10 |
Correct |
28 ms |
1676 KB |
Output is correct |
11 |
Correct |
26 ms |
1704 KB |
Output is correct |
12 |
Correct |
35 ms |
1612 KB |
Output is correct |
13 |
Correct |
39 ms |
1688 KB |
Output is correct |
14 |
Correct |
31 ms |
1740 KB |
Output is correct |
15 |
Correct |
34 ms |
1600 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
8 ms |
844 KB |
Output is correct |
20 |
Correct |
16 ms |
1196 KB |
Output is correct |
21 |
Correct |
23 ms |
1612 KB |
Output is correct |
22 |
Correct |
26 ms |
1704 KB |
Output is correct |
23 |
Correct |
25 ms |
1700 KB |
Output is correct |
24 |
Correct |
25 ms |
1604 KB |
Output is correct |
25 |
Correct |
26 ms |
1692 KB |
Output is correct |
26 |
Correct |
28 ms |
1712 KB |
Output is correct |
27 |
Correct |
27 ms |
1680 KB |
Output is correct |
28 |
Correct |
25 ms |
1696 KB |
Output is correct |
29 |
Correct |
25 ms |
1608 KB |
Output is correct |
30 |
Correct |
26 ms |
1688 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
10 ms |
848 KB |
Output is correct |
5 |
Correct |
17 ms |
1220 KB |
Output is correct |
6 |
Correct |
32 ms |
1692 KB |
Output is correct |
7 |
Correct |
25 ms |
1616 KB |
Output is correct |
8 |
Correct |
27 ms |
1696 KB |
Output is correct |
9 |
Correct |
36 ms |
1692 KB |
Output is correct |
10 |
Correct |
28 ms |
1676 KB |
Output is correct |
11 |
Correct |
26 ms |
1704 KB |
Output is correct |
12 |
Correct |
35 ms |
1612 KB |
Output is correct |
13 |
Correct |
39 ms |
1688 KB |
Output is correct |
14 |
Correct |
31 ms |
1740 KB |
Output is correct |
15 |
Correct |
34 ms |
1600 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
8 ms |
844 KB |
Output is correct |
20 |
Correct |
16 ms |
1196 KB |
Output is correct |
21 |
Correct |
23 ms |
1612 KB |
Output is correct |
22 |
Correct |
26 ms |
1704 KB |
Output is correct |
23 |
Correct |
25 ms |
1700 KB |
Output is correct |
24 |
Correct |
25 ms |
1604 KB |
Output is correct |
25 |
Correct |
26 ms |
1692 KB |
Output is correct |
26 |
Correct |
28 ms |
1712 KB |
Output is correct |
27 |
Correct |
27 ms |
1680 KB |
Output is correct |
28 |
Correct |
25 ms |
1696 KB |
Output is correct |
29 |
Correct |
25 ms |
1608 KB |
Output is correct |
30 |
Correct |
26 ms |
1688 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
2 ms |
332 KB |
Output is correct |
36 |
Correct |
2 ms |
328 KB |
Output is correct |
37 |
Correct |
6 ms |
588 KB |
Output is correct |
38 |
Correct |
5 ms |
628 KB |
Output is correct |
39 |
Correct |
8 ms |
740 KB |
Output is correct |
40 |
Correct |
15 ms |
1228 KB |
Output is correct |
41 |
Correct |
40 ms |
1604 KB |
Output is correct |
42 |
Correct |
25 ms |
1612 KB |
Output is correct |
43 |
Correct |
22 ms |
1628 KB |
Output is correct |
44 |
Correct |
23 ms |
1536 KB |
Output is correct |
45 |
Correct |
23 ms |
1584 KB |
Output is correct |
46 |
Correct |
24 ms |
1604 KB |
Output is correct |
47 |
Correct |
23 ms |
1536 KB |
Output is correct |
48 |
Correct |
22 ms |
1580 KB |
Output is correct |
49 |
Correct |
21 ms |
1552 KB |
Output is correct |
50 |
Correct |
21 ms |
1568 KB |
Output is correct |
51 |
Correct |
21 ms |
1532 KB |
Output is correct |
52 |
Correct |
28 ms |
1564 KB |
Output is correct |
53 |
Correct |
22 ms |
1592 KB |
Output is correct |
54 |
Correct |
23 ms |
1588 KB |
Output is correct |
55 |
Correct |
20 ms |
1608 KB |
Output is correct |
56 |
Correct |
23 ms |
1628 KB |
Output is correct |
57 |
Correct |
23 ms |
1612 KB |
Output is correct |
58 |
Correct |
22 ms |
1544 KB |
Output is correct |
59 |
Correct |
28 ms |
1584 KB |
Output is correct |
60 |
Correct |
28 ms |
1624 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
312 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
10 ms |
848 KB |
Output is correct |
15 |
Correct |
17 ms |
1220 KB |
Output is correct |
16 |
Correct |
32 ms |
1692 KB |
Output is correct |
17 |
Correct |
25 ms |
1616 KB |
Output is correct |
18 |
Correct |
27 ms |
1696 KB |
Output is correct |
19 |
Correct |
36 ms |
1692 KB |
Output is correct |
20 |
Correct |
28 ms |
1676 KB |
Output is correct |
21 |
Correct |
26 ms |
1704 KB |
Output is correct |
22 |
Correct |
35 ms |
1612 KB |
Output is correct |
23 |
Correct |
39 ms |
1688 KB |
Output is correct |
24 |
Correct |
31 ms |
1740 KB |
Output is correct |
25 |
Correct |
34 ms |
1600 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
8 ms |
844 KB |
Output is correct |
30 |
Correct |
16 ms |
1196 KB |
Output is correct |
31 |
Correct |
23 ms |
1612 KB |
Output is correct |
32 |
Correct |
26 ms |
1704 KB |
Output is correct |
33 |
Correct |
25 ms |
1700 KB |
Output is correct |
34 |
Correct |
25 ms |
1604 KB |
Output is correct |
35 |
Correct |
26 ms |
1692 KB |
Output is correct |
36 |
Correct |
28 ms |
1712 KB |
Output is correct |
37 |
Correct |
27 ms |
1680 KB |
Output is correct |
38 |
Correct |
25 ms |
1696 KB |
Output is correct |
39 |
Correct |
25 ms |
1608 KB |
Output is correct |
40 |
Correct |
26 ms |
1688 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
2 ms |
332 KB |
Output is correct |
46 |
Correct |
2 ms |
328 KB |
Output is correct |
47 |
Correct |
6 ms |
588 KB |
Output is correct |
48 |
Correct |
5 ms |
628 KB |
Output is correct |
49 |
Correct |
8 ms |
740 KB |
Output is correct |
50 |
Correct |
15 ms |
1228 KB |
Output is correct |
51 |
Correct |
40 ms |
1604 KB |
Output is correct |
52 |
Correct |
25 ms |
1612 KB |
Output is correct |
53 |
Correct |
22 ms |
1628 KB |
Output is correct |
54 |
Correct |
23 ms |
1536 KB |
Output is correct |
55 |
Correct |
23 ms |
1584 KB |
Output is correct |
56 |
Correct |
24 ms |
1604 KB |
Output is correct |
57 |
Correct |
23 ms |
1536 KB |
Output is correct |
58 |
Correct |
22 ms |
1580 KB |
Output is correct |
59 |
Correct |
21 ms |
1552 KB |
Output is correct |
60 |
Correct |
21 ms |
1568 KB |
Output is correct |
61 |
Correct |
21 ms |
1532 KB |
Output is correct |
62 |
Correct |
28 ms |
1564 KB |
Output is correct |
63 |
Correct |
22 ms |
1592 KB |
Output is correct |
64 |
Correct |
23 ms |
1588 KB |
Output is correct |
65 |
Correct |
20 ms |
1608 KB |
Output is correct |
66 |
Correct |
23 ms |
1628 KB |
Output is correct |
67 |
Correct |
23 ms |
1612 KB |
Output is correct |
68 |
Correct |
22 ms |
1544 KB |
Output is correct |
69 |
Correct |
28 ms |
1584 KB |
Output is correct |
70 |
Correct |
28 ms |
1624 KB |
Output is correct |
71 |
Correct |
5 ms |
588 KB |
Output is correct |
72 |
Correct |
7 ms |
588 KB |
Output is correct |
73 |
Correct |
4 ms |
588 KB |
Output is correct |
74 |
Correct |
5 ms |
576 KB |
Output is correct |
75 |
Correct |
6 ms |
588 KB |
Output is correct |
76 |
Correct |
8 ms |
772 KB |
Output is correct |
77 |
Correct |
14 ms |
840 KB |
Output is correct |
78 |
Correct |
15 ms |
824 KB |
Output is correct |
79 |
Correct |
13 ms |
844 KB |
Output is correct |
80 |
Correct |
14 ms |
844 KB |
Output is correct |
81 |
Correct |
27 ms |
1228 KB |
Output is correct |
82 |
Correct |
16 ms |
1164 KB |
Output is correct |
83 |
Correct |
16 ms |
1228 KB |
Output is correct |
84 |
Correct |
17 ms |
1220 KB |
Output is correct |
85 |
Correct |
17 ms |
1260 KB |
Output is correct |
86 |
Correct |
20 ms |
1212 KB |
Output is correct |
87 |
Correct |
22 ms |
1276 KB |
Output is correct |
88 |
Correct |
20 ms |
1308 KB |
Output is correct |
89 |
Correct |
19 ms |
1312 KB |
Output is correct |
90 |
Correct |
19 ms |
1228 KB |
Output is correct |
91 |
Correct |
28 ms |
1996 KB |
Output is correct |
92 |
Correct |
26 ms |
1988 KB |
Output is correct |
93 |
Correct |
26 ms |
1988 KB |
Output is correct |
94 |
Correct |
26 ms |
1928 KB |
Output is correct |
95 |
Correct |
29 ms |
1976 KB |
Output is correct |
96 |
Correct |
35 ms |
2400 KB |
Output is correct |
97 |
Correct |
34 ms |
2368 KB |
Output is correct |
98 |
Correct |
31 ms |
2348 KB |
Output is correct |
99 |
Correct |
31 ms |
2460 KB |
Output is correct |
100 |
Correct |
30 ms |
2372 KB |
Output is correct |
101 |
Correct |
31 ms |
2296 KB |
Output is correct |
102 |
Correct |
32 ms |
2396 KB |
Output is correct |
103 |
Correct |
41 ms |
2476 KB |
Output is correct |
104 |
Correct |
45 ms |
2372 KB |
Output is correct |
105 |
Correct |
33 ms |
2396 KB |
Output is correct |
106 |
Correct |
31 ms |
2516 KB |
Output is correct |
107 |
Correct |
31 ms |
2500 KB |
Output is correct |
108 |
Correct |
31 ms |
2500 KB |
Output is correct |
109 |
Correct |
34 ms |
2592 KB |
Output is correct |
110 |
Correct |
35 ms |
2656 KB |
Output is correct |
111 |
Correct |
36 ms |
2628 KB |
Output is correct |
112 |
Correct |
33 ms |
2512 KB |
Output is correct |
113 |
Correct |
31 ms |
2604 KB |
Output is correct |
114 |
Correct |
31 ms |
2556 KB |
Output is correct |
115 |
Correct |
30 ms |
2524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
312 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
10 ms |
848 KB |
Output is correct |
15 |
Correct |
17 ms |
1220 KB |
Output is correct |
16 |
Correct |
32 ms |
1692 KB |
Output is correct |
17 |
Correct |
25 ms |
1616 KB |
Output is correct |
18 |
Correct |
27 ms |
1696 KB |
Output is correct |
19 |
Correct |
36 ms |
1692 KB |
Output is correct |
20 |
Correct |
28 ms |
1676 KB |
Output is correct |
21 |
Correct |
26 ms |
1704 KB |
Output is correct |
22 |
Correct |
35 ms |
1612 KB |
Output is correct |
23 |
Correct |
39 ms |
1688 KB |
Output is correct |
24 |
Correct |
31 ms |
1740 KB |
Output is correct |
25 |
Correct |
34 ms |
1600 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
8 ms |
844 KB |
Output is correct |
30 |
Correct |
16 ms |
1196 KB |
Output is correct |
31 |
Correct |
23 ms |
1612 KB |
Output is correct |
32 |
Correct |
26 ms |
1704 KB |
Output is correct |
33 |
Correct |
25 ms |
1700 KB |
Output is correct |
34 |
Correct |
25 ms |
1604 KB |
Output is correct |
35 |
Correct |
26 ms |
1692 KB |
Output is correct |
36 |
Correct |
28 ms |
1712 KB |
Output is correct |
37 |
Correct |
27 ms |
1680 KB |
Output is correct |
38 |
Correct |
25 ms |
1696 KB |
Output is correct |
39 |
Correct |
25 ms |
1608 KB |
Output is correct |
40 |
Correct |
26 ms |
1688 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
2 ms |
332 KB |
Output is correct |
46 |
Correct |
2 ms |
328 KB |
Output is correct |
47 |
Correct |
6 ms |
588 KB |
Output is correct |
48 |
Correct |
5 ms |
628 KB |
Output is correct |
49 |
Correct |
8 ms |
740 KB |
Output is correct |
50 |
Correct |
15 ms |
1228 KB |
Output is correct |
51 |
Correct |
40 ms |
1604 KB |
Output is correct |
52 |
Correct |
25 ms |
1612 KB |
Output is correct |
53 |
Correct |
22 ms |
1628 KB |
Output is correct |
54 |
Correct |
23 ms |
1536 KB |
Output is correct |
55 |
Correct |
23 ms |
1584 KB |
Output is correct |
56 |
Correct |
24 ms |
1604 KB |
Output is correct |
57 |
Correct |
23 ms |
1536 KB |
Output is correct |
58 |
Correct |
22 ms |
1580 KB |
Output is correct |
59 |
Correct |
21 ms |
1552 KB |
Output is correct |
60 |
Correct |
21 ms |
1568 KB |
Output is correct |
61 |
Correct |
21 ms |
1532 KB |
Output is correct |
62 |
Correct |
28 ms |
1564 KB |
Output is correct |
63 |
Correct |
22 ms |
1592 KB |
Output is correct |
64 |
Correct |
23 ms |
1588 KB |
Output is correct |
65 |
Correct |
20 ms |
1608 KB |
Output is correct |
66 |
Correct |
23 ms |
1628 KB |
Output is correct |
67 |
Correct |
23 ms |
1612 KB |
Output is correct |
68 |
Correct |
22 ms |
1544 KB |
Output is correct |
69 |
Correct |
28 ms |
1584 KB |
Output is correct |
70 |
Correct |
28 ms |
1624 KB |
Output is correct |
71 |
Correct |
5 ms |
588 KB |
Output is correct |
72 |
Correct |
7 ms |
588 KB |
Output is correct |
73 |
Correct |
4 ms |
588 KB |
Output is correct |
74 |
Correct |
5 ms |
576 KB |
Output is correct |
75 |
Correct |
6 ms |
588 KB |
Output is correct |
76 |
Correct |
8 ms |
772 KB |
Output is correct |
77 |
Correct |
14 ms |
840 KB |
Output is correct |
78 |
Correct |
15 ms |
824 KB |
Output is correct |
79 |
Correct |
13 ms |
844 KB |
Output is correct |
80 |
Correct |
14 ms |
844 KB |
Output is correct |
81 |
Correct |
27 ms |
1228 KB |
Output is correct |
82 |
Correct |
16 ms |
1164 KB |
Output is correct |
83 |
Correct |
16 ms |
1228 KB |
Output is correct |
84 |
Correct |
17 ms |
1220 KB |
Output is correct |
85 |
Correct |
17 ms |
1260 KB |
Output is correct |
86 |
Correct |
20 ms |
1212 KB |
Output is correct |
87 |
Correct |
22 ms |
1276 KB |
Output is correct |
88 |
Correct |
20 ms |
1308 KB |
Output is correct |
89 |
Correct |
19 ms |
1312 KB |
Output is correct |
90 |
Correct |
19 ms |
1228 KB |
Output is correct |
91 |
Correct |
28 ms |
1996 KB |
Output is correct |
92 |
Correct |
26 ms |
1988 KB |
Output is correct |
93 |
Correct |
26 ms |
1988 KB |
Output is correct |
94 |
Correct |
26 ms |
1928 KB |
Output is correct |
95 |
Correct |
29 ms |
1976 KB |
Output is correct |
96 |
Correct |
35 ms |
2400 KB |
Output is correct |
97 |
Correct |
34 ms |
2368 KB |
Output is correct |
98 |
Correct |
31 ms |
2348 KB |
Output is correct |
99 |
Correct |
31 ms |
2460 KB |
Output is correct |
100 |
Correct |
30 ms |
2372 KB |
Output is correct |
101 |
Correct |
31 ms |
2296 KB |
Output is correct |
102 |
Correct |
32 ms |
2396 KB |
Output is correct |
103 |
Correct |
41 ms |
2476 KB |
Output is correct |
104 |
Correct |
45 ms |
2372 KB |
Output is correct |
105 |
Correct |
33 ms |
2396 KB |
Output is correct |
106 |
Correct |
31 ms |
2516 KB |
Output is correct |
107 |
Correct |
31 ms |
2500 KB |
Output is correct |
108 |
Correct |
31 ms |
2500 KB |
Output is correct |
109 |
Correct |
34 ms |
2592 KB |
Output is correct |
110 |
Correct |
35 ms |
2656 KB |
Output is correct |
111 |
Correct |
36 ms |
2628 KB |
Output is correct |
112 |
Correct |
33 ms |
2512 KB |
Output is correct |
113 |
Correct |
31 ms |
2604 KB |
Output is correct |
114 |
Correct |
31 ms |
2556 KB |
Output is correct |
115 |
Correct |
30 ms |
2524 KB |
Output is correct |
116 |
Correct |
228 ms |
2008 KB |
Output is correct |
117 |
Correct |
225 ms |
2112 KB |
Output is correct |
118 |
Correct |
546 ms |
2448 KB |
Output is correct |
119 |
Correct |
577 ms |
2332 KB |
Output is correct |
120 |
Correct |
515 ms |
2336 KB |
Output is correct |
121 |
Correct |
1024 ms |
2540 KB |
Output is correct |
122 |
Correct |
999 ms |
2608 KB |
Output is correct |
123 |
Correct |
2574 ms |
3048 KB |
Output is correct |
124 |
Correct |
2463 ms |
3060 KB |
Output is correct |
125 |
Correct |
2645 ms |
3080 KB |
Output is correct |
126 |
Correct |
4608 ms |
3336 KB |
Output is correct |
127 |
Correct |
4880 ms |
3460 KB |
Output is correct |
128 |
Correct |
4829 ms |
3460 KB |
Output is correct |
129 |
Correct |
4802 ms |
3452 KB |
Output is correct |
130 |
Correct |
4723 ms |
3452 KB |
Output is correct |
131 |
Correct |
4778 ms |
3832 KB |
Output is correct |
132 |
Correct |
4774 ms |
3956 KB |
Output is correct |
133 |
Correct |
4592 ms |
4080 KB |
Output is correct |
134 |
Correct |
4538 ms |
4084 KB |
Output is correct |
135 |
Correct |
4569 ms |
4088 KB |
Output is correct |
136 |
Correct |
4736 ms |
4348 KB |
Output is correct |
137 |
Correct |
4714 ms |
4856 KB |
Output is correct |
138 |
Correct |
4920 ms |
4864 KB |
Output is correct |
139 |
Correct |
5007 ms |
5068 KB |
Output is correct |
140 |
Correct |
5013 ms |
5076 KB |
Output is correct |
141 |
Correct |
4825 ms |
5100 KB |
Output is correct |
142 |
Correct |
4837 ms |
5100 KB |
Output is correct |
143 |
Correct |
4772 ms |
5100 KB |
Output is correct |
144 |
Correct |
4972 ms |
5104 KB |
Output is correct |
145 |
Correct |
4787 ms |
5104 KB |
Output is correct |
146 |
Correct |
4747 ms |
5376 KB |
Output is correct |
147 |
Correct |
4822 ms |
5372 KB |
Output is correct |
148 |
Correct |
4838 ms |
5372 KB |
Output is correct |
149 |
Correct |
4755 ms |
5376 KB |
Output is correct |
150 |
Correct |
4859 ms |
5368 KB |
Output is correct |
151 |
Correct |
5314 ms |
5428 KB |
Output is correct |
152 |
Correct |
5201 ms |
5428 KB |
Output is correct |
153 |
Correct |
5197 ms |
5424 KB |
Output is correct |
154 |
Correct |
5290 ms |
5424 KB |
Output is correct |
155 |
Correct |
5374 ms |
5428 KB |
Output is correct |
156 |
Correct |
6627 ms |
5948 KB |
Output is correct |
157 |
Correct |
6769 ms |
5944 KB |
Output is correct |
158 |
Correct |
6404 ms |
5928 KB |
Output is correct |
159 |
Correct |
6335 ms |
5928 KB |
Output is correct |
160 |
Correct |
6414 ms |
5932 KB |
Output is correct |
161 |
Correct |
6861 ms |
5960 KB |
Output is correct |
162 |
Correct |
6229 ms |
5968 KB |
Output is correct |
163 |
Correct |
6091 ms |
5964 KB |
Output is correct |
164 |
Correct |
6261 ms |
5968 KB |
Output is correct |
165 |
Correct |
5827 ms |
5972 KB |
Output is correct |
166 |
Correct |
4872 ms |
5704 KB |
Output is correct |
167 |
Correct |
4716 ms |
5600 KB |
Output is correct |
168 |
Correct |
4764 ms |
5608 KB |
Output is correct |
169 |
Correct |
5057 ms |
5640 KB |
Output is correct |
170 |
Correct |
4789 ms |
5616 KB |
Output is correct |
171 |
Correct |
4499 ms |
5556 KB |
Output is correct |
172 |
Correct |
4334 ms |
5556 KB |
Output is correct |
173 |
Correct |
4374 ms |
5564 KB |
Output is correct |
174 |
Correct |
4329 ms |
5552 KB |
Output is correct |
175 |
Correct |
4372 ms |
5584 KB |
Output is correct |