#include <bits/stdc++.h>
using namespace std;
long long sqrtn;
bool queriessort(tuple<long long, long long, long long> x, tuple<long long, long long, long long> y)
{
long long l1, r1, i1, l2, r2, i2;
tie(l1, r1, i1)=x;
tie(l2, r2, i2)=y;
if (l1/sqrtn==l2/sqrtn)
return r1<r2;
return (l1/sqrtn<l2/sqrtn);
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
long long n, q, i;
cin >> n >> q;
long long a[n];
tuple<long long, long long, long long> queries[q];
sqrtn=sqrt(n);
for (i=0; i<n; i++)
cin >> a[i];
for (i=0; i<q; i++)
{
long long l, r;
cin >> l >> r;
queries[i]={l-1, r-1, i};
}
sort(queries, queries+q, queriessort);
long long frequency[300001]={0}, compressed[n+1]={0};
long long x=0, y=0;
set<long long> nonzero;
frequency[a[0]]=1;
compressed[1]=1;
nonzero.insert(1);
long long answer[q];
for (i=0; i<q; i++)
{
long long lt, rt, index;
tie(lt, rt, index)=queries[i];
/*if (i!=0 && lt/sqrtn>get<0>(queries[i-1])/sqrtn)
{
x=lt-lt%sqrtn;
y=lt-lt%sqrtn;
for (int j=0; j<=300000; j++)
frequency[j]=0;
for (int j=0; j<=n; j++)
compressed[j]=0;
nonzero.clear();
frequency[a[x]]=1;
compressed[1]=1;
nonzero.insert(1);
}*/
while (lt>x)
{
compressed[frequency[a[x]]]=compressed[frequency[a[x]]]-1;
if (compressed[frequency[a[x]]]==0)
nonzero.erase(frequency[a[x]]);
frequency[a[x]]=frequency[a[x]]-1;
compressed[frequency[a[x]]]=compressed[frequency[a[x]]]+1;
if (compressed[frequency[a[x]]]==1)
nonzero.insert(frequency[a[x]]);
x=x+1;
}
while (lt<x)
{
x=x-1;
compressed[frequency[a[x]]]=compressed[frequency[a[x]]]-1;
if (compressed[frequency[a[x]]]==0)
nonzero.erase(frequency[a[x]]);
frequency[a[x]]=frequency[a[x]]+1;
compressed[frequency[a[x]]]=compressed[frequency[a[x]]]+1;
if (compressed[frequency[a[x]]]==1)
nonzero.insert(frequency[a[x]]);
}
while (rt>y)
{
y=y+1;
compressed[frequency[a[y]]]=compressed[frequency[a[y]]]-1;
if (compressed[frequency[a[y]]]==0)
nonzero.erase(frequency[a[y]]);
frequency[a[y]]=frequency[a[y]]+1;
compressed[frequency[a[y]]]=compressed[frequency[a[y]]]+1;
if (compressed[frequency[a[y]]]==1)
nonzero.insert(frequency[a[y]]);
}
while (rt<y)
{
compressed[frequency[a[y]]]=compressed[frequency[a[y]]]-1;
if (compressed[frequency[a[x]]]==0)
nonzero.erase(frequency[a[x]]);
frequency[a[y]]=frequency[a[y]]-1;
compressed[frequency[a[y]]]=compressed[frequency[a[y]]]+1;
if (compressed[frequency[a[y]]]==1)
nonzero.insert(frequency[a[y]]);
y=y-1;
}
long long l=0;
long long r=0;
bool odd=false;
long long nc=y-x+1;
nonzero.erase(0);
long long kc=0;
for (auto xc : nonzero)
kc=kc+compressed[xc];
long long s=kc*nc*(nc+1)-nc*(kc-1);
for (auto xc : nonzero)
{
long long n1, n2;
if (compressed[xc]%2==1)
{
if (odd)
{
n1=compressed[xc]/2;
n2=(compressed[xc]+1)/2;
odd=false;
}
else
{
n1=(compressed[xc]+1)/2;
n2=compressed[xc]/2;
odd=true;
}
}
else
{
n1=compressed[xc]/2;
n2=compressed[xc]/2;
}
s=s-(n1*l*l+xc*xc*((n1-1)*n1*(2*(n1-1)+1)/6)+2*xc*l*((n1-1)*n1/2));
s=s-(n1*(nc-l-xc)*(nc-l-xc)+xc*xc*((n1-1)*n1*(2*(n1-1)+1)/6)-2*xc*(nc-l-xc)*((n1-1)*n1/2));
s=s-(n2*r*r+xc*xc*((n2-1)*n2*(2*(n2-1)+1)/6)+2*xc*r*((n2-1)*n2/2));
s=s-(n2*(nc-r-xc)*(nc-r-xc)+xc*xc*((n2-1)*n2*(2*(n2-1)+1)/6)-2*xc*(nc-r-xc)*((n2-1)*n2/2));
l=l+n1*xc;
r=r+n2*xc;
}
s=s/2;
answer[index]=s;
}
for (i=0; i<q; i++)
cout << answer[i] << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
1 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
1 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
1 ms |
2644 KB |
Output is correct |
10 |
Correct |
1 ms |
2644 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2772 KB |
Output is correct |
4 |
Correct |
14 ms |
4220 KB |
Output is correct |
5 |
Correct |
29 ms |
5784 KB |
Output is correct |
6 |
Correct |
41 ms |
7320 KB |
Output is correct |
7 |
Correct |
36 ms |
7316 KB |
Output is correct |
8 |
Correct |
43 ms |
7316 KB |
Output is correct |
9 |
Correct |
52 ms |
7344 KB |
Output is correct |
10 |
Correct |
52 ms |
7308 KB |
Output is correct |
11 |
Correct |
43 ms |
7336 KB |
Output is correct |
12 |
Correct |
50 ms |
7324 KB |
Output is correct |
13 |
Correct |
43 ms |
7440 KB |
Output is correct |
14 |
Correct |
49 ms |
7312 KB |
Output is correct |
15 |
Correct |
42 ms |
7340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2772 KB |
Output is correct |
4 |
Correct |
14 ms |
4220 KB |
Output is correct |
5 |
Correct |
29 ms |
5784 KB |
Output is correct |
6 |
Correct |
41 ms |
7320 KB |
Output is correct |
7 |
Correct |
36 ms |
7316 KB |
Output is correct |
8 |
Correct |
43 ms |
7316 KB |
Output is correct |
9 |
Correct |
52 ms |
7344 KB |
Output is correct |
10 |
Correct |
52 ms |
7308 KB |
Output is correct |
11 |
Correct |
43 ms |
7336 KB |
Output is correct |
12 |
Correct |
50 ms |
7324 KB |
Output is correct |
13 |
Correct |
43 ms |
7440 KB |
Output is correct |
14 |
Correct |
49 ms |
7312 KB |
Output is correct |
15 |
Correct |
42 ms |
7340 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
3 ms |
2772 KB |
Output is correct |
19 |
Correct |
17 ms |
4228 KB |
Output is correct |
20 |
Correct |
34 ms |
5792 KB |
Output is correct |
21 |
Correct |
47 ms |
7336 KB |
Output is correct |
22 |
Correct |
49 ms |
7336 KB |
Output is correct |
23 |
Correct |
49 ms |
7312 KB |
Output is correct |
24 |
Correct |
48 ms |
7316 KB |
Output is correct |
25 |
Correct |
50 ms |
7320 KB |
Output is correct |
26 |
Correct |
50 ms |
7340 KB |
Output is correct |
27 |
Correct |
47 ms |
7340 KB |
Output is correct |
28 |
Correct |
47 ms |
7340 KB |
Output is correct |
29 |
Correct |
48 ms |
7312 KB |
Output is correct |
30 |
Correct |
51 ms |
7344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2772 KB |
Output is correct |
4 |
Correct |
14 ms |
4220 KB |
Output is correct |
5 |
Correct |
29 ms |
5784 KB |
Output is correct |
6 |
Correct |
41 ms |
7320 KB |
Output is correct |
7 |
Correct |
36 ms |
7316 KB |
Output is correct |
8 |
Correct |
43 ms |
7316 KB |
Output is correct |
9 |
Correct |
52 ms |
7344 KB |
Output is correct |
10 |
Correct |
52 ms |
7308 KB |
Output is correct |
11 |
Correct |
43 ms |
7336 KB |
Output is correct |
12 |
Correct |
50 ms |
7324 KB |
Output is correct |
13 |
Correct |
43 ms |
7440 KB |
Output is correct |
14 |
Correct |
49 ms |
7312 KB |
Output is correct |
15 |
Correct |
42 ms |
7340 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
3 ms |
2772 KB |
Output is correct |
19 |
Correct |
17 ms |
4228 KB |
Output is correct |
20 |
Correct |
34 ms |
5792 KB |
Output is correct |
21 |
Correct |
47 ms |
7336 KB |
Output is correct |
22 |
Correct |
49 ms |
7336 KB |
Output is correct |
23 |
Correct |
49 ms |
7312 KB |
Output is correct |
24 |
Correct |
48 ms |
7316 KB |
Output is correct |
25 |
Correct |
50 ms |
7320 KB |
Output is correct |
26 |
Correct |
50 ms |
7340 KB |
Output is correct |
27 |
Correct |
47 ms |
7340 KB |
Output is correct |
28 |
Correct |
47 ms |
7340 KB |
Output is correct |
29 |
Correct |
48 ms |
7312 KB |
Output is correct |
30 |
Correct |
51 ms |
7344 KB |
Output is correct |
31 |
Correct |
1 ms |
2644 KB |
Output is correct |
32 |
Correct |
1 ms |
2644 KB |
Output is correct |
33 |
Correct |
2 ms |
2644 KB |
Output is correct |
34 |
Correct |
3 ms |
2772 KB |
Output is correct |
35 |
Correct |
2 ms |
2772 KB |
Output is correct |
36 |
Correct |
3 ms |
2772 KB |
Output is correct |
37 |
Correct |
7 ms |
3452 KB |
Output is correct |
38 |
Correct |
5 ms |
3452 KB |
Output is correct |
39 |
Correct |
14 ms |
4180 KB |
Output is correct |
40 |
Correct |
27 ms |
5764 KB |
Output is correct |
41 |
Correct |
38 ms |
7364 KB |
Output is correct |
42 |
Correct |
38 ms |
7304 KB |
Output is correct |
43 |
Correct |
49 ms |
7316 KB |
Output is correct |
44 |
Correct |
43 ms |
7304 KB |
Output is correct |
45 |
Correct |
39 ms |
7312 KB |
Output is correct |
46 |
Correct |
38 ms |
7364 KB |
Output is correct |
47 |
Correct |
38 ms |
7372 KB |
Output is correct |
48 |
Correct |
38 ms |
7320 KB |
Output is correct |
49 |
Correct |
37 ms |
7372 KB |
Output is correct |
50 |
Correct |
39 ms |
7352 KB |
Output is correct |
51 |
Correct |
39 ms |
7316 KB |
Output is correct |
52 |
Correct |
37 ms |
7380 KB |
Output is correct |
53 |
Correct |
39 ms |
7368 KB |
Output is correct |
54 |
Correct |
41 ms |
7372 KB |
Output is correct |
55 |
Correct |
37 ms |
7372 KB |
Output is correct |
56 |
Correct |
38 ms |
7252 KB |
Output is correct |
57 |
Correct |
37 ms |
7364 KB |
Output is correct |
58 |
Correct |
40 ms |
7368 KB |
Output is correct |
59 |
Correct |
39 ms |
7368 KB |
Output is correct |
60 |
Correct |
38 ms |
7316 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
1 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
1 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
1 ms |
2644 KB |
Output is correct |
10 |
Correct |
1 ms |
2644 KB |
Output is correct |
11 |
Correct |
1 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2644 KB |
Output is correct |
13 |
Correct |
2 ms |
2772 KB |
Output is correct |
14 |
Correct |
14 ms |
4220 KB |
Output is correct |
15 |
Correct |
29 ms |
5784 KB |
Output is correct |
16 |
Correct |
41 ms |
7320 KB |
Output is correct |
17 |
Correct |
36 ms |
7316 KB |
Output is correct |
18 |
Correct |
43 ms |
7316 KB |
Output is correct |
19 |
Correct |
52 ms |
7344 KB |
Output is correct |
20 |
Correct |
52 ms |
7308 KB |
Output is correct |
21 |
Correct |
43 ms |
7336 KB |
Output is correct |
22 |
Correct |
50 ms |
7324 KB |
Output is correct |
23 |
Correct |
43 ms |
7440 KB |
Output is correct |
24 |
Correct |
49 ms |
7312 KB |
Output is correct |
25 |
Correct |
42 ms |
7340 KB |
Output is correct |
26 |
Correct |
2 ms |
2644 KB |
Output is correct |
27 |
Correct |
2 ms |
2644 KB |
Output is correct |
28 |
Correct |
3 ms |
2772 KB |
Output is correct |
29 |
Correct |
17 ms |
4228 KB |
Output is correct |
30 |
Correct |
34 ms |
5792 KB |
Output is correct |
31 |
Correct |
47 ms |
7336 KB |
Output is correct |
32 |
Correct |
49 ms |
7336 KB |
Output is correct |
33 |
Correct |
49 ms |
7312 KB |
Output is correct |
34 |
Correct |
48 ms |
7316 KB |
Output is correct |
35 |
Correct |
50 ms |
7320 KB |
Output is correct |
36 |
Correct |
50 ms |
7340 KB |
Output is correct |
37 |
Correct |
47 ms |
7340 KB |
Output is correct |
38 |
Correct |
47 ms |
7340 KB |
Output is correct |
39 |
Correct |
48 ms |
7312 KB |
Output is correct |
40 |
Correct |
51 ms |
7344 KB |
Output is correct |
41 |
Correct |
1 ms |
2644 KB |
Output is correct |
42 |
Correct |
1 ms |
2644 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
3 ms |
2772 KB |
Output is correct |
45 |
Correct |
2 ms |
2772 KB |
Output is correct |
46 |
Correct |
3 ms |
2772 KB |
Output is correct |
47 |
Correct |
7 ms |
3452 KB |
Output is correct |
48 |
Correct |
5 ms |
3452 KB |
Output is correct |
49 |
Correct |
14 ms |
4180 KB |
Output is correct |
50 |
Correct |
27 ms |
5764 KB |
Output is correct |
51 |
Correct |
38 ms |
7364 KB |
Output is correct |
52 |
Correct |
38 ms |
7304 KB |
Output is correct |
53 |
Correct |
49 ms |
7316 KB |
Output is correct |
54 |
Correct |
43 ms |
7304 KB |
Output is correct |
55 |
Correct |
39 ms |
7312 KB |
Output is correct |
56 |
Correct |
38 ms |
7364 KB |
Output is correct |
57 |
Correct |
38 ms |
7372 KB |
Output is correct |
58 |
Correct |
38 ms |
7320 KB |
Output is correct |
59 |
Correct |
37 ms |
7372 KB |
Output is correct |
60 |
Correct |
39 ms |
7352 KB |
Output is correct |
61 |
Correct |
39 ms |
7316 KB |
Output is correct |
62 |
Correct |
37 ms |
7380 KB |
Output is correct |
63 |
Correct |
39 ms |
7368 KB |
Output is correct |
64 |
Correct |
41 ms |
7372 KB |
Output is correct |
65 |
Correct |
37 ms |
7372 KB |
Output is correct |
66 |
Correct |
38 ms |
7252 KB |
Output is correct |
67 |
Correct |
37 ms |
7364 KB |
Output is correct |
68 |
Correct |
40 ms |
7368 KB |
Output is correct |
69 |
Correct |
39 ms |
7368 KB |
Output is correct |
70 |
Correct |
38 ms |
7316 KB |
Output is correct |
71 |
Correct |
5 ms |
3412 KB |
Output is correct |
72 |
Correct |
5 ms |
3412 KB |
Output is correct |
73 |
Correct |
5 ms |
3412 KB |
Output is correct |
74 |
Correct |
5 ms |
3412 KB |
Output is correct |
75 |
Correct |
5 ms |
3412 KB |
Output is correct |
76 |
Correct |
9 ms |
4180 KB |
Output is correct |
77 |
Correct |
9 ms |
4180 KB |
Output is correct |
78 |
Correct |
9 ms |
4180 KB |
Output is correct |
79 |
Correct |
11 ms |
4220 KB |
Output is correct |
80 |
Correct |
10 ms |
4180 KB |
Output is correct |
81 |
Correct |
17 ms |
5716 KB |
Output is correct |
82 |
Correct |
18 ms |
5800 KB |
Output is correct |
83 |
Correct |
17 ms |
5760 KB |
Output is correct |
84 |
Correct |
16 ms |
5716 KB |
Output is correct |
85 |
Correct |
18 ms |
5768 KB |
Output is correct |
86 |
Correct |
18 ms |
5768 KB |
Output is correct |
87 |
Correct |
18 ms |
5716 KB |
Output is correct |
88 |
Correct |
17 ms |
5768 KB |
Output is correct |
89 |
Correct |
17 ms |
5768 KB |
Output is correct |
90 |
Correct |
22 ms |
5768 KB |
Output is correct |
91 |
Correct |
29 ms |
7252 KB |
Output is correct |
92 |
Correct |
30 ms |
7312 KB |
Output is correct |
93 |
Correct |
26 ms |
7304 KB |
Output is correct |
94 |
Correct |
26 ms |
7320 KB |
Output is correct |
95 |
Correct |
27 ms |
7252 KB |
Output is correct |
96 |
Correct |
32 ms |
7316 KB |
Output is correct |
97 |
Correct |
32 ms |
7296 KB |
Output is correct |
98 |
Correct |
30 ms |
7316 KB |
Output is correct |
99 |
Correct |
30 ms |
7316 KB |
Output is correct |
100 |
Correct |
30 ms |
7312 KB |
Output is correct |
101 |
Correct |
30 ms |
7316 KB |
Output is correct |
102 |
Correct |
30 ms |
7308 KB |
Output is correct |
103 |
Correct |
30 ms |
7304 KB |
Output is correct |
104 |
Correct |
37 ms |
7352 KB |
Output is correct |
105 |
Correct |
37 ms |
7304 KB |
Output is correct |
106 |
Correct |
30 ms |
7340 KB |
Output is correct |
107 |
Correct |
30 ms |
7252 KB |
Output is correct |
108 |
Correct |
30 ms |
7320 KB |
Output is correct |
109 |
Correct |
30 ms |
7252 KB |
Output is correct |
110 |
Correct |
29 ms |
7312 KB |
Output is correct |
111 |
Correct |
30 ms |
7312 KB |
Output is correct |
112 |
Correct |
30 ms |
7340 KB |
Output is correct |
113 |
Correct |
30 ms |
7320 KB |
Output is correct |
114 |
Correct |
33 ms |
7252 KB |
Output is correct |
115 |
Correct |
31 ms |
7252 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
1 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
1 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
1 ms |
2644 KB |
Output is correct |
10 |
Correct |
1 ms |
2644 KB |
Output is correct |
11 |
Correct |
1 ms |
2644 KB |
Output is correct |
12 |
Correct |
2 ms |
2644 KB |
Output is correct |
13 |
Correct |
2 ms |
2772 KB |
Output is correct |
14 |
Correct |
14 ms |
4220 KB |
Output is correct |
15 |
Correct |
29 ms |
5784 KB |
Output is correct |
16 |
Correct |
41 ms |
7320 KB |
Output is correct |
17 |
Correct |
36 ms |
7316 KB |
Output is correct |
18 |
Correct |
43 ms |
7316 KB |
Output is correct |
19 |
Correct |
52 ms |
7344 KB |
Output is correct |
20 |
Correct |
52 ms |
7308 KB |
Output is correct |
21 |
Correct |
43 ms |
7336 KB |
Output is correct |
22 |
Correct |
50 ms |
7324 KB |
Output is correct |
23 |
Correct |
43 ms |
7440 KB |
Output is correct |
24 |
Correct |
49 ms |
7312 KB |
Output is correct |
25 |
Correct |
42 ms |
7340 KB |
Output is correct |
26 |
Correct |
2 ms |
2644 KB |
Output is correct |
27 |
Correct |
2 ms |
2644 KB |
Output is correct |
28 |
Correct |
3 ms |
2772 KB |
Output is correct |
29 |
Correct |
17 ms |
4228 KB |
Output is correct |
30 |
Correct |
34 ms |
5792 KB |
Output is correct |
31 |
Correct |
47 ms |
7336 KB |
Output is correct |
32 |
Correct |
49 ms |
7336 KB |
Output is correct |
33 |
Correct |
49 ms |
7312 KB |
Output is correct |
34 |
Correct |
48 ms |
7316 KB |
Output is correct |
35 |
Correct |
50 ms |
7320 KB |
Output is correct |
36 |
Correct |
50 ms |
7340 KB |
Output is correct |
37 |
Correct |
47 ms |
7340 KB |
Output is correct |
38 |
Correct |
47 ms |
7340 KB |
Output is correct |
39 |
Correct |
48 ms |
7312 KB |
Output is correct |
40 |
Correct |
51 ms |
7344 KB |
Output is correct |
41 |
Correct |
1 ms |
2644 KB |
Output is correct |
42 |
Correct |
1 ms |
2644 KB |
Output is correct |
43 |
Correct |
2 ms |
2644 KB |
Output is correct |
44 |
Correct |
3 ms |
2772 KB |
Output is correct |
45 |
Correct |
2 ms |
2772 KB |
Output is correct |
46 |
Correct |
3 ms |
2772 KB |
Output is correct |
47 |
Correct |
7 ms |
3452 KB |
Output is correct |
48 |
Correct |
5 ms |
3452 KB |
Output is correct |
49 |
Correct |
14 ms |
4180 KB |
Output is correct |
50 |
Correct |
27 ms |
5764 KB |
Output is correct |
51 |
Correct |
38 ms |
7364 KB |
Output is correct |
52 |
Correct |
38 ms |
7304 KB |
Output is correct |
53 |
Correct |
49 ms |
7316 KB |
Output is correct |
54 |
Correct |
43 ms |
7304 KB |
Output is correct |
55 |
Correct |
39 ms |
7312 KB |
Output is correct |
56 |
Correct |
38 ms |
7364 KB |
Output is correct |
57 |
Correct |
38 ms |
7372 KB |
Output is correct |
58 |
Correct |
38 ms |
7320 KB |
Output is correct |
59 |
Correct |
37 ms |
7372 KB |
Output is correct |
60 |
Correct |
39 ms |
7352 KB |
Output is correct |
61 |
Correct |
39 ms |
7316 KB |
Output is correct |
62 |
Correct |
37 ms |
7380 KB |
Output is correct |
63 |
Correct |
39 ms |
7368 KB |
Output is correct |
64 |
Correct |
41 ms |
7372 KB |
Output is correct |
65 |
Correct |
37 ms |
7372 KB |
Output is correct |
66 |
Correct |
38 ms |
7252 KB |
Output is correct |
67 |
Correct |
37 ms |
7364 KB |
Output is correct |
68 |
Correct |
40 ms |
7368 KB |
Output is correct |
69 |
Correct |
39 ms |
7368 KB |
Output is correct |
70 |
Correct |
38 ms |
7316 KB |
Output is correct |
71 |
Correct |
5 ms |
3412 KB |
Output is correct |
72 |
Correct |
5 ms |
3412 KB |
Output is correct |
73 |
Correct |
5 ms |
3412 KB |
Output is correct |
74 |
Correct |
5 ms |
3412 KB |
Output is correct |
75 |
Correct |
5 ms |
3412 KB |
Output is correct |
76 |
Correct |
9 ms |
4180 KB |
Output is correct |
77 |
Correct |
9 ms |
4180 KB |
Output is correct |
78 |
Correct |
9 ms |
4180 KB |
Output is correct |
79 |
Correct |
11 ms |
4220 KB |
Output is correct |
80 |
Correct |
10 ms |
4180 KB |
Output is correct |
81 |
Correct |
17 ms |
5716 KB |
Output is correct |
82 |
Correct |
18 ms |
5800 KB |
Output is correct |
83 |
Correct |
17 ms |
5760 KB |
Output is correct |
84 |
Correct |
16 ms |
5716 KB |
Output is correct |
85 |
Correct |
18 ms |
5768 KB |
Output is correct |
86 |
Correct |
18 ms |
5768 KB |
Output is correct |
87 |
Correct |
18 ms |
5716 KB |
Output is correct |
88 |
Correct |
17 ms |
5768 KB |
Output is correct |
89 |
Correct |
17 ms |
5768 KB |
Output is correct |
90 |
Correct |
22 ms |
5768 KB |
Output is correct |
91 |
Correct |
29 ms |
7252 KB |
Output is correct |
92 |
Correct |
30 ms |
7312 KB |
Output is correct |
93 |
Correct |
26 ms |
7304 KB |
Output is correct |
94 |
Correct |
26 ms |
7320 KB |
Output is correct |
95 |
Correct |
27 ms |
7252 KB |
Output is correct |
96 |
Correct |
32 ms |
7316 KB |
Output is correct |
97 |
Correct |
32 ms |
7296 KB |
Output is correct |
98 |
Correct |
30 ms |
7316 KB |
Output is correct |
99 |
Correct |
30 ms |
7316 KB |
Output is correct |
100 |
Correct |
30 ms |
7312 KB |
Output is correct |
101 |
Correct |
30 ms |
7316 KB |
Output is correct |
102 |
Correct |
30 ms |
7308 KB |
Output is correct |
103 |
Correct |
30 ms |
7304 KB |
Output is correct |
104 |
Correct |
37 ms |
7352 KB |
Output is correct |
105 |
Correct |
37 ms |
7304 KB |
Output is correct |
106 |
Correct |
30 ms |
7340 KB |
Output is correct |
107 |
Correct |
30 ms |
7252 KB |
Output is correct |
108 |
Correct |
30 ms |
7320 KB |
Output is correct |
109 |
Correct |
30 ms |
7252 KB |
Output is correct |
110 |
Correct |
29 ms |
7312 KB |
Output is correct |
111 |
Correct |
30 ms |
7312 KB |
Output is correct |
112 |
Correct |
30 ms |
7340 KB |
Output is correct |
113 |
Correct |
30 ms |
7320 KB |
Output is correct |
114 |
Correct |
33 ms |
7252 KB |
Output is correct |
115 |
Correct |
31 ms |
7252 KB |
Output is correct |
116 |
Correct |
620 ms |
4788 KB |
Output is correct |
117 |
Correct |
461 ms |
4772 KB |
Output is correct |
118 |
Correct |
2798 ms |
5616 KB |
Output is correct |
119 |
Correct |
843 ms |
5580 KB |
Output is correct |
120 |
Correct |
537 ms |
5524 KB |
Output is correct |
121 |
Correct |
1408 ms |
6316 KB |
Output is correct |
122 |
Correct |
850 ms |
6308 KB |
Output is correct |
123 |
Correct |
4186 ms |
7928 KB |
Output is correct |
124 |
Correct |
1297 ms |
8000 KB |
Output is correct |
125 |
Correct |
964 ms |
7984 KB |
Output is correct |
126 |
Execution timed out |
7045 ms |
9164 KB |
Time limit exceeded |
127 |
Halted |
0 ms |
0 KB |
- |