#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
//#include <bits/extc++.h>
//using namespace __gnu_pbds;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
using ll=long long;
//uniform_int_distribution<> gen(1,100);
template <int MOD_> struct modnum{
private:
int v;
public:
static const int MOD = MOD_;
modnum() : v(0) {}
modnum(ll v_) : v(int(v_ % MOD)) { if (v < 0) v += MOD; }
explicit operator int () const { return v; }
friend bool operator == (const modnum& a, const modnum& b) { return a.v == b.v; }
friend bool operator != (const modnum& a, const modnum& b) { return a.v != b.v; }
friend bool operator < (const modnum& a, const modnum& b) { return a.v < b.v; }
friend bool operator <= (const modnum& a, const modnum& b) { return a.v <= b.v; }
friend bool operator > (const modnum& a, const modnum& b) { return a.v > b.v; }
friend bool operator >= (const modnum& a, const modnum& b) { return a.v >= b.v; }
modnum& operator += (const modnum& o) {
v += o.v;
if (v >= MOD) v -= MOD;
return *this;
}
modnum& operator -= (const modnum& o) {
v -= o.v;
if (v < 0) v += MOD;
return *this;
}
modnum& operator *= (const modnum& o) {
v = int(ll(v) * ll(o.v) % MOD);
return *this;
}
friend modnum pow(modnum a, ll p) {
modnum ans = 1;
for (; p; p /= 2, a *= a) if (p&1) ans *= a;
return ans;
}
modnum operator ~ () const {
modnum res;
res.v = pow((modnum)v, MOD - 2).v;
return res;
}
modnum& operator /= (const modnum& o) {
return *this *= (~o);
}
modnum operator-() const { return modnum(-v); }
modnum& operator++() { return *this += 1; }
modnum operator++(int){ modnum tmp=*this; ++*this; return tmp; }
modnum& operator--() { return *this -= 1; }
modnum operator--(int){ modnum tmp=*this; --*this; return tmp; }
friend modnum operator + (const modnum& a, const modnum& b) { return modnum(a) += b; }
friend modnum operator - (const modnum& a, const modnum& b) { return modnum(a) -= b; }
friend modnum operator * (const modnum& a, const modnum& b) { return modnum(a) *= b; }
friend modnum operator / (const modnum& a, const modnum& b) { return modnum(a) /= b; }
friend ostream& operator<<(std::ostream& os, const modnum& o)
{
os << o.v;
return os;
}
friend istream& operator>>(std::istream& is, modnum& o)
{
is >> o.v;
return is;
}
};
const ll mod=1000003;
const int N=1e6+5,inf=1e9+1;
using mi=modnum<mod>;
int n,a[N],l,r,p=1,pos=1;
int idx[N];
mi ans;
set<int> S;
struct ST{
int T[2*N];
void init(int nd,int l,int r){
if(l==r){
T[nd]=a[l];
return;
}
int m=(l+r)>>1,ln=nd+1,rn=nd+2*(m-l+1);
init(ln,l,m); init(rn,m+1,r);
T[nd]=min(T[ln],T[rn]);
}
void upd(int nd,int l,int r,int x){
if(l==r){
T[nd]=inf;
return;
}
int m=(l+r)>>1,ln=nd+1,rn=nd+2*(m-l+1);
if(x<=m) upd(ln,l,m,x);
else upd(rn,m+1,r,x);
T[nd]=min(T[ln],T[rn]);
}
int qry(int nd,int l,int r,int s,int e){
if(r<s||e<l) return inf;
if(s<=l&&r<=e) return T[nd];
int m=(l+r)>>1,ln=nd+1,rn=nd+2*(m-l+1);
return min(qry(ln,l,m,s,e),qry(rn,m+1,r,s,e));
}
}T;
mi F(ll a){
return a*(a+1)/2;
}
int main(){
ios::sync_with_stdio(false); cin.tie(0);
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=2;i<=n;i++) if(a[p]<a[i]) p=i;
for(int i=1;i<=n;i++) idx[i]=i;
sort(idx+1,idx+n+1,[&](int i,int j){
return a[i]<a[j];
});
T.init(1,1,n);
l=1; r=n;
while(pos<=n){
ll cur=a[idx[pos]];
S.emplace(idx[pos]);
T.upd(1,1,n,idx[pos]);
pos++;
while(pos<=n&&a[idx[pos]]==cur){
S.emplace(idx[pos]);
T.upd(1,1,n,idx[pos]);
pos++;
}
while(S.count(l)){
S.erase(l);
l++;
}
while(S.count(r)){
S.erase(r);
r--;
}
if(l>r) break;
ll nxt=a[idx[pos]];
int sz=S.size();
if(!sz) continue;
ans+=(F(nxt-1)-F(cur-1))*sz;
ll pf,sf,pb,sb;
int i=*S.begin(),j=*S.rbegin();
if(S.size()==1){
pf=T.qry(1,1,n,1,i-1);
sf=T.qry(1,1,n,i+1,n);
ans+=(nxt-cur)*(pf+sf);
} else{
pf=T.qry(1,1,n,1,i-1);
sf=T.qry(1,1,n,i+1,n);
pb=T.qry(1,1,n,1,j-1);
sb=T.qry(1,1,n,j+1,n);
ans+=(nxt-cur)*min(pf+sf+sb,pf+pb+sb);
ans+=(F(nxt)-F(cur))*(1+2*(sz-2));
}
}
cout<<ans;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
560 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Correct |
2 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
12 |
Correct |
2 ms |
596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
560 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Correct |
2 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
12 |
Correct |
2 ms |
596 KB |
Output is correct |
13 |
Correct |
3 ms |
596 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
2 ms |
596 KB |
Output is correct |
17 |
Correct |
2 ms |
636 KB |
Output is correct |
18 |
Correct |
2 ms |
596 KB |
Output is correct |
19 |
Correct |
2 ms |
596 KB |
Output is correct |
20 |
Correct |
2 ms |
596 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
2 ms |
596 KB |
Output is correct |
23 |
Correct |
2 ms |
596 KB |
Output is correct |
24 |
Correct |
2 ms |
596 KB |
Output is correct |
25 |
Correct |
2 ms |
596 KB |
Output is correct |
26 |
Correct |
2 ms |
564 KB |
Output is correct |
27 |
Correct |
2 ms |
596 KB |
Output is correct |
28 |
Correct |
3 ms |
596 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
560 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Correct |
2 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
12 |
Correct |
2 ms |
596 KB |
Output is correct |
13 |
Correct |
3 ms |
596 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
2 ms |
596 KB |
Output is correct |
17 |
Correct |
2 ms |
636 KB |
Output is correct |
18 |
Correct |
2 ms |
596 KB |
Output is correct |
19 |
Correct |
2 ms |
596 KB |
Output is correct |
20 |
Correct |
2 ms |
596 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
2 ms |
596 KB |
Output is correct |
23 |
Correct |
2 ms |
596 KB |
Output is correct |
24 |
Correct |
2 ms |
596 KB |
Output is correct |
25 |
Correct |
2 ms |
596 KB |
Output is correct |
26 |
Correct |
2 ms |
564 KB |
Output is correct |
27 |
Correct |
2 ms |
596 KB |
Output is correct |
28 |
Correct |
3 ms |
596 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
4 ms |
596 KB |
Output is correct |
36 |
Correct |
3 ms |
596 KB |
Output is correct |
37 |
Correct |
3 ms |
596 KB |
Output is correct |
38 |
Correct |
3 ms |
596 KB |
Output is correct |
39 |
Correct |
3 ms |
596 KB |
Output is correct |
40 |
Correct |
2 ms |
596 KB |
Output is correct |
41 |
Correct |
2 ms |
596 KB |
Output is correct |
42 |
Correct |
2 ms |
596 KB |
Output is correct |
43 |
Correct |
3 ms |
596 KB |
Output is correct |
44 |
Correct |
3 ms |
596 KB |
Output is correct |
45 |
Correct |
3 ms |
596 KB |
Output is correct |
46 |
Correct |
5 ms |
596 KB |
Output is correct |
47 |
Correct |
3 ms |
596 KB |
Output is correct |
48 |
Correct |
5 ms |
596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
560 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Correct |
2 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
12 |
Correct |
2 ms |
596 KB |
Output is correct |
13 |
Correct |
3 ms |
596 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
2 ms |
596 KB |
Output is correct |
17 |
Correct |
2 ms |
636 KB |
Output is correct |
18 |
Correct |
2 ms |
596 KB |
Output is correct |
19 |
Correct |
2 ms |
596 KB |
Output is correct |
20 |
Correct |
2 ms |
596 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
2 ms |
596 KB |
Output is correct |
23 |
Correct |
2 ms |
596 KB |
Output is correct |
24 |
Correct |
2 ms |
596 KB |
Output is correct |
25 |
Correct |
2 ms |
596 KB |
Output is correct |
26 |
Correct |
2 ms |
564 KB |
Output is correct |
27 |
Correct |
2 ms |
596 KB |
Output is correct |
28 |
Correct |
3 ms |
596 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
4 ms |
596 KB |
Output is correct |
36 |
Correct |
3 ms |
596 KB |
Output is correct |
37 |
Correct |
3 ms |
596 KB |
Output is correct |
38 |
Correct |
3 ms |
596 KB |
Output is correct |
39 |
Correct |
3 ms |
596 KB |
Output is correct |
40 |
Correct |
2 ms |
596 KB |
Output is correct |
41 |
Correct |
2 ms |
596 KB |
Output is correct |
42 |
Correct |
2 ms |
596 KB |
Output is correct |
43 |
Correct |
3 ms |
596 KB |
Output is correct |
44 |
Correct |
3 ms |
596 KB |
Output is correct |
45 |
Correct |
3 ms |
596 KB |
Output is correct |
46 |
Correct |
5 ms |
596 KB |
Output is correct |
47 |
Correct |
3 ms |
596 KB |
Output is correct |
48 |
Correct |
5 ms |
596 KB |
Output is correct |
49 |
Correct |
4 ms |
640 KB |
Output is correct |
50 |
Correct |
5 ms |
596 KB |
Output is correct |
51 |
Correct |
4 ms |
596 KB |
Output is correct |
52 |
Correct |
3 ms |
596 KB |
Output is correct |
53 |
Correct |
4 ms |
596 KB |
Output is correct |
54 |
Correct |
2 ms |
596 KB |
Output is correct |
55 |
Correct |
2 ms |
596 KB |
Output is correct |
56 |
Correct |
2 ms |
596 KB |
Output is correct |
57 |
Correct |
3 ms |
596 KB |
Output is correct |
58 |
Correct |
3 ms |
596 KB |
Output is correct |
59 |
Correct |
5 ms |
604 KB |
Output is correct |
60 |
Correct |
3 ms |
596 KB |
Output is correct |
61 |
Correct |
3 ms |
632 KB |
Output is correct |
62 |
Correct |
3 ms |
596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
560 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Correct |
2 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
12 |
Correct |
2 ms |
596 KB |
Output is correct |
13 |
Correct |
3 ms |
596 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
2 ms |
596 KB |
Output is correct |
17 |
Correct |
2 ms |
636 KB |
Output is correct |
18 |
Correct |
2 ms |
596 KB |
Output is correct |
19 |
Correct |
2 ms |
596 KB |
Output is correct |
20 |
Correct |
2 ms |
596 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
2 ms |
596 KB |
Output is correct |
23 |
Correct |
2 ms |
596 KB |
Output is correct |
24 |
Correct |
2 ms |
596 KB |
Output is correct |
25 |
Correct |
2 ms |
596 KB |
Output is correct |
26 |
Correct |
2 ms |
564 KB |
Output is correct |
27 |
Correct |
2 ms |
596 KB |
Output is correct |
28 |
Correct |
3 ms |
596 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
1270 ms |
62872 KB |
Output is correct |
36 |
Correct |
1256 ms |
62832 KB |
Output is correct |
37 |
Correct |
1229 ms |
62852 KB |
Output is correct |
38 |
Correct |
1272 ms |
62908 KB |
Output is correct |
39 |
Correct |
1309 ms |
62928 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
733 ms |
62904 KB |
Output is correct |
43 |
Correct |
668 ms |
62816 KB |
Output is correct |
44 |
Correct |
713 ms |
62876 KB |
Output is correct |
45 |
Correct |
352 ms |
62924 KB |
Output is correct |
46 |
Correct |
351 ms |
62980 KB |
Output is correct |
47 |
Correct |
345 ms |
62928 KB |
Output is correct |
48 |
Correct |
534 ms |
62856 KB |
Output is correct |
49 |
Correct |
514 ms |
62816 KB |
Output is correct |
50 |
Correct |
546 ms |
62844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
560 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Correct |
2 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
12 |
Correct |
2 ms |
596 KB |
Output is correct |
13 |
Correct |
3 ms |
596 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
2 ms |
596 KB |
Output is correct |
17 |
Correct |
2 ms |
636 KB |
Output is correct |
18 |
Correct |
2 ms |
596 KB |
Output is correct |
19 |
Correct |
2 ms |
596 KB |
Output is correct |
20 |
Correct |
2 ms |
596 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
2 ms |
596 KB |
Output is correct |
23 |
Correct |
2 ms |
596 KB |
Output is correct |
24 |
Correct |
2 ms |
596 KB |
Output is correct |
25 |
Correct |
2 ms |
596 KB |
Output is correct |
26 |
Correct |
2 ms |
564 KB |
Output is correct |
27 |
Correct |
2 ms |
596 KB |
Output is correct |
28 |
Correct |
3 ms |
596 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
4 ms |
596 KB |
Output is correct |
36 |
Correct |
3 ms |
596 KB |
Output is correct |
37 |
Correct |
3 ms |
596 KB |
Output is correct |
38 |
Correct |
3 ms |
596 KB |
Output is correct |
39 |
Correct |
3 ms |
596 KB |
Output is correct |
40 |
Correct |
2 ms |
596 KB |
Output is correct |
41 |
Correct |
2 ms |
596 KB |
Output is correct |
42 |
Correct |
2 ms |
596 KB |
Output is correct |
43 |
Correct |
3 ms |
596 KB |
Output is correct |
44 |
Correct |
3 ms |
596 KB |
Output is correct |
45 |
Correct |
3 ms |
596 KB |
Output is correct |
46 |
Correct |
5 ms |
596 KB |
Output is correct |
47 |
Correct |
3 ms |
596 KB |
Output is correct |
48 |
Correct |
5 ms |
596 KB |
Output is correct |
49 |
Correct |
1270 ms |
62872 KB |
Output is correct |
50 |
Correct |
1256 ms |
62832 KB |
Output is correct |
51 |
Correct |
1229 ms |
62852 KB |
Output is correct |
52 |
Correct |
1272 ms |
62908 KB |
Output is correct |
53 |
Correct |
1309 ms |
62928 KB |
Output is correct |
54 |
Correct |
1 ms |
340 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
733 ms |
62904 KB |
Output is correct |
57 |
Correct |
668 ms |
62816 KB |
Output is correct |
58 |
Correct |
713 ms |
62876 KB |
Output is correct |
59 |
Correct |
352 ms |
62924 KB |
Output is correct |
60 |
Correct |
351 ms |
62980 KB |
Output is correct |
61 |
Correct |
345 ms |
62928 KB |
Output is correct |
62 |
Correct |
534 ms |
62856 KB |
Output is correct |
63 |
Correct |
514 ms |
62816 KB |
Output is correct |
64 |
Correct |
546 ms |
62844 KB |
Output is correct |
65 |
Correct |
1589 ms |
62732 KB |
Output is correct |
66 |
Correct |
1795 ms |
63104 KB |
Output is correct |
67 |
Correct |
1571 ms |
63052 KB |
Output is correct |
68 |
Correct |
1585 ms |
62940 KB |
Output is correct |
69 |
Correct |
1674 ms |
62840 KB |
Output is correct |
70 |
Correct |
727 ms |
62820 KB |
Output is correct |
71 |
Correct |
647 ms |
62860 KB |
Output is correct |
72 |
Correct |
652 ms |
62924 KB |
Output is correct |
73 |
Correct |
748 ms |
62912 KB |
Output is correct |
74 |
Correct |
738 ms |
62980 KB |
Output is correct |
75 |
Correct |
769 ms |
62856 KB |
Output is correct |
76 |
Correct |
940 ms |
62648 KB |
Output is correct |
77 |
Correct |
930 ms |
62612 KB |
Output is correct |
78 |
Correct |
893 ms |
62540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
596 KB |
Output is correct |
5 |
Correct |
2 ms |
560 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Correct |
2 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
12 |
Correct |
2 ms |
596 KB |
Output is correct |
13 |
Correct |
3 ms |
596 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
2 ms |
596 KB |
Output is correct |
17 |
Correct |
2 ms |
636 KB |
Output is correct |
18 |
Correct |
2 ms |
596 KB |
Output is correct |
19 |
Correct |
2 ms |
596 KB |
Output is correct |
20 |
Correct |
2 ms |
596 KB |
Output is correct |
21 |
Correct |
2 ms |
596 KB |
Output is correct |
22 |
Correct |
2 ms |
596 KB |
Output is correct |
23 |
Correct |
2 ms |
596 KB |
Output is correct |
24 |
Correct |
2 ms |
596 KB |
Output is correct |
25 |
Correct |
2 ms |
596 KB |
Output is correct |
26 |
Correct |
2 ms |
564 KB |
Output is correct |
27 |
Correct |
2 ms |
596 KB |
Output is correct |
28 |
Correct |
3 ms |
596 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
0 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
0 ms |
212 KB |
Output is correct |
35 |
Correct |
4 ms |
596 KB |
Output is correct |
36 |
Correct |
3 ms |
596 KB |
Output is correct |
37 |
Correct |
3 ms |
596 KB |
Output is correct |
38 |
Correct |
3 ms |
596 KB |
Output is correct |
39 |
Correct |
3 ms |
596 KB |
Output is correct |
40 |
Correct |
2 ms |
596 KB |
Output is correct |
41 |
Correct |
2 ms |
596 KB |
Output is correct |
42 |
Correct |
2 ms |
596 KB |
Output is correct |
43 |
Correct |
3 ms |
596 KB |
Output is correct |
44 |
Correct |
3 ms |
596 KB |
Output is correct |
45 |
Correct |
3 ms |
596 KB |
Output is correct |
46 |
Correct |
5 ms |
596 KB |
Output is correct |
47 |
Correct |
3 ms |
596 KB |
Output is correct |
48 |
Correct |
5 ms |
596 KB |
Output is correct |
49 |
Correct |
4 ms |
640 KB |
Output is correct |
50 |
Correct |
5 ms |
596 KB |
Output is correct |
51 |
Correct |
4 ms |
596 KB |
Output is correct |
52 |
Correct |
3 ms |
596 KB |
Output is correct |
53 |
Correct |
4 ms |
596 KB |
Output is correct |
54 |
Correct |
2 ms |
596 KB |
Output is correct |
55 |
Correct |
2 ms |
596 KB |
Output is correct |
56 |
Correct |
2 ms |
596 KB |
Output is correct |
57 |
Correct |
3 ms |
596 KB |
Output is correct |
58 |
Correct |
3 ms |
596 KB |
Output is correct |
59 |
Correct |
5 ms |
604 KB |
Output is correct |
60 |
Correct |
3 ms |
596 KB |
Output is correct |
61 |
Correct |
3 ms |
632 KB |
Output is correct |
62 |
Correct |
3 ms |
596 KB |
Output is correct |
63 |
Correct |
1270 ms |
62872 KB |
Output is correct |
64 |
Correct |
1256 ms |
62832 KB |
Output is correct |
65 |
Correct |
1229 ms |
62852 KB |
Output is correct |
66 |
Correct |
1272 ms |
62908 KB |
Output is correct |
67 |
Correct |
1309 ms |
62928 KB |
Output is correct |
68 |
Correct |
1 ms |
340 KB |
Output is correct |
69 |
Correct |
1 ms |
340 KB |
Output is correct |
70 |
Correct |
733 ms |
62904 KB |
Output is correct |
71 |
Correct |
668 ms |
62816 KB |
Output is correct |
72 |
Correct |
713 ms |
62876 KB |
Output is correct |
73 |
Correct |
352 ms |
62924 KB |
Output is correct |
74 |
Correct |
351 ms |
62980 KB |
Output is correct |
75 |
Correct |
345 ms |
62928 KB |
Output is correct |
76 |
Correct |
534 ms |
62856 KB |
Output is correct |
77 |
Correct |
514 ms |
62816 KB |
Output is correct |
78 |
Correct |
546 ms |
62844 KB |
Output is correct |
79 |
Correct |
1589 ms |
62732 KB |
Output is correct |
80 |
Correct |
1795 ms |
63104 KB |
Output is correct |
81 |
Correct |
1571 ms |
63052 KB |
Output is correct |
82 |
Correct |
1585 ms |
62940 KB |
Output is correct |
83 |
Correct |
1674 ms |
62840 KB |
Output is correct |
84 |
Correct |
727 ms |
62820 KB |
Output is correct |
85 |
Correct |
647 ms |
62860 KB |
Output is correct |
86 |
Correct |
652 ms |
62924 KB |
Output is correct |
87 |
Correct |
748 ms |
62912 KB |
Output is correct |
88 |
Correct |
738 ms |
62980 KB |
Output is correct |
89 |
Correct |
769 ms |
62856 KB |
Output is correct |
90 |
Correct |
940 ms |
62648 KB |
Output is correct |
91 |
Correct |
930 ms |
62612 KB |
Output is correct |
92 |
Correct |
893 ms |
62540 KB |
Output is correct |
93 |
Correct |
749 ms |
62936 KB |
Output is correct |
94 |
Correct |
927 ms |
62936 KB |
Output is correct |
95 |
Correct |
991 ms |
62924 KB |
Output is correct |
96 |
Correct |
955 ms |
62852 KB |
Output is correct |
97 |
Correct |
983 ms |
62604 KB |
Output is correct |
98 |
Correct |
977 ms |
62724 KB |
Output is correct |
99 |
Correct |
1010 ms |
62520 KB |
Output is correct |
100 |
Correct |
1814 ms |
62960 KB |
Output is correct |
101 |
Correct |
1785 ms |
62816 KB |
Output is correct |
102 |
Correct |
1791 ms |
62848 KB |
Output is correct |
103 |
Correct |
1719 ms |
62832 KB |
Output is correct |
104 |
Correct |
1678 ms |
63008 KB |
Output is correct |
105 |
Correct |
637 ms |
62924 KB |
Output is correct |
106 |
Correct |
687 ms |
62920 KB |
Output is correct |