//https://www.instagram.com/_modwwe/
#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define down cout<<'\n';
#define debug cout<<" cucuucucuuu",down
#define NHP ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
#define modwwe int t;cin>>t; while(t--)
#define bit(i,j) (i>>j&1)
#define sobit(a) __builtin_popcountll(a)
#define task "test"
#define fin(x) freopen(x".inp","r",stdin)
#define fou(x) freopen(x".ans","w",stdout)
#define pb push_back
#define checktime cerr << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms";
using namespace std;
void phongbeo();
const int inf=1e9;
const int mod2=1e9+7;
const int mod1=998244353;
struct icd
{
long double a;
int b;
};
struct ib
{
int a;
int b;
};
struct ic
{
int a,b,c;
};
struct id
{
int a,b,c,d;
};
struct ie
{
int a,b,c,d,e;
};
int n,m,s1,s2,s4,s3,sf,k,s5,s6,mx,s7,s8,s9,mx2,res,dem2=0,dem=0,s33,dem3,l,r,mid;
int i,s10,s12;
int kk;
int el=29;
main()
{
#ifndef ONLINE_JUDGE
//fin(task),fou(task);
#endif
NHP
/// cin>>s1;
// modwwe
phongbeo();
}
vector<int> v;
int add(int x,int y)
{
if(x+y>=mod2) x-=mod2;
if(x+y<0) x+=mod2;
return x+y;
}
id mer(id a,id b)
{
return {add(a.a,b.a),add(a.b,b.b),add(a.c,b.c),add(a.d,b.d)};
}
struct IT
{
id t[4000001];
int t2[4000001];
int t3[4000001];
void build()
{
for(int node=1;node<=4*m;node++)
{t2[node]=1;
t[node]= {0,0,0,0};
t3[node]=0;}
}
void ff(int x)
{
for(int i=x*2; i<=x*2+1; i++)
{
if(t2[i]==0) continue;
t[i].a=t[i].a*t2[x]%mod2;
t[i].b=t[i].b*t2[x]%mod2;
t2[i]=t2[i]*t2[x]%mod2;
t3[i]=(t3[i]+t3[x])%mod2;
t[i].c=(t[i].c*t2[x])%mod2;
t[i].d=(t[i].d*t2[x])%mod2;
t[i].c=(t[i].c-(t3[x]*t[i].d)%mod2)%mod2;
}
t2[x]=1;
t3[x]=0;
}
void upd(int node,int l,int r,int l1,int r1,int x)
{
if(l>r1||r<l1||!t2[node]) return;
if(l>=l1&&r<=r1)
{
t[node].b=t[node].b*2%mod2;
t[node].a=t[node].a*2%mod2;
t2[node]=t2[node]*2%mod2;
t[node].c=t[node].c*2%mod2;
t[node].d=t[node].d*2%mod2;
t3[node]+=x;
t[node].c-=(x*t[node].d)%mod2;
t3[node]%=mod2;
t[node].c%=mod2;
return;
}
if(t2[node]!=1||t3[node]!=0) ff(node);
int mid=l+r>>1;
upd(node<<1,l,mid,l1,r1,x);
upd(node<<1|1,mid+1,r,l1,r1,x);
t[node]=mer(t[node<<1],t[node<<1|1]);
}
void upd2(int node,int l,int r,int l1,ib x,int g)
{
if(l==r)
{
t[node].c+=x.a;
t[node].b+=(((g*v[l-1])%mod2)*x.b)%mod2;
t[node].a+=(x.b*v[l-1])%mod2;
t[node].d+=x.b;
t[node].a%=mod2;
t[node].b%=mod2;
t[node].d%=mod2;
t[node].c%=mod2;
return;
}
int mid=l+r>>1;
if(t2[node]!=1||t3[node]!=0) ff(node);
if(l1<=mid) upd2(node<<1,l,mid,l1,x,g);
else upd2(node<<1|1,mid+1,r,l1,x,g);
t[node]=mer(t[node<<1],t[node<<1|1]);
}
void upd3(int node,int l,int r,int l1,int r1,int x)
{
if(l>r1||r<l1||!t2[node]) return;
if(l>=l1&&r<=r1)
{
t[node].c-=(x*t[node].d)%mod2;
t[node].c%=mod2;
t3[node]+=x;
t3[node]%=mod2;
return;
}
int mid=l+r>>1;
if(t2[node]!=1||t3[node]!=0) ff(node);
upd3(node<<1,l,mid,l1,r1,x);
upd3(node<<1|1,mid+1,r,l1,r1,x);
t[node]=mer(t[node<<1],t[node<<1|1]);
}
void del(int node,int l,int r,int l1,int r1)
{
if(l>r1||r<l1||!t2[node]) return;
if(l>=l1&&r<=r1)
{
t2[node]=0;
t[node]= {0,0,0,0};
return;
}
int mid=l+r>>1;
if(t2[node]!=1||t3[node]!=0) ff(node);
del(node<<1,l,mid,l1,r1);
del(node<<1|1,mid+1,r,l1,r1);
t[node]=mer(t[node<<1],t[node<<1|1]);
}
id get(int node,int l,int r,int l1,int r1)
{
if(l>r1||r<l1||!t2[node]) return {0,0,0,0};
if(l>=l1&&r<=r1) return t[node];
int mid=l+r>>1;
if(t2[node]!=1||t3[node]!=0) ff(node);
return mer(get(node<<1,l,mid,l1,r1),get(node<<1|1,mid+1,r,l1,r1));
}
} st;
ib a[500001];
struct ibb{
ib a,b;
}c[500001];
int invf2;
int ipow(int x, int p){
int ret = 1, piv = x;
while(p){
if(p&1) ret *= piv;
piv *= piv;
ret %= mod2;
piv %= mod2;
p >>= 1;
}
return ret;
}
void phongbeo()
{
cin>>n;
for(int i=1; i<=n; i++)
cin>>a[i].a,v.pb(a[i].a);
for(int i=1; i<=n; i++)
cin>>a[i].b,v.pb(a[i].b);
sort(v.begin(),v.end());
v.erase(unique(v.begin(), v.end()), v.end());
m=v.size();
for(int i=1; i<=n; i++)
{
if(a[i].a>a[i].b) swap(a[i].a,a[i].b);
a[i].a=lower_bound(v.begin(),v.end(),a[i].a)-v.begin()+1;
a[i].b=lower_bound(v.begin(),v.end(),a[i].b)-v.begin()+1;
}
st.build();
st.upd2(1,1,m,a[n].b,{-v[a[n].b-1],1},n);
st.upd2(1,1,m,a[n].a,{-v[a[n].a-1],1},n);
st.del(1,1,m,1,a[n].a-1);
c[n].a={0,1};
c[n].b={0,1};
invf2=ipow(2,mod2-2);
for(int i=n-1; i>=1; --i)
{
id x=st.get(1,1,m,1,a[i].a-1);
id x2=st.get(1,1,m,1,a[i].b-1);
st.upd(1,1,m,a[i].b,m,((v[a[i].a-1]+v[a[i].b-1])%mod2*invf2)%mod2);
st.upd3(1,1,m,a[i].a,a[i].b-1,v[a[i].a-1]);
st.del(1,1,m,1,a[i].a-1);
s2=(x.c+x.b-x.a*i)%mod2;
s3=(x2.c+x2.b-x2.a*i)%mod2;
c[i].a={s2,x.d};
c[i].b={s3,x2.d};
if(x.d!=0) st.upd2(1,1,m,a[i].a,{(s2-(v[a[i].a-1]*x.d)%mod2)%mod2,x.d},i);
if(x2.d!=0) st.upd2(1,1,m,a[i].b,{(s3-(v[a[i].b-1]*x2.d)%mod2)%mod2,x2.d},i);
}
s4=0;
for(int i=0;i<=n-1;i++)
{
if(i==0)
{
s4=(s4+c[1].a.a+c[1].b.a)%mod2;
}
else
{
if(i==1)
{
st.build();
st.upd2(1,1,m,a[1].b,{-v[a[1].b-1],1},1);
st.upd2(1,1,m,a[1].a,{-v[a[1].a-1],1},1);
st.del(1,1,m,1,a[1].a-1);
}
else
{
id x=st.get(1,1,m,1,a[i].a-1);
id x2=st.get(1,1,m,1,a[i].b-1);
st.upd(1,1,m,a[i].b,m,((v[a[i].a-1]+v[a[i].b-1])%mod2*invf2)%mod2);
st.upd3(1,1,m,a[i].a,a[i].b-1,v[a[i].a-1]);
st.del(1,1,m,1,a[i].a-1);
s2=(x.c+(x.a*i)%mod2-x.b)%mod2;
s3=(x2.c+(x2.a*i)%mod2-x2.b)%mod2;
if(x.d!=0) st.upd2(1,1,m,a[i].a,{(s2-(v[a[i].a-1]*x.d)%mod2)%mod2,x.d},i);
if(x2.d!=0) st.upd2(1,1,m,a[i].b,{(s3-(v[a[i].b-1]*x2.d)%mod2)%mod2,x2.d},i);
}
id x=st.get(1,1,m,1,a[i+1].a);
s2=(x.c+(x.a*i+x.a)%mod2-x.b)%mod2;
s4=(s4+(x.d*c[i+1].a.a%mod2+s2*c[i+1].a.b%mod2))%mod2;
x=st.get(1,1,m,1,a[i+1].b);
s2=(x.c+(x.a*i+x.a)%mod2-x.b)%mod2;
s4=(s4+x.d*c[i+1].b.a%mod2+s2*c[i+1].b.b%mod2)%mod2;
}
}
cout<<(s4%mod2+mod2)%mod2;
}
Compilation message
Main.cpp:51:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
51 | main()
| ^~~~
Main.cpp: In member function 'void IT::upd(long long int, long long int, long long int, long long int, long long int, long long int)':
Main.cpp:117:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
117 | int mid=l+r>>1;
| ~^~
Main.cpp: In member function 'void IT::upd2(long long int, long long int, long long int, long long int, ib, long long int)':
Main.cpp:136:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
136 | int mid=l+r>>1;
| ~^~
Main.cpp: In member function 'void IT::upd3(long long int, long long int, long long int, long long int, long long int, long long int)':
Main.cpp:153:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
153 | int mid=l+r>>1;
| ~^~
Main.cpp: In member function 'void IT::del(long long int, long long int, long long int, long long int, long long int)':
Main.cpp:168:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
168 | int mid=l+r>>1;
| ~^~
Main.cpp: In member function 'id IT::get(long long int, long long int, long long int, long long int, long long int)':
Main.cpp:179:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
179 | int mid=l+r>>1;
| ~^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
1 ms |
464 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8660 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8656 KB |
Output is correct |
16 |
Correct |
1 ms |
8540 KB |
Output is correct |
17 |
Correct |
1 ms |
8540 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
8792 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8536 KB |
Output is correct |
7 |
Correct |
2 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
2 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
2 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8676 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8540 KB |
Output is correct |
16 |
Correct |
1 ms |
8540 KB |
Output is correct |
17 |
Correct |
1 ms |
8540 KB |
Output is correct |
18 |
Correct |
1 ms |
8540 KB |
Output is correct |
19 |
Correct |
1 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8540 KB |
Output is correct |
21 |
Correct |
1 ms |
8536 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
1 ms |
8540 KB |
Output is correct |
24 |
Correct |
1 ms |
8540 KB |
Output is correct |
25 |
Correct |
1 ms |
8540 KB |
Output is correct |
26 |
Correct |
2 ms |
8540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
2 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8536 KB |
Output is correct |
7 |
Correct |
2 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
2 ms |
8540 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
2 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8676 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
1 ms |
8540 KB |
Output is correct |
16 |
Correct |
1 ms |
8540 KB |
Output is correct |
17 |
Correct |
1 ms |
8540 KB |
Output is correct |
18 |
Correct |
1 ms |
8540 KB |
Output is correct |
19 |
Correct |
1 ms |
8540 KB |
Output is correct |
20 |
Correct |
1 ms |
8540 KB |
Output is correct |
21 |
Correct |
1 ms |
8536 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
1 ms |
8540 KB |
Output is correct |
24 |
Correct |
1 ms |
8540 KB |
Output is correct |
25 |
Correct |
1 ms |
8540 KB |
Output is correct |
26 |
Correct |
2 ms |
8540 KB |
Output is correct |
27 |
Correct |
10 ms |
11232 KB |
Output is correct |
28 |
Correct |
9 ms |
11104 KB |
Output is correct |
29 |
Correct |
4 ms |
10976 KB |
Output is correct |
30 |
Correct |
4 ms |
10988 KB |
Output is correct |
31 |
Correct |
6 ms |
10976 KB |
Output is correct |
32 |
Correct |
6 ms |
9184 KB |
Output is correct |
33 |
Correct |
6 ms |
10976 KB |
Output is correct |
34 |
Correct |
7 ms |
10976 KB |
Output is correct |
35 |
Correct |
6 ms |
11232 KB |
Output is correct |
36 |
Correct |
5 ms |
7176 KB |
Output is correct |
37 |
Correct |
3 ms |
3040 KB |
Output is correct |
38 |
Correct |
4 ms |
7220 KB |
Output is correct |
39 |
Correct |
6 ms |
10972 KB |
Output is correct |
40 |
Correct |
6 ms |
10976 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
1 ms |
464 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8660 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8656 KB |
Output is correct |
16 |
Correct |
1 ms |
8540 KB |
Output is correct |
17 |
Correct |
1 ms |
8540 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
8792 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
1 ms |
6488 KB |
Output is correct |
24 |
Correct |
1 ms |
8540 KB |
Output is correct |
25 |
Correct |
2 ms |
8540 KB |
Output is correct |
26 |
Correct |
1 ms |
8540 KB |
Output is correct |
27 |
Correct |
1 ms |
8540 KB |
Output is correct |
28 |
Correct |
1 ms |
8536 KB |
Output is correct |
29 |
Correct |
2 ms |
8540 KB |
Output is correct |
30 |
Correct |
1 ms |
8540 KB |
Output is correct |
31 |
Correct |
2 ms |
8540 KB |
Output is correct |
32 |
Correct |
1 ms |
8540 KB |
Output is correct |
33 |
Correct |
1 ms |
8540 KB |
Output is correct |
34 |
Correct |
2 ms |
8540 KB |
Output is correct |
35 |
Correct |
1 ms |
8676 KB |
Output is correct |
36 |
Correct |
1 ms |
8540 KB |
Output is correct |
37 |
Correct |
1 ms |
8540 KB |
Output is correct |
38 |
Correct |
1 ms |
8540 KB |
Output is correct |
39 |
Correct |
1 ms |
8540 KB |
Output is correct |
40 |
Correct |
1 ms |
8540 KB |
Output is correct |
41 |
Correct |
1 ms |
8540 KB |
Output is correct |
42 |
Correct |
1 ms |
8540 KB |
Output is correct |
43 |
Correct |
1 ms |
8536 KB |
Output is correct |
44 |
Correct |
1 ms |
8540 KB |
Output is correct |
45 |
Correct |
1 ms |
8540 KB |
Output is correct |
46 |
Correct |
1 ms |
8540 KB |
Output is correct |
47 |
Correct |
1 ms |
8540 KB |
Output is correct |
48 |
Correct |
2 ms |
8540 KB |
Output is correct |
49 |
Correct |
10 ms |
11232 KB |
Output is correct |
50 |
Correct |
9 ms |
11104 KB |
Output is correct |
51 |
Correct |
4 ms |
10976 KB |
Output is correct |
52 |
Correct |
4 ms |
10988 KB |
Output is correct |
53 |
Correct |
6 ms |
10976 KB |
Output is correct |
54 |
Correct |
6 ms |
9184 KB |
Output is correct |
55 |
Correct |
6 ms |
10976 KB |
Output is correct |
56 |
Correct |
7 ms |
10976 KB |
Output is correct |
57 |
Correct |
6 ms |
11232 KB |
Output is correct |
58 |
Correct |
5 ms |
7176 KB |
Output is correct |
59 |
Correct |
3 ms |
3040 KB |
Output is correct |
60 |
Correct |
4 ms |
7220 KB |
Output is correct |
61 |
Correct |
6 ms |
10972 KB |
Output is correct |
62 |
Correct |
6 ms |
10976 KB |
Output is correct |
63 |
Correct |
11 ms |
13268 KB |
Output is correct |
64 |
Correct |
11 ms |
8668 KB |
Output is correct |
65 |
Correct |
10 ms |
11228 KB |
Output is correct |
66 |
Correct |
5 ms |
11072 KB |
Output is correct |
67 |
Correct |
7 ms |
11228 KB |
Output is correct |
68 |
Correct |
5 ms |
10976 KB |
Output is correct |
69 |
Correct |
35 ms |
9180 KB |
Output is correct |
70 |
Correct |
35 ms |
11232 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8668 KB |
Output is correct |
7 |
Correct |
1 ms |
8540 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
4 ms |
1248 KB |
Output is correct |
11 |
Correct |
4 ms |
10976 KB |
Output is correct |
12 |
Correct |
4 ms |
11036 KB |
Output is correct |
13 |
Correct |
4 ms |
10976 KB |
Output is correct |
14 |
Correct |
142 ms |
37124 KB |
Output is correct |
15 |
Correct |
135 ms |
39092 KB |
Output is correct |
16 |
Correct |
146 ms |
34996 KB |
Output is correct |
17 |
Correct |
141 ms |
39012 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
8540 KB |
Output is correct |
2 |
Correct |
1 ms |
8540 KB |
Output is correct |
3 |
Correct |
1 ms |
8540 KB |
Output is correct |
4 |
Correct |
1 ms |
8540 KB |
Output is correct |
5 |
Correct |
1 ms |
8540 KB |
Output is correct |
6 |
Correct |
1 ms |
8540 KB |
Output is correct |
7 |
Correct |
1 ms |
464 KB |
Output is correct |
8 |
Correct |
1 ms |
8540 KB |
Output is correct |
9 |
Correct |
1 ms |
8660 KB |
Output is correct |
10 |
Correct |
1 ms |
8540 KB |
Output is correct |
11 |
Correct |
1 ms |
8540 KB |
Output is correct |
12 |
Correct |
1 ms |
8540 KB |
Output is correct |
13 |
Correct |
1 ms |
8540 KB |
Output is correct |
14 |
Correct |
1 ms |
8540 KB |
Output is correct |
15 |
Correct |
2 ms |
8656 KB |
Output is correct |
16 |
Correct |
1 ms |
8540 KB |
Output is correct |
17 |
Correct |
1 ms |
8540 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
8792 KB |
Output is correct |
22 |
Correct |
1 ms |
8540 KB |
Output is correct |
23 |
Correct |
1 ms |
6488 KB |
Output is correct |
24 |
Correct |
1 ms |
8540 KB |
Output is correct |
25 |
Correct |
2 ms |
8540 KB |
Output is correct |
26 |
Correct |
1 ms |
8540 KB |
Output is correct |
27 |
Correct |
1 ms |
8540 KB |
Output is correct |
28 |
Correct |
1 ms |
8536 KB |
Output is correct |
29 |
Correct |
2 ms |
8540 KB |
Output is correct |
30 |
Correct |
1 ms |
8540 KB |
Output is correct |
31 |
Correct |
2 ms |
8540 KB |
Output is correct |
32 |
Correct |
1 ms |
8540 KB |
Output is correct |
33 |
Correct |
1 ms |
8540 KB |
Output is correct |
34 |
Correct |
2 ms |
8540 KB |
Output is correct |
35 |
Correct |
1 ms |
8676 KB |
Output is correct |
36 |
Correct |
1 ms |
8540 KB |
Output is correct |
37 |
Correct |
1 ms |
8540 KB |
Output is correct |
38 |
Correct |
1 ms |
8540 KB |
Output is correct |
39 |
Correct |
1 ms |
8540 KB |
Output is correct |
40 |
Correct |
1 ms |
8540 KB |
Output is correct |
41 |
Correct |
1 ms |
8540 KB |
Output is correct |
42 |
Correct |
1 ms |
8540 KB |
Output is correct |
43 |
Correct |
1 ms |
8536 KB |
Output is correct |
44 |
Correct |
1 ms |
8540 KB |
Output is correct |
45 |
Correct |
1 ms |
8540 KB |
Output is correct |
46 |
Correct |
1 ms |
8540 KB |
Output is correct |
47 |
Correct |
1 ms |
8540 KB |
Output is correct |
48 |
Correct |
2 ms |
8540 KB |
Output is correct |
49 |
Correct |
10 ms |
11232 KB |
Output is correct |
50 |
Correct |
9 ms |
11104 KB |
Output is correct |
51 |
Correct |
4 ms |
10976 KB |
Output is correct |
52 |
Correct |
4 ms |
10988 KB |
Output is correct |
53 |
Correct |
6 ms |
10976 KB |
Output is correct |
54 |
Correct |
6 ms |
9184 KB |
Output is correct |
55 |
Correct |
6 ms |
10976 KB |
Output is correct |
56 |
Correct |
7 ms |
10976 KB |
Output is correct |
57 |
Correct |
6 ms |
11232 KB |
Output is correct |
58 |
Correct |
5 ms |
7176 KB |
Output is correct |
59 |
Correct |
3 ms |
3040 KB |
Output is correct |
60 |
Correct |
4 ms |
7220 KB |
Output is correct |
61 |
Correct |
6 ms |
10972 KB |
Output is correct |
62 |
Correct |
6 ms |
10976 KB |
Output is correct |
63 |
Correct |
11 ms |
13268 KB |
Output is correct |
64 |
Correct |
11 ms |
8668 KB |
Output is correct |
65 |
Correct |
10 ms |
11228 KB |
Output is correct |
66 |
Correct |
5 ms |
11072 KB |
Output is correct |
67 |
Correct |
7 ms |
11228 KB |
Output is correct |
68 |
Correct |
5 ms |
10976 KB |
Output is correct |
69 |
Correct |
35 ms |
9180 KB |
Output is correct |
70 |
Correct |
35 ms |
11232 KB |
Output is correct |
71 |
Correct |
1 ms |
8540 KB |
Output is correct |
72 |
Correct |
1 ms |
8540 KB |
Output is correct |
73 |
Correct |
1 ms |
8540 KB |
Output is correct |
74 |
Correct |
1 ms |
2396 KB |
Output is correct |
75 |
Correct |
1 ms |
8540 KB |
Output is correct |
76 |
Correct |
1 ms |
8668 KB |
Output is correct |
77 |
Correct |
1 ms |
8540 KB |
Output is correct |
78 |
Correct |
1 ms |
8540 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
4 ms |
1248 KB |
Output is correct |
81 |
Correct |
4 ms |
10976 KB |
Output is correct |
82 |
Correct |
4 ms |
11036 KB |
Output is correct |
83 |
Correct |
4 ms |
10976 KB |
Output is correct |
84 |
Correct |
142 ms |
37124 KB |
Output is correct |
85 |
Correct |
135 ms |
39092 KB |
Output is correct |
86 |
Correct |
146 ms |
34996 KB |
Output is correct |
87 |
Correct |
141 ms |
39012 KB |
Output is correct |
88 |
Correct |
630 ms |
229104 KB |
Output is correct |
89 |
Correct |
639 ms |
229516 KB |
Output is correct |
90 |
Correct |
251 ms |
38328 KB |
Output is correct |
91 |
Correct |
308 ms |
46896 KB |
Output is correct |
92 |
Correct |
234 ms |
39252 KB |
Output is correct |
93 |
Correct |
245 ms |
39408 KB |
Output is correct |
94 |
Correct |
288 ms |
47032 KB |
Output is correct |
95 |
Correct |
193 ms |
39096 KB |
Output is correct |
96 |
Correct |
2433 ms |
87328 KB |
Output is correct |
97 |
Correct |
2429 ms |
86964 KB |
Output is correct |