#include "closing.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
using vi = vector<int>;
using ll = long long;
const int maxn = 5e5 + 10;
const ll inf = 1e18 + 100;
vector<pair<int,ll>> g[maxn];
vector<int> path;
bool inpath[maxn];
ll dis[maxn];
bool fpath(int x,int p,int t) {
if(x==t){
path.push_back(x);
return true;
}
for(auto [y,w] : g[x]) if(y!=p) {
dis[y] = dis[x] + w;
if(fpath(y,x,t)){
path.push_back(x);
return true;
}
}
return false;
}
bool vis[maxn];
int max_score(int n, int x, int y, long long k,
std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
// cerr << endl;
for(int i=0;i<n;i++) g[i].clear(),inpath[i]=vis[i]=dis[i]=0;
path.clear();
for(int i=0;i<U.size();i++){
g[U[i]].push_back({V[i],W[i]});
g[V[i]].push_back({U[i],W[i]});
}
// no overlap
int ans1 = [&](){
priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<pair<ll,int>>> pq;
pq.push({0,x});
pq.push({0,y});
ll sum = 0;
int ans = 0;
while(pq.size()){
auto [d,a] = pq.top();
pq.pop();
// cerr << ans << " " << sum << " " << k << " " << d << " " << vis[a] << endl;
if(vis[a])continue;
vis[a]=1;
if(sum+d>k){
return ans;
}
sum+=d;
ans++;
// cerr << ans << endl;
for(auto [b,w] : g[a]) {
pq.push({d+w,b});
}
}
return ans;
}();
// overlap (start with path)
int ans2 = [&](){
for(int i=0;i<n;i++)vis[i]=0;
fpath(x,x,y);
reverse(all(path));
for(int a : path)inpath[a]=1;
int ans = 0;
ll sum = 0;
const ll D = dis[y];
for(int a : path) {
ans++;
sum += min(dis[a],D-dis[a]);
}
if(sum > k) return 0;
struct State {
ll c1, c2;
int a;
ll pc1;
ll eval() const {return min(c1*2,c2); }
bool operator<(const State &o) const {return eval() > o.eval(); }
};
priority_queue<State>pq;
for(int a : path) {
pq.push({max(dis[a],D-dis[a])-min(dis[a],D-dis[a]), inf, a});
for(auto [b,w] : g[a]) if(!inpath[b]) {
pq.push({min(dis[a],D-dis[a])+w, max(dis[a],D-dis[a])+w, b});
}
vis[a]=1;
}
multiset<ll> sing;
while(pq.size()){
auto [c1,c2,a,pc1] = pq.top();
// cerr << c1 << " " << c2 << " " <<a << endl;
pq.pop();
vis[a]=1;
if(sum+c1<=k){
ans++;
sum+=c1;
}
else {
// cerr << "poor" << endl;
if(sing.size()==0)continue;
auto it = --sing.end();
// cerr << *it << endl;
if(sum-*it+c2<=k){
return ans+1;
}
continue;
}
sing.insert(c1);
if(c2>=inf){
if(!inpath[a]){
sing.erase(sing.find(pc1));
}
continue;
}
pq.push({c2-c1,inf,a,c1});
for(auto [b,w] : g[a]) if(!vis[b]) {
pq.push({c1+w,c2+w,b});
}
}
// cerr << "here " << k-sum << endl;
return ans;
}();
return max(ans1,ans2);
}
Compilation message
closing.cpp: In function 'int max_score(int, int, int, long long int, std::vector<int>, std::vector<int>, std::vector<int>)':
closing.cpp:37:62: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
37 | for(int i=0;i<n;i++) g[i].clear(),inpath[i]=vis[i]=dis[i]=0;
| ~~~~~~^~
closing.cpp:39:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
39 | for(int i=0;i<U.size();i++){
| ~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
14680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
79 ms |
35004 KB |
Output is correct |
2 |
Correct |
126 ms |
40356 KB |
Output is correct |
3 |
Correct |
54 ms |
17236 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
14684 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
3 ms |
14684 KB |
Output is correct |
4 |
Correct |
4 ms |
14680 KB |
Output is correct |
5 |
Correct |
3 ms |
14684 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
2 ms |
14684 KB |
Output is correct |
8 |
Correct |
3 ms |
14684 KB |
Output is correct |
9 |
Correct |
2 ms |
14684 KB |
Output is correct |
10 |
Correct |
4 ms |
14684 KB |
Output is correct |
11 |
Correct |
3 ms |
14776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
14684 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
3 ms |
14684 KB |
Output is correct |
4 |
Correct |
4 ms |
14680 KB |
Output is correct |
5 |
Correct |
3 ms |
14684 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
2 ms |
14684 KB |
Output is correct |
8 |
Correct |
3 ms |
14684 KB |
Output is correct |
9 |
Correct |
2 ms |
14684 KB |
Output is correct |
10 |
Correct |
4 ms |
14684 KB |
Output is correct |
11 |
Correct |
3 ms |
14776 KB |
Output is correct |
12 |
Correct |
3 ms |
14680 KB |
Output is correct |
13 |
Correct |
3 ms |
14680 KB |
Output is correct |
14 |
Correct |
3 ms |
14684 KB |
Output is correct |
15 |
Correct |
3 ms |
14936 KB |
Output is correct |
16 |
Correct |
3 ms |
14684 KB |
Output is correct |
17 |
Correct |
4 ms |
14684 KB |
Output is correct |
18 |
Correct |
3 ms |
14680 KB |
Output is correct |
19 |
Correct |
3 ms |
14684 KB |
Output is correct |
20 |
Correct |
3 ms |
14684 KB |
Output is correct |
21 |
Correct |
3 ms |
14940 KB |
Output is correct |
22 |
Correct |
3 ms |
14684 KB |
Output is correct |
23 |
Correct |
3 ms |
14680 KB |
Output is correct |
24 |
Correct |
4 ms |
14680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
14684 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
3 ms |
14684 KB |
Output is correct |
4 |
Correct |
4 ms |
14680 KB |
Output is correct |
5 |
Correct |
3 ms |
14684 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
2 ms |
14684 KB |
Output is correct |
8 |
Correct |
3 ms |
14684 KB |
Output is correct |
9 |
Correct |
2 ms |
14684 KB |
Output is correct |
10 |
Correct |
4 ms |
14684 KB |
Output is correct |
11 |
Correct |
3 ms |
14776 KB |
Output is correct |
12 |
Correct |
3 ms |
14680 KB |
Output is correct |
13 |
Correct |
3 ms |
14680 KB |
Output is correct |
14 |
Correct |
3 ms |
14684 KB |
Output is correct |
15 |
Correct |
3 ms |
14936 KB |
Output is correct |
16 |
Correct |
3 ms |
14684 KB |
Output is correct |
17 |
Correct |
4 ms |
14684 KB |
Output is correct |
18 |
Correct |
3 ms |
14680 KB |
Output is correct |
19 |
Correct |
3 ms |
14684 KB |
Output is correct |
20 |
Correct |
3 ms |
14684 KB |
Output is correct |
21 |
Correct |
3 ms |
14940 KB |
Output is correct |
22 |
Correct |
3 ms |
14684 KB |
Output is correct |
23 |
Correct |
3 ms |
14680 KB |
Output is correct |
24 |
Correct |
4 ms |
14680 KB |
Output is correct |
25 |
Correct |
4 ms |
14684 KB |
Output is correct |
26 |
Correct |
5 ms |
15192 KB |
Output is correct |
27 |
Correct |
4 ms |
14940 KB |
Output is correct |
28 |
Correct |
5 ms |
15448 KB |
Output is correct |
29 |
Correct |
7 ms |
15196 KB |
Output is correct |
30 |
Correct |
5 ms |
14940 KB |
Output is correct |
31 |
Correct |
4 ms |
15196 KB |
Output is correct |
32 |
Correct |
5 ms |
15196 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
14680 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
2 ms |
14684 KB |
Output is correct |
4 |
Correct |
3 ms |
14684 KB |
Output is correct |
5 |
Correct |
4 ms |
14680 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
3 ms |
14684 KB |
Output is correct |
8 |
Correct |
3 ms |
14684 KB |
Output is correct |
9 |
Correct |
3 ms |
14684 KB |
Output is correct |
10 |
Correct |
3 ms |
14840 KB |
Output is correct |
11 |
Correct |
3 ms |
14684 KB |
Output is correct |
12 |
Correct |
3 ms |
14684 KB |
Output is correct |
13 |
Correct |
3 ms |
14680 KB |
Output is correct |
14 |
Correct |
2 ms |
14684 KB |
Output is correct |
15 |
Correct |
2 ms |
14684 KB |
Output is correct |
16 |
Correct |
4 ms |
14684 KB |
Output is correct |
17 |
Correct |
3 ms |
14684 KB |
Output is correct |
18 |
Correct |
3 ms |
14684 KB |
Output is correct |
19 |
Correct |
3 ms |
14684 KB |
Output is correct |
20 |
Correct |
3 ms |
14684 KB |
Output is correct |
21 |
Correct |
3 ms |
14684 KB |
Output is correct |
22 |
Correct |
3 ms |
14684 KB |
Output is correct |
23 |
Correct |
4 ms |
14684 KB |
Output is correct |
24 |
Correct |
3 ms |
14680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
14680 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
2 ms |
14684 KB |
Output is correct |
4 |
Correct |
3 ms |
14684 KB |
Output is correct |
5 |
Correct |
4 ms |
14680 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
3 ms |
14684 KB |
Output is correct |
8 |
Correct |
2 ms |
14684 KB |
Output is correct |
9 |
Correct |
3 ms |
14684 KB |
Output is correct |
10 |
Correct |
2 ms |
14684 KB |
Output is correct |
11 |
Correct |
4 ms |
14684 KB |
Output is correct |
12 |
Correct |
3 ms |
14776 KB |
Output is correct |
13 |
Correct |
3 ms |
14680 KB |
Output is correct |
14 |
Correct |
3 ms |
14680 KB |
Output is correct |
15 |
Correct |
3 ms |
14684 KB |
Output is correct |
16 |
Correct |
3 ms |
14936 KB |
Output is correct |
17 |
Correct |
3 ms |
14684 KB |
Output is correct |
18 |
Correct |
4 ms |
14684 KB |
Output is correct |
19 |
Correct |
3 ms |
14684 KB |
Output is correct |
20 |
Correct |
3 ms |
14684 KB |
Output is correct |
21 |
Correct |
3 ms |
14684 KB |
Output is correct |
22 |
Correct |
3 ms |
14840 KB |
Output is correct |
23 |
Correct |
3 ms |
14684 KB |
Output is correct |
24 |
Correct |
3 ms |
14684 KB |
Output is correct |
25 |
Correct |
3 ms |
14680 KB |
Output is correct |
26 |
Correct |
2 ms |
14684 KB |
Output is correct |
27 |
Correct |
2 ms |
14684 KB |
Output is correct |
28 |
Correct |
4 ms |
14684 KB |
Output is correct |
29 |
Correct |
3 ms |
14684 KB |
Output is correct |
30 |
Correct |
3 ms |
14684 KB |
Output is correct |
31 |
Correct |
3 ms |
14684 KB |
Output is correct |
32 |
Correct |
3 ms |
14684 KB |
Output is correct |
33 |
Correct |
3 ms |
14684 KB |
Output is correct |
34 |
Correct |
3 ms |
14684 KB |
Output is correct |
35 |
Correct |
4 ms |
14684 KB |
Output is correct |
36 |
Correct |
3 ms |
14680 KB |
Output is correct |
37 |
Correct |
3 ms |
14684 KB |
Output is correct |
38 |
Correct |
3 ms |
14684 KB |
Output is correct |
39 |
Correct |
3 ms |
14684 KB |
Output is correct |
40 |
Correct |
3 ms |
14684 KB |
Output is correct |
41 |
Correct |
3 ms |
14752 KB |
Output is correct |
42 |
Correct |
3 ms |
14684 KB |
Output is correct |
43 |
Correct |
3 ms |
14684 KB |
Output is correct |
44 |
Correct |
3 ms |
14684 KB |
Output is correct |
45 |
Correct |
3 ms |
14684 KB |
Output is correct |
46 |
Correct |
3 ms |
14684 KB |
Output is correct |
47 |
Correct |
4 ms |
14684 KB |
Output is correct |
48 |
Correct |
4 ms |
14684 KB |
Output is correct |
49 |
Correct |
3 ms |
14860 KB |
Output is correct |
50 |
Correct |
3 ms |
14680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
14680 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
2 ms |
14684 KB |
Output is correct |
4 |
Correct |
3 ms |
14684 KB |
Output is correct |
5 |
Correct |
4 ms |
14680 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
3 ms |
14684 KB |
Output is correct |
8 |
Correct |
2 ms |
14684 KB |
Output is correct |
9 |
Correct |
3 ms |
14684 KB |
Output is correct |
10 |
Correct |
2 ms |
14684 KB |
Output is correct |
11 |
Correct |
4 ms |
14684 KB |
Output is correct |
12 |
Correct |
3 ms |
14776 KB |
Output is correct |
13 |
Correct |
3 ms |
14680 KB |
Output is correct |
14 |
Correct |
3 ms |
14680 KB |
Output is correct |
15 |
Correct |
3 ms |
14684 KB |
Output is correct |
16 |
Correct |
3 ms |
14936 KB |
Output is correct |
17 |
Correct |
3 ms |
14684 KB |
Output is correct |
18 |
Correct |
4 ms |
14684 KB |
Output is correct |
19 |
Correct |
3 ms |
14680 KB |
Output is correct |
20 |
Correct |
3 ms |
14684 KB |
Output is correct |
21 |
Correct |
3 ms |
14684 KB |
Output is correct |
22 |
Correct |
3 ms |
14940 KB |
Output is correct |
23 |
Correct |
3 ms |
14684 KB |
Output is correct |
24 |
Correct |
3 ms |
14680 KB |
Output is correct |
25 |
Correct |
4 ms |
14680 KB |
Output is correct |
26 |
Correct |
3 ms |
14684 KB |
Output is correct |
27 |
Correct |
3 ms |
14684 KB |
Output is correct |
28 |
Correct |
3 ms |
14684 KB |
Output is correct |
29 |
Correct |
3 ms |
14840 KB |
Output is correct |
30 |
Correct |
3 ms |
14684 KB |
Output is correct |
31 |
Correct |
3 ms |
14684 KB |
Output is correct |
32 |
Correct |
3 ms |
14680 KB |
Output is correct |
33 |
Correct |
2 ms |
14684 KB |
Output is correct |
34 |
Correct |
2 ms |
14684 KB |
Output is correct |
35 |
Correct |
4 ms |
14684 KB |
Output is correct |
36 |
Correct |
3 ms |
14684 KB |
Output is correct |
37 |
Correct |
3 ms |
14684 KB |
Output is correct |
38 |
Correct |
3 ms |
14684 KB |
Output is correct |
39 |
Correct |
3 ms |
14684 KB |
Output is correct |
40 |
Correct |
3 ms |
14684 KB |
Output is correct |
41 |
Correct |
3 ms |
14684 KB |
Output is correct |
42 |
Correct |
4 ms |
14684 KB |
Output is correct |
43 |
Correct |
3 ms |
14680 KB |
Output is correct |
44 |
Correct |
3 ms |
14684 KB |
Output is correct |
45 |
Correct |
3 ms |
14684 KB |
Output is correct |
46 |
Correct |
3 ms |
14684 KB |
Output is correct |
47 |
Correct |
3 ms |
14684 KB |
Output is correct |
48 |
Correct |
3 ms |
14752 KB |
Output is correct |
49 |
Correct |
3 ms |
14684 KB |
Output is correct |
50 |
Correct |
3 ms |
14684 KB |
Output is correct |
51 |
Correct |
3 ms |
14684 KB |
Output is correct |
52 |
Correct |
3 ms |
14684 KB |
Output is correct |
53 |
Correct |
3 ms |
14684 KB |
Output is correct |
54 |
Correct |
4 ms |
14684 KB |
Output is correct |
55 |
Correct |
4 ms |
14684 KB |
Output is correct |
56 |
Correct |
3 ms |
14860 KB |
Output is correct |
57 |
Correct |
3 ms |
14680 KB |
Output is correct |
58 |
Correct |
4 ms |
14684 KB |
Output is correct |
59 |
Correct |
4 ms |
14680 KB |
Output is correct |
60 |
Correct |
3 ms |
14684 KB |
Output is correct |
61 |
Correct |
3 ms |
14680 KB |
Output is correct |
62 |
Correct |
4 ms |
14684 KB |
Output is correct |
63 |
Correct |
4 ms |
14680 KB |
Output is correct |
64 |
Correct |
4 ms |
14684 KB |
Output is correct |
65 |
Correct |
3 ms |
14684 KB |
Output is correct |
66 |
Correct |
3 ms |
14684 KB |
Output is correct |
67 |
Correct |
3 ms |
14680 KB |
Output is correct |
68 |
Correct |
4 ms |
14940 KB |
Output is correct |
69 |
Correct |
4 ms |
14940 KB |
Output is correct |
70 |
Correct |
3 ms |
14860 KB |
Output is correct |
71 |
Correct |
4 ms |
14684 KB |
Output is correct |
72 |
Correct |
3 ms |
14684 KB |
Output is correct |
73 |
Correct |
4 ms |
14684 KB |
Output is correct |
74 |
Correct |
4 ms |
14792 KB |
Output is correct |
75 |
Correct |
4 ms |
14776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
14680 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
2 ms |
14684 KB |
Output is correct |
4 |
Correct |
3 ms |
14684 KB |
Output is correct |
5 |
Correct |
4 ms |
14680 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
3 ms |
14684 KB |
Output is correct |
8 |
Correct |
2 ms |
14684 KB |
Output is correct |
9 |
Correct |
3 ms |
14684 KB |
Output is correct |
10 |
Correct |
2 ms |
14684 KB |
Output is correct |
11 |
Correct |
4 ms |
14684 KB |
Output is correct |
12 |
Correct |
3 ms |
14776 KB |
Output is correct |
13 |
Correct |
3 ms |
14680 KB |
Output is correct |
14 |
Correct |
3 ms |
14680 KB |
Output is correct |
15 |
Correct |
3 ms |
14684 KB |
Output is correct |
16 |
Correct |
3 ms |
14936 KB |
Output is correct |
17 |
Correct |
3 ms |
14684 KB |
Output is correct |
18 |
Correct |
4 ms |
14684 KB |
Output is correct |
19 |
Correct |
3 ms |
14680 KB |
Output is correct |
20 |
Correct |
3 ms |
14684 KB |
Output is correct |
21 |
Correct |
3 ms |
14684 KB |
Output is correct |
22 |
Correct |
3 ms |
14940 KB |
Output is correct |
23 |
Correct |
3 ms |
14684 KB |
Output is correct |
24 |
Correct |
3 ms |
14680 KB |
Output is correct |
25 |
Correct |
4 ms |
14680 KB |
Output is correct |
26 |
Correct |
4 ms |
14684 KB |
Output is correct |
27 |
Correct |
5 ms |
15192 KB |
Output is correct |
28 |
Correct |
4 ms |
14940 KB |
Output is correct |
29 |
Correct |
5 ms |
15448 KB |
Output is correct |
30 |
Correct |
7 ms |
15196 KB |
Output is correct |
31 |
Correct |
5 ms |
14940 KB |
Output is correct |
32 |
Correct |
4 ms |
15196 KB |
Output is correct |
33 |
Correct |
5 ms |
15196 KB |
Output is correct |
34 |
Correct |
3 ms |
14684 KB |
Output is correct |
35 |
Correct |
3 ms |
14684 KB |
Output is correct |
36 |
Correct |
3 ms |
14684 KB |
Output is correct |
37 |
Correct |
3 ms |
14840 KB |
Output is correct |
38 |
Correct |
3 ms |
14684 KB |
Output is correct |
39 |
Correct |
3 ms |
14684 KB |
Output is correct |
40 |
Correct |
3 ms |
14680 KB |
Output is correct |
41 |
Correct |
2 ms |
14684 KB |
Output is correct |
42 |
Correct |
2 ms |
14684 KB |
Output is correct |
43 |
Correct |
4 ms |
14684 KB |
Output is correct |
44 |
Correct |
3 ms |
14684 KB |
Output is correct |
45 |
Correct |
3 ms |
14684 KB |
Output is correct |
46 |
Correct |
3 ms |
14684 KB |
Output is correct |
47 |
Correct |
3 ms |
14684 KB |
Output is correct |
48 |
Correct |
3 ms |
14684 KB |
Output is correct |
49 |
Correct |
3 ms |
14684 KB |
Output is correct |
50 |
Correct |
4 ms |
14684 KB |
Output is correct |
51 |
Correct |
3 ms |
14680 KB |
Output is correct |
52 |
Correct |
3 ms |
14684 KB |
Output is correct |
53 |
Correct |
3 ms |
14684 KB |
Output is correct |
54 |
Correct |
3 ms |
14684 KB |
Output is correct |
55 |
Correct |
3 ms |
14684 KB |
Output is correct |
56 |
Correct |
3 ms |
14752 KB |
Output is correct |
57 |
Correct |
3 ms |
14684 KB |
Output is correct |
58 |
Correct |
3 ms |
14684 KB |
Output is correct |
59 |
Correct |
3 ms |
14684 KB |
Output is correct |
60 |
Correct |
3 ms |
14684 KB |
Output is correct |
61 |
Correct |
3 ms |
14684 KB |
Output is correct |
62 |
Correct |
4 ms |
14684 KB |
Output is correct |
63 |
Correct |
4 ms |
14684 KB |
Output is correct |
64 |
Correct |
3 ms |
14860 KB |
Output is correct |
65 |
Correct |
3 ms |
14680 KB |
Output is correct |
66 |
Correct |
4 ms |
14684 KB |
Output is correct |
67 |
Correct |
4 ms |
14680 KB |
Output is correct |
68 |
Correct |
3 ms |
14684 KB |
Output is correct |
69 |
Correct |
3 ms |
14680 KB |
Output is correct |
70 |
Correct |
4 ms |
14684 KB |
Output is correct |
71 |
Correct |
4 ms |
14680 KB |
Output is correct |
72 |
Correct |
4 ms |
14684 KB |
Output is correct |
73 |
Correct |
3 ms |
14684 KB |
Output is correct |
74 |
Correct |
3 ms |
14684 KB |
Output is correct |
75 |
Correct |
3 ms |
14680 KB |
Output is correct |
76 |
Correct |
4 ms |
14940 KB |
Output is correct |
77 |
Correct |
4 ms |
14940 KB |
Output is correct |
78 |
Correct |
3 ms |
14860 KB |
Output is correct |
79 |
Correct |
4 ms |
14684 KB |
Output is correct |
80 |
Correct |
3 ms |
14684 KB |
Output is correct |
81 |
Correct |
4 ms |
14684 KB |
Output is correct |
82 |
Correct |
4 ms |
14792 KB |
Output is correct |
83 |
Correct |
4 ms |
14776 KB |
Output is correct |
84 |
Correct |
4 ms |
14940 KB |
Output is correct |
85 |
Correct |
4 ms |
14940 KB |
Output is correct |
86 |
Correct |
5 ms |
14860 KB |
Output is correct |
87 |
Correct |
5 ms |
14936 KB |
Output is correct |
88 |
Correct |
5 ms |
14940 KB |
Output is correct |
89 |
Correct |
5 ms |
15448 KB |
Output is correct |
90 |
Correct |
6 ms |
15196 KB |
Output is correct |
91 |
Correct |
4 ms |
14940 KB |
Output is correct |
92 |
Correct |
4 ms |
14940 KB |
Output is correct |
93 |
Correct |
4 ms |
14940 KB |
Output is correct |
94 |
Correct |
4 ms |
15704 KB |
Output is correct |
95 |
Correct |
5 ms |
15412 KB |
Output is correct |
96 |
Correct |
5 ms |
15184 KB |
Output is correct |
97 |
Correct |
5 ms |
15196 KB |
Output is correct |
98 |
Correct |
5 ms |
14940 KB |
Output is correct |
99 |
Correct |
6 ms |
15196 KB |
Output is correct |
100 |
Correct |
4 ms |
14940 KB |
Output is correct |
101 |
Correct |
5 ms |
14860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
14680 KB |
Output is correct |
2 |
Correct |
2 ms |
14684 KB |
Output is correct |
3 |
Correct |
2 ms |
14684 KB |
Output is correct |
4 |
Correct |
3 ms |
14684 KB |
Output is correct |
5 |
Correct |
4 ms |
14680 KB |
Output is correct |
6 |
Correct |
3 ms |
14684 KB |
Output is correct |
7 |
Correct |
3 ms |
14684 KB |
Output is correct |
8 |
Correct |
2 ms |
14684 KB |
Output is correct |
9 |
Correct |
3 ms |
14684 KB |
Output is correct |
10 |
Correct |
2 ms |
14684 KB |
Output is correct |
11 |
Correct |
4 ms |
14684 KB |
Output is correct |
12 |
Correct |
3 ms |
14776 KB |
Output is correct |
13 |
Correct |
3 ms |
14680 KB |
Output is correct |
14 |
Correct |
3 ms |
14680 KB |
Output is correct |
15 |
Correct |
3 ms |
14684 KB |
Output is correct |
16 |
Correct |
3 ms |
14936 KB |
Output is correct |
17 |
Correct |
3 ms |
14684 KB |
Output is correct |
18 |
Correct |
4 ms |
14684 KB |
Output is correct |
19 |
Correct |
3 ms |
14680 KB |
Output is correct |
20 |
Correct |
3 ms |
14684 KB |
Output is correct |
21 |
Correct |
3 ms |
14684 KB |
Output is correct |
22 |
Correct |
3 ms |
14940 KB |
Output is correct |
23 |
Correct |
3 ms |
14684 KB |
Output is correct |
24 |
Correct |
3 ms |
14680 KB |
Output is correct |
25 |
Correct |
4 ms |
14680 KB |
Output is correct |
26 |
Correct |
4 ms |
14684 KB |
Output is correct |
27 |
Correct |
5 ms |
15192 KB |
Output is correct |
28 |
Correct |
4 ms |
14940 KB |
Output is correct |
29 |
Correct |
5 ms |
15448 KB |
Output is correct |
30 |
Correct |
7 ms |
15196 KB |
Output is correct |
31 |
Correct |
5 ms |
14940 KB |
Output is correct |
32 |
Correct |
4 ms |
15196 KB |
Output is correct |
33 |
Correct |
5 ms |
15196 KB |
Output is correct |
34 |
Correct |
3 ms |
14684 KB |
Output is correct |
35 |
Correct |
3 ms |
14684 KB |
Output is correct |
36 |
Correct |
3 ms |
14684 KB |
Output is correct |
37 |
Correct |
3 ms |
14840 KB |
Output is correct |
38 |
Correct |
3 ms |
14684 KB |
Output is correct |
39 |
Correct |
3 ms |
14684 KB |
Output is correct |
40 |
Correct |
3 ms |
14680 KB |
Output is correct |
41 |
Correct |
2 ms |
14684 KB |
Output is correct |
42 |
Correct |
2 ms |
14684 KB |
Output is correct |
43 |
Correct |
4 ms |
14684 KB |
Output is correct |
44 |
Correct |
3 ms |
14684 KB |
Output is correct |
45 |
Correct |
3 ms |
14684 KB |
Output is correct |
46 |
Correct |
3 ms |
14684 KB |
Output is correct |
47 |
Correct |
3 ms |
14684 KB |
Output is correct |
48 |
Correct |
3 ms |
14684 KB |
Output is correct |
49 |
Correct |
3 ms |
14684 KB |
Output is correct |
50 |
Correct |
4 ms |
14684 KB |
Output is correct |
51 |
Correct |
3 ms |
14680 KB |
Output is correct |
52 |
Correct |
3 ms |
14684 KB |
Output is correct |
53 |
Correct |
3 ms |
14684 KB |
Output is correct |
54 |
Correct |
3 ms |
14684 KB |
Output is correct |
55 |
Correct |
3 ms |
14684 KB |
Output is correct |
56 |
Correct |
3 ms |
14752 KB |
Output is correct |
57 |
Correct |
3 ms |
14684 KB |
Output is correct |
58 |
Correct |
3 ms |
14684 KB |
Output is correct |
59 |
Correct |
3 ms |
14684 KB |
Output is correct |
60 |
Correct |
3 ms |
14684 KB |
Output is correct |
61 |
Correct |
3 ms |
14684 KB |
Output is correct |
62 |
Correct |
4 ms |
14684 KB |
Output is correct |
63 |
Correct |
4 ms |
14684 KB |
Output is correct |
64 |
Correct |
3 ms |
14860 KB |
Output is correct |
65 |
Correct |
3 ms |
14680 KB |
Output is correct |
66 |
Correct |
4 ms |
14684 KB |
Output is correct |
67 |
Correct |
4 ms |
14680 KB |
Output is correct |
68 |
Correct |
3 ms |
14684 KB |
Output is correct |
69 |
Correct |
3 ms |
14680 KB |
Output is correct |
70 |
Correct |
4 ms |
14684 KB |
Output is correct |
71 |
Correct |
4 ms |
14680 KB |
Output is correct |
72 |
Correct |
4 ms |
14684 KB |
Output is correct |
73 |
Correct |
3 ms |
14684 KB |
Output is correct |
74 |
Correct |
3 ms |
14684 KB |
Output is correct |
75 |
Correct |
3 ms |
14680 KB |
Output is correct |
76 |
Correct |
4 ms |
14940 KB |
Output is correct |
77 |
Correct |
4 ms |
14940 KB |
Output is correct |
78 |
Correct |
3 ms |
14860 KB |
Output is correct |
79 |
Correct |
4 ms |
14684 KB |
Output is correct |
80 |
Correct |
3 ms |
14684 KB |
Output is correct |
81 |
Correct |
4 ms |
14684 KB |
Output is correct |
82 |
Correct |
4 ms |
14792 KB |
Output is correct |
83 |
Correct |
4 ms |
14776 KB |
Output is correct |
84 |
Correct |
4 ms |
14940 KB |
Output is correct |
85 |
Correct |
4 ms |
14940 KB |
Output is correct |
86 |
Correct |
5 ms |
14860 KB |
Output is correct |
87 |
Correct |
5 ms |
14936 KB |
Output is correct |
88 |
Correct |
5 ms |
14940 KB |
Output is correct |
89 |
Correct |
5 ms |
15448 KB |
Output is correct |
90 |
Correct |
6 ms |
15196 KB |
Output is correct |
91 |
Correct |
4 ms |
14940 KB |
Output is correct |
92 |
Correct |
4 ms |
14940 KB |
Output is correct |
93 |
Correct |
4 ms |
14940 KB |
Output is correct |
94 |
Correct |
4 ms |
15704 KB |
Output is correct |
95 |
Correct |
5 ms |
15412 KB |
Output is correct |
96 |
Correct |
5 ms |
15184 KB |
Output is correct |
97 |
Correct |
5 ms |
15196 KB |
Output is correct |
98 |
Correct |
5 ms |
14940 KB |
Output is correct |
99 |
Correct |
6 ms |
15196 KB |
Output is correct |
100 |
Correct |
4 ms |
14940 KB |
Output is correct |
101 |
Correct |
5 ms |
14860 KB |
Output is correct |
102 |
Correct |
112 ms |
18520 KB |
Output is correct |
103 |
Correct |
133 ms |
18356 KB |
Output is correct |
104 |
Correct |
259 ms |
54668 KB |
Output is correct |
105 |
Correct |
77 ms |
20084 KB |
Output is correct |
106 |
Correct |
99 ms |
20288 KB |
Output is correct |
107 |
Correct |
186 ms |
44304 KB |
Output is correct |
108 |
Correct |
190 ms |
45976 KB |
Output is correct |
109 |
Correct |
63 ms |
40124 KB |
Output is correct |
110 |
Correct |
220 ms |
39252 KB |
Output is correct |
111 |
Correct |
141 ms |
45236 KB |
Output is correct |
112 |
Correct |
96 ms |
33620 KB |
Output is correct |
113 |
Correct |
88 ms |
33252 KB |
Output is correct |
114 |
Correct |
80 ms |
34980 KB |
Output is correct |
115 |
Correct |
152 ms |
60172 KB |
Output is correct |
116 |
Correct |
121 ms |
39636 KB |
Output is correct |
117 |
Correct |
114 ms |
38548 KB |
Output is correct |
118 |
Correct |
154 ms |
37244 KB |
Output is correct |
119 |
Correct |
160 ms |
23944 KB |
Output is correct |
120 |
Correct |
92 ms |
19556 KB |
Output is correct |