#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<string>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<complex>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<algorithm>
#include<list>
#include<functional>
#include<cassert>
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define y0 y12
#define y1 y22
#define INF 987654321987654321
#define PI 3.141592653589793238462643383279502884
#define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
#define fdn(i,a,b,c) for(int (i)=(a);(i)>=(b);(i)-=(c))
#define MEM0(a) memset((a),0,sizeof(a));
#define MEM_1(a) memset((a),-1,sizeof(a));
#define ALL(a) a.begin(),a.end()
#define SYNC ios_base::sync_with_stdio(false);cin.tie(0)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef pair<ld, ld> Pd;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<double> Vd;
typedef vector<Pi> VPi;
typedef vector<Pll> VPll;
typedef vector<Pd> VPd;
typedef tuple<int, int, int> iii;
typedef tuple<int,int,int,int> iiii;
typedef tuple<ll, ll, ll> LLL;
typedef vector<iii> Viii;
typedef vector<LLL> VLLL;
typedef complex<double> base;
const ll MOD = 1000000007;
ll POW(ll a, ll b, ll MMM = MOD) {ll ret=1; for(;b;b>>=1,a=(a*a)%MMM)if(b&1)ret=(ret*a)% MMM; return ret; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { if (a == 0 || b == 0)return a + b; return a*(b / gcd(a, b)); }
int dx[] = { 0,1,0,-1,1,1,-1,-1 }, dy[] = { 1,0,-1,0,1,-1,1,-1 };
int n;
int a[100001],c[100001],d[100001];
bool cc[100001];
int chk[100001];
vector<Vi> V;
Vi v[100001];
void dfs1(Vi &v,int x,int c)
{
v.pb(x);
chk[x]=c;
if(chk[a[x]])
{
if(!cc[a[x]] && chk[a[x]]==c)
{
Vi st;
while(1)
{
int t=v.back();
v.pop_back();
st.pb(t);
if(t==a[x])break;
}
for(int &tt:st)cc[tt]=1;
reverse(ALL(st));
V.pb(st);
}
}
else dfs1(v,a[x],c);
}
ll ans;
void dfs2(int N)
{
ll t=0;
for(int next:v[N])
{
dfs2(next);
d[N]=max(d[N],c[next]);
t+=c[next];
}
ans+=t-d[N];
}
int main() {
scanf("%d",&n);
fup(i,1,n,1)scanf("%d%d",a+i,c+i);
fup(i,1,n,1)
{
if(!chk[i])
{
Vi v;
dfs1(v,i,i);
}
}
bool ok = 1;
fup(i,1,n,1)
if(!cc[i])
{
ok=0;
v[a[i]].pb(i);
}
if(ok && V.size()==1)return !printf("0");
fup(i,1,n,1)if(cc[i])dfs2(i);
for(auto &vv:V)
{
ll mn=INF,t=0;
int N=vv.size();
int y=vv[N-1];
fup(i,0,N-1,1)
{
t+=min(c[y],d[vv[i]]);
y=vv[i];
}
fup(i,0,N-1,1)
{
t-=min(c[y],d[vv[i]]);
mn=min(mn,t+c[y]);
t+=min(c[y],d[vv[i]]);
y=vv[i];
}
ans += mn;
}
printf("%lld",ans);
}
Compilation message
telegraph.cpp: In function 'int main()':
telegraph.cpp:105:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
~~~~~^~~~~~~~~
telegraph.cpp:106:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
fup(i,1,n,1)scanf("%d%d",a+i,c+i);
~~~~~^~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
2808 KB |
Output is correct |
2 |
Correct |
4 ms |
2680 KB |
Output is correct |
3 |
Correct |
4 ms |
2680 KB |
Output is correct |
4 |
Correct |
4 ms |
2680 KB |
Output is correct |
5 |
Correct |
4 ms |
2680 KB |
Output is correct |
6 |
Correct |
4 ms |
2680 KB |
Output is correct |
7 |
Correct |
4 ms |
2680 KB |
Output is correct |
8 |
Correct |
4 ms |
2680 KB |
Output is correct |
9 |
Correct |
4 ms |
2680 KB |
Output is correct |
10 |
Correct |
4 ms |
2680 KB |
Output is correct |
11 |
Correct |
4 ms |
2680 KB |
Output is correct |
12 |
Correct |
4 ms |
2680 KB |
Output is correct |
13 |
Correct |
4 ms |
2680 KB |
Output is correct |
14 |
Correct |
4 ms |
2680 KB |
Output is correct |
15 |
Correct |
4 ms |
2680 KB |
Output is correct |
16 |
Correct |
4 ms |
2652 KB |
Output is correct |
17 |
Correct |
4 ms |
2680 KB |
Output is correct |
18 |
Correct |
4 ms |
2680 KB |
Output is correct |
19 |
Correct |
4 ms |
2680 KB |
Output is correct |
20 |
Correct |
4 ms |
2680 KB |
Output is correct |
21 |
Correct |
4 ms |
2680 KB |
Output is correct |
22 |
Correct |
4 ms |
2680 KB |
Output is correct |
23 |
Correct |
1 ms |
2808 KB |
Output is correct |
24 |
Correct |
4 ms |
2680 KB |
Output is correct |
25 |
Correct |
4 ms |
2680 KB |
Output is correct |
26 |
Correct |
4 ms |
2680 KB |
Output is correct |
27 |
Correct |
4 ms |
2680 KB |
Output is correct |
28 |
Correct |
4 ms |
2652 KB |
Output is correct |
29 |
Correct |
4 ms |
2680 KB |
Output is correct |
30 |
Correct |
4 ms |
2752 KB |
Output is correct |
31 |
Correct |
4 ms |
2680 KB |
Output is correct |
32 |
Correct |
4 ms |
2680 KB |
Output is correct |
33 |
Correct |
4 ms |
2680 KB |
Output is correct |
34 |
Correct |
4 ms |
2680 KB |
Output is correct |
35 |
Correct |
4 ms |
2680 KB |
Output is correct |
36 |
Correct |
5 ms |
2680 KB |
Output is correct |
37 |
Correct |
5 ms |
2680 KB |
Output is correct |
38 |
Correct |
4 ms |
2680 KB |
Output is correct |
39 |
Correct |
4 ms |
2680 KB |
Output is correct |
40 |
Correct |
4 ms |
2680 KB |
Output is correct |
41 |
Correct |
5 ms |
2680 KB |
Output is correct |
42 |
Correct |
4 ms |
2680 KB |
Output is correct |
43 |
Correct |
4 ms |
2680 KB |
Output is correct |
44 |
Correct |
4 ms |
2684 KB |
Output is correct |
45 |
Correct |
4 ms |
2680 KB |
Output is correct |
46 |
Correct |
4 ms |
2680 KB |
Output is correct |
47 |
Correct |
4 ms |
2680 KB |
Output is correct |
48 |
Correct |
4 ms |
2680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
2808 KB |
Output is correct |
2 |
Correct |
4 ms |
2680 KB |
Output is correct |
3 |
Correct |
4 ms |
2680 KB |
Output is correct |
4 |
Correct |
4 ms |
2680 KB |
Output is correct |
5 |
Correct |
4 ms |
2680 KB |
Output is correct |
6 |
Correct |
4 ms |
2680 KB |
Output is correct |
7 |
Correct |
4 ms |
2680 KB |
Output is correct |
8 |
Correct |
4 ms |
2680 KB |
Output is correct |
9 |
Correct |
4 ms |
2680 KB |
Output is correct |
10 |
Correct |
4 ms |
2680 KB |
Output is correct |
11 |
Correct |
4 ms |
2680 KB |
Output is correct |
12 |
Correct |
4 ms |
2680 KB |
Output is correct |
13 |
Correct |
4 ms |
2680 KB |
Output is correct |
14 |
Correct |
4 ms |
2680 KB |
Output is correct |
15 |
Correct |
4 ms |
2680 KB |
Output is correct |
16 |
Correct |
4 ms |
2652 KB |
Output is correct |
17 |
Correct |
4 ms |
2680 KB |
Output is correct |
18 |
Correct |
4 ms |
2680 KB |
Output is correct |
19 |
Correct |
4 ms |
2680 KB |
Output is correct |
20 |
Correct |
4 ms |
2680 KB |
Output is correct |
21 |
Correct |
4 ms |
2680 KB |
Output is correct |
22 |
Correct |
4 ms |
2680 KB |
Output is correct |
23 |
Correct |
1 ms |
2808 KB |
Output is correct |
24 |
Correct |
4 ms |
2680 KB |
Output is correct |
25 |
Correct |
4 ms |
2680 KB |
Output is correct |
26 |
Correct |
4 ms |
2680 KB |
Output is correct |
27 |
Correct |
4 ms |
2680 KB |
Output is correct |
28 |
Correct |
4 ms |
2652 KB |
Output is correct |
29 |
Correct |
4 ms |
2680 KB |
Output is correct |
30 |
Correct |
4 ms |
2752 KB |
Output is correct |
31 |
Correct |
4 ms |
2680 KB |
Output is correct |
32 |
Correct |
4 ms |
2680 KB |
Output is correct |
33 |
Correct |
4 ms |
2680 KB |
Output is correct |
34 |
Correct |
4 ms |
2680 KB |
Output is correct |
35 |
Correct |
4 ms |
2680 KB |
Output is correct |
36 |
Correct |
5 ms |
2680 KB |
Output is correct |
37 |
Correct |
5 ms |
2680 KB |
Output is correct |
38 |
Correct |
4 ms |
2680 KB |
Output is correct |
39 |
Correct |
4 ms |
2680 KB |
Output is correct |
40 |
Correct |
4 ms |
2680 KB |
Output is correct |
41 |
Correct |
5 ms |
2680 KB |
Output is correct |
42 |
Correct |
4 ms |
2680 KB |
Output is correct |
43 |
Correct |
4 ms |
2680 KB |
Output is correct |
44 |
Correct |
4 ms |
2684 KB |
Output is correct |
45 |
Correct |
4 ms |
2680 KB |
Output is correct |
46 |
Correct |
4 ms |
2680 KB |
Output is correct |
47 |
Correct |
4 ms |
2680 KB |
Output is correct |
48 |
Correct |
4 ms |
2680 KB |
Output is correct |
49 |
Correct |
0 ms |
2680 KB |
Output is correct |
50 |
Correct |
4 ms |
2680 KB |
Output is correct |
51 |
Correct |
4 ms |
2680 KB |
Output is correct |
52 |
Correct |
4 ms |
2680 KB |
Output is correct |
53 |
Correct |
4 ms |
2680 KB |
Output is correct |
54 |
Correct |
4 ms |
2680 KB |
Output is correct |
55 |
Correct |
4 ms |
2680 KB |
Output is correct |
56 |
Correct |
4 ms |
2684 KB |
Output is correct |
57 |
Correct |
4 ms |
2680 KB |
Output is correct |
58 |
Correct |
4 ms |
2680 KB |
Output is correct |
59 |
Correct |
4 ms |
2680 KB |
Output is correct |
60 |
Correct |
4 ms |
2680 KB |
Output is correct |
61 |
Correct |
4 ms |
2680 KB |
Output is correct |
62 |
Correct |
5 ms |
2680 KB |
Output is correct |
63 |
Correct |
5 ms |
2808 KB |
Output is correct |
64 |
Correct |
5 ms |
2680 KB |
Output is correct |
65 |
Correct |
4 ms |
2680 KB |
Output is correct |
66 |
Correct |
4 ms |
2680 KB |
Output is correct |
67 |
Correct |
5 ms |
2684 KB |
Output is correct |
68 |
Correct |
5 ms |
2680 KB |
Output is correct |
69 |
Correct |
5 ms |
2680 KB |
Output is correct |
70 |
Correct |
4 ms |
2680 KB |
Output is correct |
71 |
Correct |
4 ms |
2680 KB |
Output is correct |
72 |
Correct |
4 ms |
2680 KB |
Output is correct |
73 |
Correct |
4 ms |
2680 KB |
Output is correct |
74 |
Correct |
2 ms |
2680 KB |
Output is correct |
75 |
Correct |
4 ms |
2776 KB |
Output is correct |
76 |
Correct |
4 ms |
2680 KB |
Output is correct |
77 |
Correct |
4 ms |
2680 KB |
Output is correct |
78 |
Correct |
4 ms |
2680 KB |
Output is correct |
79 |
Correct |
4 ms |
2680 KB |
Output is correct |
80 |
Correct |
5 ms |
2680 KB |
Output is correct |
81 |
Correct |
5 ms |
2680 KB |
Output is correct |
82 |
Correct |
4 ms |
2680 KB |
Output is correct |
83 |
Correct |
4 ms |
2680 KB |
Output is correct |
84 |
Correct |
4 ms |
2732 KB |
Output is correct |
85 |
Correct |
5 ms |
2680 KB |
Output is correct |
86 |
Correct |
4 ms |
2680 KB |
Output is correct |
87 |
Correct |
4 ms |
2680 KB |
Output is correct |
88 |
Correct |
4 ms |
2680 KB |
Output is correct |
89 |
Correct |
4 ms |
2680 KB |
Output is correct |
90 |
Correct |
4 ms |
2680 KB |
Output is correct |
91 |
Correct |
4 ms |
2680 KB |
Output is correct |
92 |
Correct |
4 ms |
2680 KB |
Output is correct |
93 |
Correct |
4 ms |
2680 KB |
Output is correct |
94 |
Correct |
5 ms |
2680 KB |
Output is correct |
95 |
Correct |
4 ms |
2680 KB |
Output is correct |
96 |
Correct |
4 ms |
2680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
2808 KB |
Output is correct |
2 |
Correct |
4 ms |
2680 KB |
Output is correct |
3 |
Correct |
4 ms |
2680 KB |
Output is correct |
4 |
Correct |
4 ms |
2680 KB |
Output is correct |
5 |
Correct |
4 ms |
2680 KB |
Output is correct |
6 |
Correct |
4 ms |
2680 KB |
Output is correct |
7 |
Correct |
4 ms |
2680 KB |
Output is correct |
8 |
Correct |
4 ms |
2680 KB |
Output is correct |
9 |
Correct |
4 ms |
2680 KB |
Output is correct |
10 |
Correct |
4 ms |
2680 KB |
Output is correct |
11 |
Correct |
4 ms |
2680 KB |
Output is correct |
12 |
Correct |
4 ms |
2680 KB |
Output is correct |
13 |
Correct |
4 ms |
2680 KB |
Output is correct |
14 |
Correct |
4 ms |
2680 KB |
Output is correct |
15 |
Correct |
4 ms |
2680 KB |
Output is correct |
16 |
Correct |
4 ms |
2652 KB |
Output is correct |
17 |
Correct |
4 ms |
2680 KB |
Output is correct |
18 |
Correct |
4 ms |
2680 KB |
Output is correct |
19 |
Correct |
4 ms |
2680 KB |
Output is correct |
20 |
Correct |
4 ms |
2680 KB |
Output is correct |
21 |
Correct |
4 ms |
2680 KB |
Output is correct |
22 |
Correct |
4 ms |
2680 KB |
Output is correct |
23 |
Correct |
1 ms |
2808 KB |
Output is correct |
24 |
Correct |
4 ms |
2680 KB |
Output is correct |
25 |
Correct |
4 ms |
2680 KB |
Output is correct |
26 |
Correct |
4 ms |
2680 KB |
Output is correct |
27 |
Correct |
4 ms |
2680 KB |
Output is correct |
28 |
Correct |
4 ms |
2652 KB |
Output is correct |
29 |
Correct |
4 ms |
2680 KB |
Output is correct |
30 |
Correct |
4 ms |
2752 KB |
Output is correct |
31 |
Correct |
4 ms |
2680 KB |
Output is correct |
32 |
Correct |
4 ms |
2680 KB |
Output is correct |
33 |
Correct |
4 ms |
2680 KB |
Output is correct |
34 |
Correct |
4 ms |
2680 KB |
Output is correct |
35 |
Correct |
4 ms |
2680 KB |
Output is correct |
36 |
Correct |
5 ms |
2680 KB |
Output is correct |
37 |
Correct |
5 ms |
2680 KB |
Output is correct |
38 |
Correct |
4 ms |
2680 KB |
Output is correct |
39 |
Correct |
4 ms |
2680 KB |
Output is correct |
40 |
Correct |
4 ms |
2680 KB |
Output is correct |
41 |
Correct |
5 ms |
2680 KB |
Output is correct |
42 |
Correct |
4 ms |
2680 KB |
Output is correct |
43 |
Correct |
4 ms |
2680 KB |
Output is correct |
44 |
Correct |
4 ms |
2684 KB |
Output is correct |
45 |
Correct |
4 ms |
2680 KB |
Output is correct |
46 |
Correct |
4 ms |
2680 KB |
Output is correct |
47 |
Correct |
4 ms |
2680 KB |
Output is correct |
48 |
Correct |
4 ms |
2680 KB |
Output is correct |
49 |
Correct |
0 ms |
2680 KB |
Output is correct |
50 |
Correct |
4 ms |
2680 KB |
Output is correct |
51 |
Correct |
4 ms |
2680 KB |
Output is correct |
52 |
Correct |
4 ms |
2680 KB |
Output is correct |
53 |
Correct |
4 ms |
2680 KB |
Output is correct |
54 |
Correct |
4 ms |
2680 KB |
Output is correct |
55 |
Correct |
4 ms |
2680 KB |
Output is correct |
56 |
Correct |
4 ms |
2684 KB |
Output is correct |
57 |
Correct |
4 ms |
2680 KB |
Output is correct |
58 |
Correct |
4 ms |
2680 KB |
Output is correct |
59 |
Correct |
4 ms |
2680 KB |
Output is correct |
60 |
Correct |
4 ms |
2680 KB |
Output is correct |
61 |
Correct |
4 ms |
2680 KB |
Output is correct |
62 |
Correct |
5 ms |
2680 KB |
Output is correct |
63 |
Correct |
5 ms |
2808 KB |
Output is correct |
64 |
Correct |
5 ms |
2680 KB |
Output is correct |
65 |
Correct |
4 ms |
2680 KB |
Output is correct |
66 |
Correct |
4 ms |
2680 KB |
Output is correct |
67 |
Correct |
5 ms |
2684 KB |
Output is correct |
68 |
Correct |
5 ms |
2680 KB |
Output is correct |
69 |
Correct |
5 ms |
2680 KB |
Output is correct |
70 |
Correct |
4 ms |
2680 KB |
Output is correct |
71 |
Correct |
4 ms |
2680 KB |
Output is correct |
72 |
Correct |
4 ms |
2680 KB |
Output is correct |
73 |
Correct |
4 ms |
2680 KB |
Output is correct |
74 |
Correct |
2 ms |
2680 KB |
Output is correct |
75 |
Correct |
4 ms |
2776 KB |
Output is correct |
76 |
Correct |
4 ms |
2680 KB |
Output is correct |
77 |
Correct |
4 ms |
2680 KB |
Output is correct |
78 |
Correct |
4 ms |
2680 KB |
Output is correct |
79 |
Correct |
4 ms |
2680 KB |
Output is correct |
80 |
Correct |
5 ms |
2680 KB |
Output is correct |
81 |
Correct |
5 ms |
2680 KB |
Output is correct |
82 |
Correct |
4 ms |
2680 KB |
Output is correct |
83 |
Correct |
4 ms |
2680 KB |
Output is correct |
84 |
Correct |
4 ms |
2732 KB |
Output is correct |
85 |
Correct |
5 ms |
2680 KB |
Output is correct |
86 |
Correct |
4 ms |
2680 KB |
Output is correct |
87 |
Correct |
4 ms |
2680 KB |
Output is correct |
88 |
Correct |
4 ms |
2680 KB |
Output is correct |
89 |
Correct |
4 ms |
2680 KB |
Output is correct |
90 |
Correct |
4 ms |
2680 KB |
Output is correct |
91 |
Correct |
4 ms |
2680 KB |
Output is correct |
92 |
Correct |
4 ms |
2680 KB |
Output is correct |
93 |
Correct |
4 ms |
2680 KB |
Output is correct |
94 |
Correct |
5 ms |
2680 KB |
Output is correct |
95 |
Correct |
4 ms |
2680 KB |
Output is correct |
96 |
Correct |
4 ms |
2680 KB |
Output is correct |
97 |
Correct |
6 ms |
2808 KB |
Output is correct |
98 |
Correct |
6 ms |
2808 KB |
Output is correct |
99 |
Correct |
6 ms |
2808 KB |
Output is correct |
100 |
Correct |
6 ms |
2808 KB |
Output is correct |
101 |
Correct |
6 ms |
2808 KB |
Output is correct |
102 |
Correct |
5 ms |
3064 KB |
Output is correct |
103 |
Correct |
6 ms |
3064 KB |
Output is correct |
104 |
Correct |
5 ms |
3064 KB |
Output is correct |
105 |
Correct |
5 ms |
3064 KB |
Output is correct |
106 |
Correct |
6 ms |
3064 KB |
Output is correct |
107 |
Correct |
6 ms |
2936 KB |
Output is correct |
108 |
Correct |
6 ms |
2936 KB |
Output is correct |
109 |
Correct |
7 ms |
2936 KB |
Output is correct |
110 |
Correct |
6 ms |
2936 KB |
Output is correct |
111 |
Correct |
6 ms |
2936 KB |
Output is correct |
112 |
Correct |
6 ms |
2936 KB |
Output is correct |
113 |
Correct |
6 ms |
2936 KB |
Output is correct |
114 |
Correct |
5 ms |
2936 KB |
Output is correct |
115 |
Correct |
6 ms |
2936 KB |
Output is correct |
116 |
Correct |
6 ms |
2936 KB |
Output is correct |
117 |
Correct |
7 ms |
2936 KB |
Output is correct |
118 |
Correct |
5 ms |
2936 KB |
Output is correct |
119 |
Correct |
6 ms |
2936 KB |
Output is correct |
120 |
Correct |
6 ms |
2808 KB |
Output is correct |
121 |
Correct |
6 ms |
2808 KB |
Output is correct |
122 |
Correct |
6 ms |
2808 KB |
Output is correct |
123 |
Correct |
5 ms |
2808 KB |
Output is correct |
124 |
Correct |
5 ms |
2808 KB |
Output is correct |
125 |
Correct |
5 ms |
2808 KB |
Output is correct |
126 |
Correct |
6 ms |
2808 KB |
Output is correct |
127 |
Correct |
6 ms |
2808 KB |
Output is correct |
128 |
Correct |
6 ms |
2808 KB |
Output is correct |
129 |
Correct |
6 ms |
3064 KB |
Output is correct |
130 |
Correct |
5 ms |
3064 KB |
Output is correct |
131 |
Correct |
5 ms |
3064 KB |
Output is correct |
132 |
Correct |
5 ms |
3064 KB |
Output is correct |
133 |
Correct |
5 ms |
2808 KB |
Output is correct |
134 |
Correct |
5 ms |
2808 KB |
Output is correct |
135 |
Correct |
5 ms |
2808 KB |
Output is correct |
136 |
Correct |
5 ms |
2808 KB |
Output is correct |
137 |
Correct |
5 ms |
2808 KB |
Output is correct |
138 |
Correct |
5 ms |
2756 KB |
Output is correct |
139 |
Correct |
5 ms |
2808 KB |
Output is correct |
140 |
Correct |
5 ms |
2680 KB |
Output is correct |
141 |
Correct |
5 ms |
2808 KB |
Output is correct |
142 |
Correct |
4 ms |
2808 KB |
Output is correct |
143 |
Correct |
4 ms |
2808 KB |
Output is correct |
144 |
Correct |
5 ms |
2808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
2808 KB |
Output is correct |
2 |
Correct |
4 ms |
2680 KB |
Output is correct |
3 |
Correct |
4 ms |
2680 KB |
Output is correct |
4 |
Correct |
4 ms |
2680 KB |
Output is correct |
5 |
Correct |
4 ms |
2680 KB |
Output is correct |
6 |
Correct |
4 ms |
2680 KB |
Output is correct |
7 |
Correct |
4 ms |
2680 KB |
Output is correct |
8 |
Correct |
4 ms |
2680 KB |
Output is correct |
9 |
Correct |
4 ms |
2680 KB |
Output is correct |
10 |
Correct |
4 ms |
2680 KB |
Output is correct |
11 |
Correct |
4 ms |
2680 KB |
Output is correct |
12 |
Correct |
4 ms |
2680 KB |
Output is correct |
13 |
Correct |
4 ms |
2680 KB |
Output is correct |
14 |
Correct |
4 ms |
2680 KB |
Output is correct |
15 |
Correct |
4 ms |
2680 KB |
Output is correct |
16 |
Correct |
4 ms |
2652 KB |
Output is correct |
17 |
Correct |
4 ms |
2680 KB |
Output is correct |
18 |
Correct |
4 ms |
2680 KB |
Output is correct |
19 |
Correct |
4 ms |
2680 KB |
Output is correct |
20 |
Correct |
4 ms |
2680 KB |
Output is correct |
21 |
Correct |
4 ms |
2680 KB |
Output is correct |
22 |
Correct |
4 ms |
2680 KB |
Output is correct |
23 |
Correct |
1 ms |
2808 KB |
Output is correct |
24 |
Correct |
4 ms |
2680 KB |
Output is correct |
25 |
Correct |
4 ms |
2680 KB |
Output is correct |
26 |
Correct |
4 ms |
2680 KB |
Output is correct |
27 |
Correct |
4 ms |
2680 KB |
Output is correct |
28 |
Correct |
4 ms |
2652 KB |
Output is correct |
29 |
Correct |
4 ms |
2680 KB |
Output is correct |
30 |
Correct |
4 ms |
2752 KB |
Output is correct |
31 |
Correct |
4 ms |
2680 KB |
Output is correct |
32 |
Correct |
4 ms |
2680 KB |
Output is correct |
33 |
Correct |
4 ms |
2680 KB |
Output is correct |
34 |
Correct |
4 ms |
2680 KB |
Output is correct |
35 |
Correct |
4 ms |
2680 KB |
Output is correct |
36 |
Correct |
5 ms |
2680 KB |
Output is correct |
37 |
Correct |
5 ms |
2680 KB |
Output is correct |
38 |
Correct |
4 ms |
2680 KB |
Output is correct |
39 |
Correct |
4 ms |
2680 KB |
Output is correct |
40 |
Correct |
4 ms |
2680 KB |
Output is correct |
41 |
Correct |
5 ms |
2680 KB |
Output is correct |
42 |
Correct |
4 ms |
2680 KB |
Output is correct |
43 |
Correct |
4 ms |
2680 KB |
Output is correct |
44 |
Correct |
4 ms |
2684 KB |
Output is correct |
45 |
Correct |
4 ms |
2680 KB |
Output is correct |
46 |
Correct |
4 ms |
2680 KB |
Output is correct |
47 |
Correct |
4 ms |
2680 KB |
Output is correct |
48 |
Correct |
4 ms |
2680 KB |
Output is correct |
49 |
Correct |
0 ms |
2680 KB |
Output is correct |
50 |
Correct |
4 ms |
2680 KB |
Output is correct |
51 |
Correct |
4 ms |
2680 KB |
Output is correct |
52 |
Correct |
4 ms |
2680 KB |
Output is correct |
53 |
Correct |
4 ms |
2680 KB |
Output is correct |
54 |
Correct |
4 ms |
2680 KB |
Output is correct |
55 |
Correct |
4 ms |
2680 KB |
Output is correct |
56 |
Correct |
4 ms |
2684 KB |
Output is correct |
57 |
Correct |
4 ms |
2680 KB |
Output is correct |
58 |
Correct |
4 ms |
2680 KB |
Output is correct |
59 |
Correct |
4 ms |
2680 KB |
Output is correct |
60 |
Correct |
4 ms |
2680 KB |
Output is correct |
61 |
Correct |
4 ms |
2680 KB |
Output is correct |
62 |
Correct |
5 ms |
2680 KB |
Output is correct |
63 |
Correct |
5 ms |
2808 KB |
Output is correct |
64 |
Correct |
5 ms |
2680 KB |
Output is correct |
65 |
Correct |
4 ms |
2680 KB |
Output is correct |
66 |
Correct |
4 ms |
2680 KB |
Output is correct |
67 |
Correct |
5 ms |
2684 KB |
Output is correct |
68 |
Correct |
5 ms |
2680 KB |
Output is correct |
69 |
Correct |
5 ms |
2680 KB |
Output is correct |
70 |
Correct |
4 ms |
2680 KB |
Output is correct |
71 |
Correct |
4 ms |
2680 KB |
Output is correct |
72 |
Correct |
4 ms |
2680 KB |
Output is correct |
73 |
Correct |
4 ms |
2680 KB |
Output is correct |
74 |
Correct |
2 ms |
2680 KB |
Output is correct |
75 |
Correct |
4 ms |
2776 KB |
Output is correct |
76 |
Correct |
4 ms |
2680 KB |
Output is correct |
77 |
Correct |
4 ms |
2680 KB |
Output is correct |
78 |
Correct |
4 ms |
2680 KB |
Output is correct |
79 |
Correct |
4 ms |
2680 KB |
Output is correct |
80 |
Correct |
5 ms |
2680 KB |
Output is correct |
81 |
Correct |
5 ms |
2680 KB |
Output is correct |
82 |
Correct |
4 ms |
2680 KB |
Output is correct |
83 |
Correct |
4 ms |
2680 KB |
Output is correct |
84 |
Correct |
4 ms |
2732 KB |
Output is correct |
85 |
Correct |
5 ms |
2680 KB |
Output is correct |
86 |
Correct |
4 ms |
2680 KB |
Output is correct |
87 |
Correct |
4 ms |
2680 KB |
Output is correct |
88 |
Correct |
4 ms |
2680 KB |
Output is correct |
89 |
Correct |
4 ms |
2680 KB |
Output is correct |
90 |
Correct |
4 ms |
2680 KB |
Output is correct |
91 |
Correct |
4 ms |
2680 KB |
Output is correct |
92 |
Correct |
4 ms |
2680 KB |
Output is correct |
93 |
Correct |
4 ms |
2680 KB |
Output is correct |
94 |
Correct |
5 ms |
2680 KB |
Output is correct |
95 |
Correct |
4 ms |
2680 KB |
Output is correct |
96 |
Correct |
4 ms |
2680 KB |
Output is correct |
97 |
Correct |
6 ms |
2808 KB |
Output is correct |
98 |
Correct |
6 ms |
2808 KB |
Output is correct |
99 |
Correct |
6 ms |
2808 KB |
Output is correct |
100 |
Correct |
6 ms |
2808 KB |
Output is correct |
101 |
Correct |
6 ms |
2808 KB |
Output is correct |
102 |
Correct |
5 ms |
3064 KB |
Output is correct |
103 |
Correct |
6 ms |
3064 KB |
Output is correct |
104 |
Correct |
5 ms |
3064 KB |
Output is correct |
105 |
Correct |
5 ms |
3064 KB |
Output is correct |
106 |
Correct |
6 ms |
3064 KB |
Output is correct |
107 |
Correct |
6 ms |
2936 KB |
Output is correct |
108 |
Correct |
6 ms |
2936 KB |
Output is correct |
109 |
Correct |
7 ms |
2936 KB |
Output is correct |
110 |
Correct |
6 ms |
2936 KB |
Output is correct |
111 |
Correct |
6 ms |
2936 KB |
Output is correct |
112 |
Correct |
6 ms |
2936 KB |
Output is correct |
113 |
Correct |
6 ms |
2936 KB |
Output is correct |
114 |
Correct |
5 ms |
2936 KB |
Output is correct |
115 |
Correct |
6 ms |
2936 KB |
Output is correct |
116 |
Correct |
6 ms |
2936 KB |
Output is correct |
117 |
Correct |
7 ms |
2936 KB |
Output is correct |
118 |
Correct |
5 ms |
2936 KB |
Output is correct |
119 |
Correct |
6 ms |
2936 KB |
Output is correct |
120 |
Correct |
6 ms |
2808 KB |
Output is correct |
121 |
Correct |
6 ms |
2808 KB |
Output is correct |
122 |
Correct |
6 ms |
2808 KB |
Output is correct |
123 |
Correct |
5 ms |
2808 KB |
Output is correct |
124 |
Correct |
5 ms |
2808 KB |
Output is correct |
125 |
Correct |
5 ms |
2808 KB |
Output is correct |
126 |
Correct |
6 ms |
2808 KB |
Output is correct |
127 |
Correct |
6 ms |
2808 KB |
Output is correct |
128 |
Correct |
6 ms |
2808 KB |
Output is correct |
129 |
Correct |
6 ms |
3064 KB |
Output is correct |
130 |
Correct |
5 ms |
3064 KB |
Output is correct |
131 |
Correct |
5 ms |
3064 KB |
Output is correct |
132 |
Correct |
5 ms |
3064 KB |
Output is correct |
133 |
Correct |
5 ms |
2808 KB |
Output is correct |
134 |
Correct |
5 ms |
2808 KB |
Output is correct |
135 |
Correct |
5 ms |
2808 KB |
Output is correct |
136 |
Correct |
5 ms |
2808 KB |
Output is correct |
137 |
Correct |
5 ms |
2808 KB |
Output is correct |
138 |
Correct |
5 ms |
2756 KB |
Output is correct |
139 |
Correct |
5 ms |
2808 KB |
Output is correct |
140 |
Correct |
5 ms |
2680 KB |
Output is correct |
141 |
Correct |
5 ms |
2808 KB |
Output is correct |
142 |
Correct |
4 ms |
2808 KB |
Output is correct |
143 |
Correct |
4 ms |
2808 KB |
Output is correct |
144 |
Correct |
5 ms |
2808 KB |
Output is correct |
145 |
Correct |
69 ms |
8056 KB |
Output is correct |
146 |
Correct |
66 ms |
8056 KB |
Output is correct |
147 |
Correct |
68 ms |
7900 KB |
Output is correct |
148 |
Correct |
66 ms |
7928 KB |
Output is correct |
149 |
Correct |
64 ms |
7928 KB |
Output is correct |
150 |
Correct |
51 ms |
16188 KB |
Output is correct |
151 |
Correct |
51 ms |
16140 KB |
Output is correct |
152 |
Correct |
51 ms |
16112 KB |
Output is correct |
153 |
Correct |
50 ms |
16212 KB |
Output is correct |
154 |
Correct |
50 ms |
16108 KB |
Output is correct |
155 |
Correct |
58 ms |
12268 KB |
Output is correct |
156 |
Correct |
57 ms |
12268 KB |
Output is correct |
157 |
Correct |
56 ms |
12392 KB |
Output is correct |
158 |
Correct |
57 ms |
12320 KB |
Output is correct |
159 |
Correct |
59 ms |
12424 KB |
Output is correct |
160 |
Correct |
57 ms |
12344 KB |
Output is correct |
161 |
Correct |
58 ms |
12368 KB |
Output is correct |
162 |
Correct |
49 ms |
11628 KB |
Output is correct |
163 |
Correct |
49 ms |
11620 KB |
Output is correct |
164 |
Correct |
54 ms |
8232 KB |
Output is correct |
165 |
Correct |
55 ms |
8360 KB |
Output is correct |
166 |
Correct |
48 ms |
11116 KB |
Output is correct |
167 |
Correct |
48 ms |
10988 KB |
Output is correct |
168 |
Correct |
72 ms |
7032 KB |
Output is correct |
169 |
Correct |
53 ms |
7184 KB |
Output is correct |
170 |
Correct |
54 ms |
7160 KB |
Output is correct |
171 |
Correct |
54 ms |
7164 KB |
Output is correct |
172 |
Correct |
73 ms |
7160 KB |
Output is correct |
173 |
Correct |
54 ms |
7160 KB |
Output is correct |
174 |
Correct |
58 ms |
7160 KB |
Output is correct |
175 |
Correct |
54 ms |
7160 KB |
Output is correct |
176 |
Correct |
79 ms |
7032 KB |
Output is correct |
177 |
Correct |
42 ms |
15468 KB |
Output is correct |
178 |
Correct |
42 ms |
15336 KB |
Output is correct |
179 |
Correct |
43 ms |
15340 KB |
Output is correct |
180 |
Correct |
42 ms |
15416 KB |
Output is correct |
181 |
Correct |
40 ms |
6024 KB |
Output is correct |
182 |
Correct |
40 ms |
6000 KB |
Output is correct |
183 |
Correct |
44 ms |
5880 KB |
Output is correct |
184 |
Correct |
43 ms |
5880 KB |
Output is correct |
185 |
Correct |
47 ms |
6264 KB |
Output is correct |
186 |
Correct |
31 ms |
5240 KB |
Output is correct |
187 |
Correct |
17 ms |
3960 KB |
Output is correct |
188 |
Correct |
63 ms |
7800 KB |
Output is correct |
189 |
Correct |
47 ms |
6520 KB |
Output is correct |
190 |
Correct |
32 ms |
10228 KB |
Output is correct |
191 |
Correct |
18 ms |
6904 KB |
Output is correct |
192 |
Correct |
7 ms |
3576 KB |
Output is correct |