# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1071021 |
2024-08-23T01:22:54 Z |
pcc |
Closing Time (IOI23_closing) |
C++17 |
|
1000 ms |
568836 KB |
#include "closing.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define ll long long
const int mxn = 3020;
const ll inf = 2e18;
vector<pii> tree[mxn];
pii eul[mxn];
int ptr = 0;
ll dp[mxn][4][mxn*2];
ll arr[mxn],brr[mxn],crr[mxn];
ll dist[mxn];
int N;
int X,Y;
ll K;
int sz[mxn];
ll tmp[4][mxn*2];
void init(){
ptr = 0;
for(int i = 0;i<=N;i++)tree[i].clear();
}
void dfs(int now,int par){
if(now == par)dist[now] = 0;
for(auto [nxt,w]:tree[now]){
if(nxt == par)continue;
dist[nxt] = dist[now]+w;
dfs(nxt,now);
}
return;
}
void dfs2(int now,int par){
eul[now].fs = ++ptr;
for(auto [nxt,w]:tree[now]){
if(nxt == par)continue;
dfs2(nxt,now);
}
eul[now].sc = ptr;
return;
}
void calc(ll dp1[],ll dp2[],int s1,int s2,ll rdp[]){
assert(max(s1,s2)<=N*2);
for(int i = 0;i<=s1-s2;i++){
for(int j = 0;j<=s2;j++){
rdp[i+j] = min({rdp[i+j],dp1[i]+dp2[j]});
}
}
return;
}
bool inside(int a,int b){//a in b
return eul[a].fs>=eul[b].fs&&eul[a].sc<=eul[b].sc;
}
void dfs3(int now,int par){
sz[now] = 2;
for(int i = 0;i<4;i++)fill(dp[now][i],dp[now][i]+mxn*2,inf);
dp[now][0][0] = 0;
dp[now][1][1] = arr[now];
dp[now][2][1] = brr[now];
dp[now][3][2] = crr[now];
//cerr<<now<<":"<<arr[now]<<' '<<brr[now]<<' '<<crr[now]<<' '<<chain<<endl;
sort(tree[now].begin(),tree[now].end(),[](pii a,pii b){return inside(Y,a.fs)>inside(Y,b.fs);});
for(int i = 1;i<tree[now].size();i++)assert(inside(Y,tree[now][i-1].fs)>=inside(Y,tree[now][i].fs));
for(auto [nxt,w]:tree[now]){
if(nxt == par)continue;
dfs3(nxt,now);
sz[now] += sz[nxt];
for(int i = 0;i<4;i++){
fill(tmp[i],tmp[i]+mxn*2,inf);
}
bool chain = inside(Y,nxt);
if(!chain){
calc(dp[now][1],dp[nxt][1],sz[now],sz[nxt],tmp[1]);
calc(dp[now][3],dp[nxt][1],sz[now],sz[nxt],tmp[3]);
calc(dp[now][2],dp[nxt][2],sz[now],sz[nxt],tmp[2]);
calc(dp[now][3],dp[nxt][2],sz[now],sz[nxt],tmp[3]);
calc(dp[now][3],dp[nxt][3],sz[now],sz[nxt],tmp[3]);
for(int i = 0;i<4;i++){
for(int j = 0;j<=sz[now];j++)dp[now][i][j] = min(dp[now][i][j],tmp[i][j]);
}
}
else{
calc(dp[now][0],dp[nxt][0],sz[now],sz[nxt],tmp[0]);
calc(dp[now][1],dp[nxt][0],sz[now],sz[nxt],tmp[1]);
calc(dp[now][1],dp[nxt][1],sz[now],sz[nxt],tmp[1]);
calc(dp[now][0],dp[nxt][2],sz[now],sz[nxt],tmp[0]);
calc(dp[now][1],dp[nxt][2],sz[now],sz[nxt],tmp[1]);
calc(dp[now][2],dp[nxt][2],sz[now],sz[nxt],tmp[2]);
calc(dp[now][3],dp[nxt][2],sz[now],sz[nxt],tmp[3]);
calc(dp[now][1],dp[nxt][3],sz[now],sz[nxt],tmp[1]);
calc(dp[now][3],dp[nxt][3],sz[now],sz[nxt],tmp[3]);
for(int i = 0;i<4;i++){
for(int j = 0;j<=sz[now];j++)dp[now][i][j] = tmp[i][j];
}
}
}
/*
for(int i =0;i<4;i++){
for(int j = 0;j<=sz[now];j++){
cerr<<now<<' '<<i<<' '<<j<<":"<<dp[now][i][j]<<endl;
}
}
*/
return;
}
int max_score(int NN, int XX, int YY, long long KK,
std::vector<int> U, std::vector<int> V, std::vector<int> W){
X = XX,Y = YY;
K = KK;
init();
N = NN;
for(int i = 0;i<U.size();i++){
int a = U[i],b = V[i],w = W[i];
tree[a].push_back(pii(b,w));
tree[b].push_back(pii(a,w));
}
dfs(X,X);
for(int i = 0;i<N;i++)arr[i] = dist[i];
dfs(Y,Y);
for(int i = 0;i<N;i++)brr[i] = dist[i];
for(int i = 0;i<N;i++)crr[i] = max(arr[i],brr[i]);
dfs2(X,X);
dfs3(X,X);
int ans = 0;
for(int i =0;i<4;i++){
for(int j = 0;j<=N*2;j++){
if(dp[X][i][j]<=K)ans = max(ans,j);
}
}
return ans;
}
Compilation message
closing.cpp: In function 'void dfs3(int, int)':
closing.cpp:74:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
74 | for(int i = 1;i<tree[now].size();i++)assert(inside(Y,tree[now][i-1].fs)>=inside(Y,tree[now][i].fs));
| ~^~~~~~~~~~~~~~~~~
closing.cpp: In function 'int max_score(int, int, int, long long int, std::vector<int>, std::vector<int>, std::vector<int>)':
closing.cpp:137:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
137 | for(int i = 0;i<U.size();i++){
| ~^~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
48 ms |
9204 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
4696 KB |
Output is correct |
3 |
Correct |
1 ms |
4700 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
2 ms |
10844 KB |
Output is correct |
7 |
Correct |
2 ms |
10840 KB |
Output is correct |
8 |
Correct |
2 ms |
10844 KB |
Output is correct |
9 |
Correct |
2 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
4696 KB |
Output is correct |
3 |
Correct |
1 ms |
4700 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
2 ms |
10844 KB |
Output is correct |
7 |
Correct |
2 ms |
10840 KB |
Output is correct |
8 |
Correct |
2 ms |
10844 KB |
Output is correct |
9 |
Correct |
2 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
12 |
Correct |
4 ms |
21084 KB |
Output is correct |
13 |
Correct |
4 ms |
21084 KB |
Output is correct |
14 |
Correct |
4 ms |
19032 KB |
Output is correct |
15 |
Correct |
4 ms |
19036 KB |
Output is correct |
16 |
Correct |
4 ms |
21220 KB |
Output is correct |
17 |
Correct |
4 ms |
21084 KB |
Output is correct |
18 |
Correct |
13 ms |
4796 KB |
Output is correct |
19 |
Correct |
20 ms |
97120 KB |
Output is correct |
20 |
Correct |
19 ms |
88924 KB |
Output is correct |
21 |
Correct |
21 ms |
93020 KB |
Output is correct |
22 |
Correct |
21 ms |
95064 KB |
Output is correct |
23 |
Correct |
23 ms |
95324 KB |
Output is correct |
24 |
Correct |
24 ms |
97112 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2648 KB |
Output is correct |
2 |
Correct |
1 ms |
4696 KB |
Output is correct |
3 |
Correct |
1 ms |
4700 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
2 ms |
10844 KB |
Output is correct |
7 |
Correct |
2 ms |
10840 KB |
Output is correct |
8 |
Correct |
2 ms |
10844 KB |
Output is correct |
9 |
Correct |
2 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
12 |
Correct |
4 ms |
21084 KB |
Output is correct |
13 |
Correct |
4 ms |
21084 KB |
Output is correct |
14 |
Correct |
4 ms |
19032 KB |
Output is correct |
15 |
Correct |
4 ms |
19036 KB |
Output is correct |
16 |
Correct |
4 ms |
21220 KB |
Output is correct |
17 |
Correct |
4 ms |
21084 KB |
Output is correct |
18 |
Correct |
13 ms |
4796 KB |
Output is correct |
19 |
Correct |
20 ms |
97120 KB |
Output is correct |
20 |
Correct |
19 ms |
88924 KB |
Output is correct |
21 |
Correct |
21 ms |
93020 KB |
Output is correct |
22 |
Correct |
21 ms |
95064 KB |
Output is correct |
23 |
Correct |
23 ms |
95324 KB |
Output is correct |
24 |
Correct |
24 ms |
97112 KB |
Output is correct |
25 |
Correct |
58 ms |
10844 KB |
Output is correct |
26 |
Correct |
296 ms |
568476 KB |
Output is correct |
27 |
Correct |
276 ms |
528464 KB |
Output is correct |
28 |
Correct |
358 ms |
532312 KB |
Output is correct |
29 |
Correct |
331 ms |
553680 KB |
Output is correct |
30 |
Correct |
280 ms |
526012 KB |
Output is correct |
31 |
Correct |
392 ms |
568660 KB |
Output is correct |
32 |
Correct |
391 ms |
568836 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2652 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Correct |
1 ms |
4696 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
1 ms |
4700 KB |
Output is correct |
7 |
Correct |
1 ms |
2652 KB |
Output is correct |
8 |
Correct |
1 ms |
2648 KB |
Output is correct |
9 |
Correct |
1 ms |
2652 KB |
Output is correct |
10 |
Correct |
1 ms |
4700 KB |
Output is correct |
11 |
Correct |
1 ms |
4700 KB |
Output is correct |
12 |
Correct |
2 ms |
4700 KB |
Output is correct |
13 |
Correct |
1 ms |
4700 KB |
Output is correct |
14 |
Correct |
1 ms |
4700 KB |
Output is correct |
15 |
Correct |
1 ms |
4700 KB |
Output is correct |
16 |
Correct |
1 ms |
4700 KB |
Output is correct |
17 |
Correct |
1 ms |
4700 KB |
Output is correct |
18 |
Correct |
1 ms |
4700 KB |
Output is correct |
19 |
Correct |
1 ms |
4700 KB |
Output is correct |
20 |
Correct |
1 ms |
4700 KB |
Output is correct |
21 |
Correct |
1 ms |
4700 KB |
Output is correct |
22 |
Correct |
1 ms |
4700 KB |
Output is correct |
23 |
Correct |
1 ms |
4696 KB |
Output is correct |
24 |
Correct |
1 ms |
4700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2652 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Correct |
1 ms |
4696 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
1 ms |
4700 KB |
Output is correct |
7 |
Correct |
2 ms |
10844 KB |
Output is correct |
8 |
Correct |
2 ms |
10840 KB |
Output is correct |
9 |
Correct |
2 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
12 |
Correct |
2 ms |
10844 KB |
Output is correct |
13 |
Correct |
4 ms |
21084 KB |
Output is correct |
14 |
Correct |
4 ms |
21084 KB |
Output is correct |
15 |
Correct |
4 ms |
19032 KB |
Output is correct |
16 |
Correct |
4 ms |
19036 KB |
Output is correct |
17 |
Correct |
4 ms |
21220 KB |
Output is correct |
18 |
Correct |
4 ms |
21084 KB |
Output is correct |
19 |
Correct |
1 ms |
2652 KB |
Output is correct |
20 |
Correct |
1 ms |
2648 KB |
Output is correct |
21 |
Correct |
1 ms |
2652 KB |
Output is correct |
22 |
Correct |
1 ms |
4700 KB |
Output is correct |
23 |
Correct |
1 ms |
4700 KB |
Output is correct |
24 |
Correct |
2 ms |
4700 KB |
Output is correct |
25 |
Correct |
1 ms |
4700 KB |
Output is correct |
26 |
Correct |
1 ms |
4700 KB |
Output is correct |
27 |
Correct |
1 ms |
4700 KB |
Output is correct |
28 |
Correct |
1 ms |
4700 KB |
Output is correct |
29 |
Correct |
1 ms |
4700 KB |
Output is correct |
30 |
Correct |
1 ms |
4700 KB |
Output is correct |
31 |
Correct |
1 ms |
4700 KB |
Output is correct |
32 |
Correct |
1 ms |
4700 KB |
Output is correct |
33 |
Correct |
1 ms |
4700 KB |
Output is correct |
34 |
Correct |
1 ms |
4700 KB |
Output is correct |
35 |
Correct |
1 ms |
4696 KB |
Output is correct |
36 |
Correct |
1 ms |
4700 KB |
Output is correct |
37 |
Correct |
3 ms |
4700 KB |
Output is correct |
38 |
Correct |
3 ms |
10844 KB |
Output is correct |
39 |
Correct |
4 ms |
21084 KB |
Output is correct |
40 |
Correct |
4 ms |
19036 KB |
Output is correct |
41 |
Correct |
4 ms |
21084 KB |
Output is correct |
42 |
Correct |
3 ms |
19036 KB |
Output is correct |
43 |
Correct |
4 ms |
19036 KB |
Output is correct |
44 |
Correct |
4 ms |
19036 KB |
Output is correct |
45 |
Correct |
4 ms |
21084 KB |
Output is correct |
46 |
Correct |
4 ms |
21336 KB |
Output is correct |
47 |
Correct |
4 ms |
21084 KB |
Output is correct |
48 |
Correct |
3 ms |
17088 KB |
Output is correct |
49 |
Correct |
4 ms |
13000 KB |
Output is correct |
50 |
Correct |
2 ms |
6748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2652 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Correct |
1 ms |
4696 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
1 ms |
4700 KB |
Output is correct |
7 |
Correct |
2 ms |
10844 KB |
Output is correct |
8 |
Correct |
2 ms |
10840 KB |
Output is correct |
9 |
Correct |
2 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
12 |
Correct |
2 ms |
10844 KB |
Output is correct |
13 |
Correct |
4 ms |
21084 KB |
Output is correct |
14 |
Correct |
4 ms |
21084 KB |
Output is correct |
15 |
Correct |
4 ms |
19032 KB |
Output is correct |
16 |
Correct |
4 ms |
19036 KB |
Output is correct |
17 |
Correct |
4 ms |
21220 KB |
Output is correct |
18 |
Correct |
4 ms |
21084 KB |
Output is correct |
19 |
Correct |
13 ms |
4796 KB |
Output is correct |
20 |
Correct |
20 ms |
97120 KB |
Output is correct |
21 |
Correct |
19 ms |
88924 KB |
Output is correct |
22 |
Correct |
21 ms |
93020 KB |
Output is correct |
23 |
Correct |
21 ms |
95064 KB |
Output is correct |
24 |
Correct |
23 ms |
95324 KB |
Output is correct |
25 |
Correct |
24 ms |
97112 KB |
Output is correct |
26 |
Correct |
1 ms |
2652 KB |
Output is correct |
27 |
Correct |
1 ms |
2648 KB |
Output is correct |
28 |
Correct |
1 ms |
2652 KB |
Output is correct |
29 |
Correct |
1 ms |
4700 KB |
Output is correct |
30 |
Correct |
1 ms |
4700 KB |
Output is correct |
31 |
Correct |
2 ms |
4700 KB |
Output is correct |
32 |
Correct |
1 ms |
4700 KB |
Output is correct |
33 |
Correct |
1 ms |
4700 KB |
Output is correct |
34 |
Correct |
1 ms |
4700 KB |
Output is correct |
35 |
Correct |
1 ms |
4700 KB |
Output is correct |
36 |
Correct |
1 ms |
4700 KB |
Output is correct |
37 |
Correct |
1 ms |
4700 KB |
Output is correct |
38 |
Correct |
1 ms |
4700 KB |
Output is correct |
39 |
Correct |
1 ms |
4700 KB |
Output is correct |
40 |
Correct |
1 ms |
4700 KB |
Output is correct |
41 |
Correct |
1 ms |
4700 KB |
Output is correct |
42 |
Correct |
1 ms |
4696 KB |
Output is correct |
43 |
Correct |
1 ms |
4700 KB |
Output is correct |
44 |
Correct |
3 ms |
4700 KB |
Output is correct |
45 |
Correct |
3 ms |
10844 KB |
Output is correct |
46 |
Correct |
4 ms |
21084 KB |
Output is correct |
47 |
Correct |
4 ms |
19036 KB |
Output is correct |
48 |
Correct |
4 ms |
21084 KB |
Output is correct |
49 |
Correct |
3 ms |
19036 KB |
Output is correct |
50 |
Correct |
4 ms |
19036 KB |
Output is correct |
51 |
Correct |
4 ms |
19036 KB |
Output is correct |
52 |
Correct |
4 ms |
21084 KB |
Output is correct |
53 |
Correct |
4 ms |
21336 KB |
Output is correct |
54 |
Correct |
4 ms |
21084 KB |
Output is correct |
55 |
Correct |
3 ms |
17088 KB |
Output is correct |
56 |
Correct |
4 ms |
13000 KB |
Output is correct |
57 |
Correct |
2 ms |
6748 KB |
Output is correct |
58 |
Correct |
9 ms |
6748 KB |
Output is correct |
59 |
Correct |
12 ms |
19160 KB |
Output is correct |
60 |
Correct |
11 ms |
21052 KB |
Output is correct |
61 |
Correct |
12 ms |
29276 KB |
Output is correct |
62 |
Correct |
13 ms |
29272 KB |
Output is correct |
63 |
Correct |
20 ms |
97116 KB |
Output is correct |
64 |
Correct |
18 ms |
90972 KB |
Output is correct |
65 |
Correct |
18 ms |
86656 KB |
Output is correct |
66 |
Correct |
18 ms |
90972 KB |
Output is correct |
67 |
Correct |
20 ms |
95108 KB |
Output is correct |
68 |
Correct |
20 ms |
86740 KB |
Output is correct |
69 |
Correct |
21 ms |
95068 KB |
Output is correct |
70 |
Correct |
19 ms |
93020 KB |
Output is correct |
71 |
Correct |
21 ms |
90972 KB |
Output is correct |
72 |
Correct |
19 ms |
93052 KB |
Output is correct |
73 |
Correct |
19 ms |
76628 KB |
Output is correct |
74 |
Correct |
16 ms |
80728 KB |
Output is correct |
75 |
Correct |
10 ms |
21196 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2652 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Correct |
1 ms |
4696 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
1 ms |
4700 KB |
Output is correct |
7 |
Correct |
2 ms |
10844 KB |
Output is correct |
8 |
Correct |
2 ms |
10840 KB |
Output is correct |
9 |
Correct |
2 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
12 |
Correct |
2 ms |
10844 KB |
Output is correct |
13 |
Correct |
4 ms |
21084 KB |
Output is correct |
14 |
Correct |
4 ms |
21084 KB |
Output is correct |
15 |
Correct |
4 ms |
19032 KB |
Output is correct |
16 |
Correct |
4 ms |
19036 KB |
Output is correct |
17 |
Correct |
4 ms |
21220 KB |
Output is correct |
18 |
Correct |
4 ms |
21084 KB |
Output is correct |
19 |
Correct |
13 ms |
4796 KB |
Output is correct |
20 |
Correct |
20 ms |
97120 KB |
Output is correct |
21 |
Correct |
19 ms |
88924 KB |
Output is correct |
22 |
Correct |
21 ms |
93020 KB |
Output is correct |
23 |
Correct |
21 ms |
95064 KB |
Output is correct |
24 |
Correct |
23 ms |
95324 KB |
Output is correct |
25 |
Correct |
24 ms |
97112 KB |
Output is correct |
26 |
Correct |
58 ms |
10844 KB |
Output is correct |
27 |
Correct |
296 ms |
568476 KB |
Output is correct |
28 |
Correct |
276 ms |
528464 KB |
Output is correct |
29 |
Correct |
358 ms |
532312 KB |
Output is correct |
30 |
Correct |
331 ms |
553680 KB |
Output is correct |
31 |
Correct |
280 ms |
526012 KB |
Output is correct |
32 |
Correct |
392 ms |
568660 KB |
Output is correct |
33 |
Correct |
391 ms |
568836 KB |
Output is correct |
34 |
Correct |
1 ms |
2652 KB |
Output is correct |
35 |
Correct |
1 ms |
2648 KB |
Output is correct |
36 |
Correct |
1 ms |
2652 KB |
Output is correct |
37 |
Correct |
1 ms |
4700 KB |
Output is correct |
38 |
Correct |
1 ms |
4700 KB |
Output is correct |
39 |
Correct |
2 ms |
4700 KB |
Output is correct |
40 |
Correct |
1 ms |
4700 KB |
Output is correct |
41 |
Correct |
1 ms |
4700 KB |
Output is correct |
42 |
Correct |
1 ms |
4700 KB |
Output is correct |
43 |
Correct |
1 ms |
4700 KB |
Output is correct |
44 |
Correct |
1 ms |
4700 KB |
Output is correct |
45 |
Correct |
1 ms |
4700 KB |
Output is correct |
46 |
Correct |
1 ms |
4700 KB |
Output is correct |
47 |
Correct |
1 ms |
4700 KB |
Output is correct |
48 |
Correct |
1 ms |
4700 KB |
Output is correct |
49 |
Correct |
1 ms |
4700 KB |
Output is correct |
50 |
Correct |
1 ms |
4696 KB |
Output is correct |
51 |
Correct |
1 ms |
4700 KB |
Output is correct |
52 |
Correct |
3 ms |
4700 KB |
Output is correct |
53 |
Correct |
3 ms |
10844 KB |
Output is correct |
54 |
Correct |
4 ms |
21084 KB |
Output is correct |
55 |
Correct |
4 ms |
19036 KB |
Output is correct |
56 |
Correct |
4 ms |
21084 KB |
Output is correct |
57 |
Correct |
3 ms |
19036 KB |
Output is correct |
58 |
Correct |
4 ms |
19036 KB |
Output is correct |
59 |
Correct |
4 ms |
19036 KB |
Output is correct |
60 |
Correct |
4 ms |
21084 KB |
Output is correct |
61 |
Correct |
4 ms |
21336 KB |
Output is correct |
62 |
Correct |
4 ms |
21084 KB |
Output is correct |
63 |
Correct |
3 ms |
17088 KB |
Output is correct |
64 |
Correct |
4 ms |
13000 KB |
Output is correct |
65 |
Correct |
2 ms |
6748 KB |
Output is correct |
66 |
Correct |
9 ms |
6748 KB |
Output is correct |
67 |
Correct |
12 ms |
19160 KB |
Output is correct |
68 |
Correct |
11 ms |
21052 KB |
Output is correct |
69 |
Correct |
12 ms |
29276 KB |
Output is correct |
70 |
Correct |
13 ms |
29272 KB |
Output is correct |
71 |
Correct |
20 ms |
97116 KB |
Output is correct |
72 |
Correct |
18 ms |
90972 KB |
Output is correct |
73 |
Correct |
18 ms |
86656 KB |
Output is correct |
74 |
Correct |
18 ms |
90972 KB |
Output is correct |
75 |
Correct |
20 ms |
95108 KB |
Output is correct |
76 |
Correct |
20 ms |
86740 KB |
Output is correct |
77 |
Correct |
21 ms |
95068 KB |
Output is correct |
78 |
Correct |
19 ms |
93020 KB |
Output is correct |
79 |
Correct |
21 ms |
90972 KB |
Output is correct |
80 |
Correct |
19 ms |
93052 KB |
Output is correct |
81 |
Correct |
19 ms |
76628 KB |
Output is correct |
82 |
Correct |
16 ms |
80728 KB |
Output is correct |
83 |
Correct |
10 ms |
21196 KB |
Output is correct |
84 |
Correct |
56 ms |
10844 KB |
Output is correct |
85 |
Correct |
66 ms |
54108 KB |
Output is correct |
86 |
Correct |
56 ms |
21292 KB |
Output is correct |
87 |
Correct |
59 ms |
29472 KB |
Output is correct |
88 |
Correct |
59 ms |
29276 KB |
Output is correct |
89 |
Correct |
381 ms |
568232 KB |
Output is correct |
90 |
Correct |
242 ms |
514384 KB |
Output is correct |
91 |
Correct |
350 ms |
565588 KB |
Output is correct |
92 |
Correct |
248 ms |
527188 KB |
Output is correct |
93 |
Correct |
261 ms |
532820 KB |
Output is correct |
94 |
Correct |
359 ms |
541008 KB |
Output is correct |
95 |
Correct |
387 ms |
554484 KB |
Output is correct |
96 |
Correct |
343 ms |
518480 KB |
Output is correct |
97 |
Correct |
320 ms |
553040 KB |
Output is correct |
98 |
Correct |
260 ms |
545272 KB |
Output is correct |
99 |
Correct |
286 ms |
568228 KB |
Output is correct |
100 |
Correct |
191 ms |
395088 KB |
Output is correct |
101 |
Correct |
74 ms |
97112 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2652 KB |
Output is correct |
2 |
Correct |
1 ms |
2648 KB |
Output is correct |
3 |
Correct |
1 ms |
4696 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
1 ms |
4700 KB |
Output is correct |
7 |
Correct |
2 ms |
10844 KB |
Output is correct |
8 |
Correct |
2 ms |
10840 KB |
Output is correct |
9 |
Correct |
2 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
12 |
Correct |
2 ms |
10844 KB |
Output is correct |
13 |
Correct |
4 ms |
21084 KB |
Output is correct |
14 |
Correct |
4 ms |
21084 KB |
Output is correct |
15 |
Correct |
4 ms |
19032 KB |
Output is correct |
16 |
Correct |
4 ms |
19036 KB |
Output is correct |
17 |
Correct |
4 ms |
21220 KB |
Output is correct |
18 |
Correct |
4 ms |
21084 KB |
Output is correct |
19 |
Correct |
13 ms |
4796 KB |
Output is correct |
20 |
Correct |
20 ms |
97120 KB |
Output is correct |
21 |
Correct |
19 ms |
88924 KB |
Output is correct |
22 |
Correct |
21 ms |
93020 KB |
Output is correct |
23 |
Correct |
21 ms |
95064 KB |
Output is correct |
24 |
Correct |
23 ms |
95324 KB |
Output is correct |
25 |
Correct |
24 ms |
97112 KB |
Output is correct |
26 |
Correct |
58 ms |
10844 KB |
Output is correct |
27 |
Correct |
296 ms |
568476 KB |
Output is correct |
28 |
Correct |
276 ms |
528464 KB |
Output is correct |
29 |
Correct |
358 ms |
532312 KB |
Output is correct |
30 |
Correct |
331 ms |
553680 KB |
Output is correct |
31 |
Correct |
280 ms |
526012 KB |
Output is correct |
32 |
Correct |
392 ms |
568660 KB |
Output is correct |
33 |
Correct |
391 ms |
568836 KB |
Output is correct |
34 |
Correct |
1 ms |
2652 KB |
Output is correct |
35 |
Correct |
1 ms |
2648 KB |
Output is correct |
36 |
Correct |
1 ms |
2652 KB |
Output is correct |
37 |
Correct |
1 ms |
4700 KB |
Output is correct |
38 |
Correct |
1 ms |
4700 KB |
Output is correct |
39 |
Correct |
2 ms |
4700 KB |
Output is correct |
40 |
Correct |
1 ms |
4700 KB |
Output is correct |
41 |
Correct |
1 ms |
4700 KB |
Output is correct |
42 |
Correct |
1 ms |
4700 KB |
Output is correct |
43 |
Correct |
1 ms |
4700 KB |
Output is correct |
44 |
Correct |
1 ms |
4700 KB |
Output is correct |
45 |
Correct |
1 ms |
4700 KB |
Output is correct |
46 |
Correct |
1 ms |
4700 KB |
Output is correct |
47 |
Correct |
1 ms |
4700 KB |
Output is correct |
48 |
Correct |
1 ms |
4700 KB |
Output is correct |
49 |
Correct |
1 ms |
4700 KB |
Output is correct |
50 |
Correct |
1 ms |
4696 KB |
Output is correct |
51 |
Correct |
1 ms |
4700 KB |
Output is correct |
52 |
Correct |
3 ms |
4700 KB |
Output is correct |
53 |
Correct |
3 ms |
10844 KB |
Output is correct |
54 |
Correct |
4 ms |
21084 KB |
Output is correct |
55 |
Correct |
4 ms |
19036 KB |
Output is correct |
56 |
Correct |
4 ms |
21084 KB |
Output is correct |
57 |
Correct |
3 ms |
19036 KB |
Output is correct |
58 |
Correct |
4 ms |
19036 KB |
Output is correct |
59 |
Correct |
4 ms |
19036 KB |
Output is correct |
60 |
Correct |
4 ms |
21084 KB |
Output is correct |
61 |
Correct |
4 ms |
21336 KB |
Output is correct |
62 |
Correct |
4 ms |
21084 KB |
Output is correct |
63 |
Correct |
3 ms |
17088 KB |
Output is correct |
64 |
Correct |
4 ms |
13000 KB |
Output is correct |
65 |
Correct |
2 ms |
6748 KB |
Output is correct |
66 |
Correct |
9 ms |
6748 KB |
Output is correct |
67 |
Correct |
12 ms |
19160 KB |
Output is correct |
68 |
Correct |
11 ms |
21052 KB |
Output is correct |
69 |
Correct |
12 ms |
29276 KB |
Output is correct |
70 |
Correct |
13 ms |
29272 KB |
Output is correct |
71 |
Correct |
20 ms |
97116 KB |
Output is correct |
72 |
Correct |
18 ms |
90972 KB |
Output is correct |
73 |
Correct |
18 ms |
86656 KB |
Output is correct |
74 |
Correct |
18 ms |
90972 KB |
Output is correct |
75 |
Correct |
20 ms |
95108 KB |
Output is correct |
76 |
Correct |
20 ms |
86740 KB |
Output is correct |
77 |
Correct |
21 ms |
95068 KB |
Output is correct |
78 |
Correct |
19 ms |
93020 KB |
Output is correct |
79 |
Correct |
21 ms |
90972 KB |
Output is correct |
80 |
Correct |
19 ms |
93052 KB |
Output is correct |
81 |
Correct |
19 ms |
76628 KB |
Output is correct |
82 |
Correct |
16 ms |
80728 KB |
Output is correct |
83 |
Correct |
10 ms |
21196 KB |
Output is correct |
84 |
Correct |
56 ms |
10844 KB |
Output is correct |
85 |
Correct |
66 ms |
54108 KB |
Output is correct |
86 |
Correct |
56 ms |
21292 KB |
Output is correct |
87 |
Correct |
59 ms |
29472 KB |
Output is correct |
88 |
Correct |
59 ms |
29276 KB |
Output is correct |
89 |
Correct |
381 ms |
568232 KB |
Output is correct |
90 |
Correct |
242 ms |
514384 KB |
Output is correct |
91 |
Correct |
350 ms |
565588 KB |
Output is correct |
92 |
Correct |
248 ms |
527188 KB |
Output is correct |
93 |
Correct |
261 ms |
532820 KB |
Output is correct |
94 |
Correct |
359 ms |
541008 KB |
Output is correct |
95 |
Correct |
387 ms |
554484 KB |
Output is correct |
96 |
Correct |
343 ms |
518480 KB |
Output is correct |
97 |
Correct |
320 ms |
553040 KB |
Output is correct |
98 |
Correct |
260 ms |
545272 KB |
Output is correct |
99 |
Correct |
286 ms |
568228 KB |
Output is correct |
100 |
Correct |
191 ms |
395088 KB |
Output is correct |
101 |
Correct |
74 ms |
97112 KB |
Output is correct |
102 |
Execution timed out |
1073 ms |
26196 KB |
Time limit exceeded |
103 |
Halted |
0 ms |
0 KB |
- |