#include <bits/stdc++.h>
#include "closing.h"
using namespace std;
#define pb push_back
#define st first
#define nd second
typedef long long ll;
typedef long double ld;
const ll I = 2LL * 1000LL * 1000LL * 1000LL * 1000LL * 1000LL * 1000LL;
const int II = 2 * 1000 * 1000 * 1000;
const ll M = 1000LL * 1000LL * 1000LL + 7LL;
const int N = 1<<18;
ll dis[2][N];
ll tab[N][2];
int cnt[N];
bool vis[2][N], czy[N];
vector<pair<int, ll>> ed[N];
vector<int> pth;
inline void Clean(int n)
{
for(int i = 0; i < n; ++i)
{
cnt[i] = 0;
ed[i].clear();
vis[0][i] = false; vis[1][i] = false;
czy[i] = false;
}
}
void DFSD(int v, int r)
{
for(int i = 0; i < (int)ed[v].size(); ++i)
{
if(dis[r][ed[v][i].st] <= dis[r][v]) continue;
dis[r][ed[v][i].st] = dis[r][v] + ed[v][i].nd;
DFSD(ed[v][i].st, r);
}
}
bool DFSP(int v, int tar, int o)
{
if(v == tar)
{
pth.pb(v); return true;
}
for(int i = 0; i < (int)ed[v].size(); ++i)
{
if(ed[v][i].st == o) continue;
if(DFSP(ed[v][i].st, tar, v))
{
pth.pb(v); return true;
}
}
return false;
}
int Norm(int n, int x, int y, ll k)
{
//cerr << "Norm: \n";
pth.clear();
int v, r, ans = 0;
priority_queue<pair<ll, pair<int, int>>> q;
q.push(make_pair(0, make_pair(x, 0)));
q.push(make_pair(0, make_pair(y, 1)));
//cerr << x << " " << y << "\n";
while((int)q.size() > 0 && -q.top().st <= k)
{
++ans;
ll xd = q.top().st;
v = q.top().nd.st; r = q.top().nd.nd;
q.pop();
if(vis[r][v]) continue;
k += xd;
//cerr << v << " " << r << " " << dis[r][v] << "\n";
vis[r][v] = true;
//if(!vis[r ^ 1][v] && chk[r ^ 1][v]) q.push(make_pair(dis[r][v] - dis[r ^ 1][v], make_pair(v, r ^ 1)));
for(int i = 0; i < (int)ed[v].size(); ++i)
{
if(vis[r][ed[v][i].st]) continue;
//chk[r][ed[v][i].st] = true;
q.push(make_pair(-dis[r][ed[v][i].st], make_pair(ed[v][i].st, r)));
}
}
for(int i = 0; i < n; ++i)
{
czy[i] = false;
vis[0][i] = false; vis[1][i] = false;
}
return ans;
}
int PthA(int n, int x, int y, ll k)
{
//cerr << "Pth\n";
int ans, v;
ll val;
priority_queue<pair<ll, int>> q1, q2;
DFSP(x, y, 0);
for(int i = 0; i < n; ++i)
{
tab[i][0] = min(dis[0][i], dis[1][i]);
tab[i][1] = max(dis[0][i], dis[1][i]) - tab[i][0];
}
for(int i = 0; i < (int)pth.size(); ++i)
{
czy[pth[i]] = true;
k -= min(dis[0][pth[i]], dis[1][pth[i]]);
++cnt[pth[i]];
}
if(k < 0LL) return 0;
ans = pth.size();
for(int i = 0; i < n; ++i)
{
if(cnt[i] == 0)
q2.push(make_pair(-tab[i][0] - tab[i][1], i));
q1.push(make_pair(-tab[i][cnt[i]], i));
}
ll cst = I;
while(k > 0 && (int)q1.size() > 0)
{
v = q1.top().nd;
val = -q1.top().st;
q1.pop();
while((int)q1.size() > 0 && cnt[q1.top().nd] > 1) q1.pop();
if((int)q1.size() == 0 || (int)q2.size() == 0 || -q2.top().st > k || -q1.top().st + val <= -q2.top().st)
{
if(val > k) break;
if((int)q2.size() > 0) cst = -q2.top().st - val;
k -= val; ++ans;
++cnt[v];
if(cnt[v] < 2) q1.push(make_pair(-tab[v][1], v));
}else
{
cst = I;
q1.push(make_pair(-val, v));
v = q2.top().nd; val = -q2.top().st;
q2.pop();
cnt[v] = 2;
ans += 2;
k -= val;
}
while((int)q1.size() > 0 && cnt[q1.top().nd] > 1) q1.pop();
while((int)q2.size() > 0 && cnt[q2.top().nd] > 0) q2.pop();
//if((int)q1.size() > 0 && -q1.top().st > k) break;
}
ll m1 = 0LL, m2 = I;
for(int i = 0; i < n; ++i)
{
if(cnt[i] == 0) m2 = min(m2, tab[i][0] + tab[i][1]);
if(cnt[i] > 1 || (cnt[i] > 0 && !czy[i])) m1 = max(m1, tab[i][cnt[i] - 1]);
}
cst = m2 - m1;
if(cst <= k) ++ans;
return ans;
}
int max_score(int N, int X, int Y, long long K, vector<int> U, vector<int> V, vector<int> W)
{
int n = N, u = X, v = Y, answer;
//cerr << "xd " << X << " " << Y << "\n";
for(int i = 0; i < n - 1; ++i)
{
ed[U[i]].pb(make_pair(V[i], W[i]));
ed[V[i]].pb(make_pair(U[i], W[i]));
}
for(int j = 0; j < 2; ++j)
for(int i = 0; i < n; ++i)
dis[j][i] = I;
dis[0][u] = 0LL; dis[1][v] = 0LL;
DFSD(u, 0); DFSD(v, 1);
//cerr << "xd\n";
answer = Norm(n, u, v, K);
answer = max(answer, PthA(n, u, v, K));
Clean(n);
return answer;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
77 ms |
35252 KB |
Output is correct |
2 |
Correct |
88 ms |
40452 KB |
Output is correct |
3 |
Correct |
42 ms |
13404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
1 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
1 ms |
10844 KB |
Output is correct |
8 |
Correct |
1 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10844 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
1 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
1 ms |
10844 KB |
Output is correct |
8 |
Correct |
1 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 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 |
10840 KB |
Output is correct |
13 |
Correct |
1 ms |
10844 KB |
Output is correct |
14 |
Correct |
2 ms |
10844 KB |
Output is correct |
15 |
Correct |
2 ms |
10844 KB |
Output is correct |
16 |
Correct |
2 ms |
10844 KB |
Output is correct |
17 |
Correct |
1 ms |
10844 KB |
Output is correct |
18 |
Correct |
2 ms |
10844 KB |
Output is correct |
19 |
Correct |
2 ms |
10844 KB |
Output is correct |
20 |
Correct |
2 ms |
10844 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
2 ms |
10844 KB |
Output is correct |
23 |
Correct |
1 ms |
10844 KB |
Output is correct |
24 |
Correct |
2 ms |
10844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
1 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
1 ms |
10844 KB |
Output is correct |
8 |
Correct |
1 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 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 |
10840 KB |
Output is correct |
13 |
Correct |
1 ms |
10844 KB |
Output is correct |
14 |
Correct |
2 ms |
10844 KB |
Output is correct |
15 |
Correct |
2 ms |
10844 KB |
Output is correct |
16 |
Correct |
2 ms |
10844 KB |
Output is correct |
17 |
Correct |
1 ms |
10844 KB |
Output is correct |
18 |
Correct |
2 ms |
10844 KB |
Output is correct |
19 |
Correct |
2 ms |
10844 KB |
Output is correct |
20 |
Correct |
2 ms |
10844 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
2 ms |
10844 KB |
Output is correct |
23 |
Correct |
1 ms |
10844 KB |
Output is correct |
24 |
Correct |
2 ms |
10844 KB |
Output is correct |
25 |
Correct |
3 ms |
10844 KB |
Output is correct |
26 |
Correct |
4 ms |
11356 KB |
Output is correct |
27 |
Correct |
2 ms |
11356 KB |
Output is correct |
28 |
Correct |
3 ms |
11356 KB |
Output is correct |
29 |
Correct |
3 ms |
11352 KB |
Output is correct |
30 |
Correct |
3 ms |
11100 KB |
Output is correct |
31 |
Correct |
3 ms |
11348 KB |
Output is correct |
32 |
Correct |
3 ms |
11356 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
2 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
2 ms |
10844 KB |
Output is correct |
8 |
Correct |
2 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 ms |
10844 KB |
Output is correct |
10 |
Correct |
2 ms |
10864 KB |
Output is correct |
11 |
Correct |
2 ms |
10844 KB |
Output is correct |
12 |
Correct |
2 ms |
10844 KB |
Output is correct |
13 |
Correct |
2 ms |
10840 KB |
Output is correct |
14 |
Correct |
2 ms |
10840 KB |
Output is correct |
15 |
Correct |
2 ms |
10844 KB |
Output is correct |
16 |
Correct |
2 ms |
10844 KB |
Output is correct |
17 |
Correct |
2 ms |
10844 KB |
Output is correct |
18 |
Correct |
2 ms |
10844 KB |
Output is correct |
19 |
Correct |
2 ms |
10840 KB |
Output is correct |
20 |
Correct |
2 ms |
10844 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
2 ms |
10844 KB |
Output is correct |
23 |
Correct |
2 ms |
10844 KB |
Output is correct |
24 |
Correct |
1 ms |
10844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
2 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
1 ms |
10844 KB |
Output is correct |
8 |
Correct |
1 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 ms |
10844 KB |
Output is correct |
10 |
Correct |
1 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 |
2 ms |
10840 KB |
Output is correct |
14 |
Correct |
1 ms |
10844 KB |
Output is correct |
15 |
Correct |
2 ms |
10844 KB |
Output is correct |
16 |
Correct |
2 ms |
10844 KB |
Output is correct |
17 |
Correct |
2 ms |
10844 KB |
Output is correct |
18 |
Correct |
1 ms |
10844 KB |
Output is correct |
19 |
Correct |
2 ms |
10844 KB |
Output is correct |
20 |
Correct |
2 ms |
10844 KB |
Output is correct |
21 |
Correct |
1 ms |
10844 KB |
Output is correct |
22 |
Correct |
2 ms |
10864 KB |
Output is correct |
23 |
Correct |
2 ms |
10844 KB |
Output is correct |
24 |
Correct |
2 ms |
10844 KB |
Output is correct |
25 |
Correct |
2 ms |
10840 KB |
Output is correct |
26 |
Correct |
2 ms |
10840 KB |
Output is correct |
27 |
Correct |
2 ms |
10844 KB |
Output is correct |
28 |
Correct |
2 ms |
10844 KB |
Output is correct |
29 |
Correct |
2 ms |
10844 KB |
Output is correct |
30 |
Correct |
2 ms |
10844 KB |
Output is correct |
31 |
Correct |
2 ms |
10840 KB |
Output is correct |
32 |
Correct |
2 ms |
10844 KB |
Output is correct |
33 |
Correct |
2 ms |
10844 KB |
Output is correct |
34 |
Correct |
2 ms |
10844 KB |
Output is correct |
35 |
Correct |
2 ms |
10844 KB |
Output is correct |
36 |
Correct |
1 ms |
10844 KB |
Output is correct |
37 |
Correct |
2 ms |
10840 KB |
Output is correct |
38 |
Correct |
1 ms |
10844 KB |
Output is correct |
39 |
Correct |
2 ms |
10844 KB |
Output is correct |
40 |
Correct |
2 ms |
10844 KB |
Output is correct |
41 |
Correct |
3 ms |
10844 KB |
Output is correct |
42 |
Correct |
2 ms |
10844 KB |
Output is correct |
43 |
Correct |
1 ms |
10844 KB |
Output is correct |
44 |
Correct |
2 ms |
10844 KB |
Output is correct |
45 |
Correct |
2 ms |
10844 KB |
Output is correct |
46 |
Correct |
2 ms |
10844 KB |
Output is correct |
47 |
Correct |
1 ms |
10844 KB |
Output is correct |
48 |
Correct |
2 ms |
10844 KB |
Output is correct |
49 |
Correct |
2 ms |
10844 KB |
Output is correct |
50 |
Correct |
2 ms |
10844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
2 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
1 ms |
10844 KB |
Output is correct |
8 |
Correct |
1 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 ms |
10844 KB |
Output is correct |
10 |
Correct |
1 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 |
2 ms |
10840 KB |
Output is correct |
14 |
Correct |
1 ms |
10844 KB |
Output is correct |
15 |
Correct |
2 ms |
10844 KB |
Output is correct |
16 |
Correct |
2 ms |
10844 KB |
Output is correct |
17 |
Correct |
2 ms |
10844 KB |
Output is correct |
18 |
Correct |
1 ms |
10844 KB |
Output is correct |
19 |
Correct |
2 ms |
10844 KB |
Output is correct |
20 |
Correct |
2 ms |
10844 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
2 ms |
10844 KB |
Output is correct |
23 |
Correct |
2 ms |
10844 KB |
Output is correct |
24 |
Correct |
1 ms |
10844 KB |
Output is correct |
25 |
Correct |
2 ms |
10844 KB |
Output is correct |
26 |
Correct |
2 ms |
10844 KB |
Output is correct |
27 |
Correct |
2 ms |
10844 KB |
Output is correct |
28 |
Correct |
1 ms |
10844 KB |
Output is correct |
29 |
Correct |
2 ms |
10864 KB |
Output is correct |
30 |
Correct |
2 ms |
10844 KB |
Output is correct |
31 |
Correct |
2 ms |
10844 KB |
Output is correct |
32 |
Correct |
2 ms |
10840 KB |
Output is correct |
33 |
Correct |
2 ms |
10840 KB |
Output is correct |
34 |
Correct |
2 ms |
10844 KB |
Output is correct |
35 |
Correct |
2 ms |
10844 KB |
Output is correct |
36 |
Correct |
2 ms |
10844 KB |
Output is correct |
37 |
Correct |
2 ms |
10844 KB |
Output is correct |
38 |
Correct |
2 ms |
10840 KB |
Output is correct |
39 |
Correct |
2 ms |
10844 KB |
Output is correct |
40 |
Correct |
2 ms |
10844 KB |
Output is correct |
41 |
Correct |
2 ms |
10844 KB |
Output is correct |
42 |
Correct |
2 ms |
10844 KB |
Output is correct |
43 |
Correct |
1 ms |
10844 KB |
Output is correct |
44 |
Correct |
2 ms |
10840 KB |
Output is correct |
45 |
Correct |
1 ms |
10844 KB |
Output is correct |
46 |
Correct |
2 ms |
10844 KB |
Output is correct |
47 |
Correct |
2 ms |
10844 KB |
Output is correct |
48 |
Correct |
3 ms |
10844 KB |
Output is correct |
49 |
Correct |
2 ms |
10844 KB |
Output is correct |
50 |
Correct |
1 ms |
10844 KB |
Output is correct |
51 |
Correct |
2 ms |
10844 KB |
Output is correct |
52 |
Correct |
2 ms |
10844 KB |
Output is correct |
53 |
Correct |
2 ms |
10844 KB |
Output is correct |
54 |
Correct |
1 ms |
10844 KB |
Output is correct |
55 |
Correct |
2 ms |
10844 KB |
Output is correct |
56 |
Correct |
2 ms |
10844 KB |
Output is correct |
57 |
Correct |
2 ms |
10844 KB |
Output is correct |
58 |
Correct |
2 ms |
10844 KB |
Output is correct |
59 |
Correct |
2 ms |
10844 KB |
Output is correct |
60 |
Correct |
2 ms |
10844 KB |
Output is correct |
61 |
Correct |
2 ms |
10912 KB |
Output is correct |
62 |
Correct |
2 ms |
10840 KB |
Output is correct |
63 |
Correct |
2 ms |
10844 KB |
Output is correct |
64 |
Correct |
2 ms |
10844 KB |
Output is correct |
65 |
Correct |
2 ms |
10844 KB |
Output is correct |
66 |
Correct |
2 ms |
10844 KB |
Output is correct |
67 |
Correct |
2 ms |
10844 KB |
Output is correct |
68 |
Correct |
2 ms |
10840 KB |
Output is correct |
69 |
Correct |
2 ms |
10844 KB |
Output is correct |
70 |
Correct |
2 ms |
10844 KB |
Output is correct |
71 |
Correct |
2 ms |
10844 KB |
Output is correct |
72 |
Correct |
2 ms |
10828 KB |
Output is correct |
73 |
Correct |
2 ms |
10856 KB |
Output is correct |
74 |
Correct |
2 ms |
10844 KB |
Output is correct |
75 |
Correct |
2 ms |
10844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
2 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
1 ms |
10844 KB |
Output is correct |
8 |
Correct |
1 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 ms |
10844 KB |
Output is correct |
10 |
Correct |
1 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 |
2 ms |
10840 KB |
Output is correct |
14 |
Correct |
1 ms |
10844 KB |
Output is correct |
15 |
Correct |
2 ms |
10844 KB |
Output is correct |
16 |
Correct |
2 ms |
10844 KB |
Output is correct |
17 |
Correct |
2 ms |
10844 KB |
Output is correct |
18 |
Correct |
1 ms |
10844 KB |
Output is correct |
19 |
Correct |
2 ms |
10844 KB |
Output is correct |
20 |
Correct |
2 ms |
10844 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
2 ms |
10844 KB |
Output is correct |
23 |
Correct |
2 ms |
10844 KB |
Output is correct |
24 |
Correct |
1 ms |
10844 KB |
Output is correct |
25 |
Correct |
2 ms |
10844 KB |
Output is correct |
26 |
Correct |
3 ms |
10844 KB |
Output is correct |
27 |
Correct |
4 ms |
11356 KB |
Output is correct |
28 |
Correct |
2 ms |
11356 KB |
Output is correct |
29 |
Correct |
3 ms |
11356 KB |
Output is correct |
30 |
Correct |
3 ms |
11352 KB |
Output is correct |
31 |
Correct |
3 ms |
11100 KB |
Output is correct |
32 |
Correct |
3 ms |
11348 KB |
Output is correct |
33 |
Correct |
3 ms |
11356 KB |
Output is correct |
34 |
Correct |
2 ms |
10844 KB |
Output is correct |
35 |
Correct |
2 ms |
10844 KB |
Output is correct |
36 |
Correct |
1 ms |
10844 KB |
Output is correct |
37 |
Correct |
2 ms |
10864 KB |
Output is correct |
38 |
Correct |
2 ms |
10844 KB |
Output is correct |
39 |
Correct |
2 ms |
10844 KB |
Output is correct |
40 |
Correct |
2 ms |
10840 KB |
Output is correct |
41 |
Correct |
2 ms |
10840 KB |
Output is correct |
42 |
Correct |
2 ms |
10844 KB |
Output is correct |
43 |
Correct |
2 ms |
10844 KB |
Output is correct |
44 |
Correct |
2 ms |
10844 KB |
Output is correct |
45 |
Correct |
2 ms |
10844 KB |
Output is correct |
46 |
Correct |
2 ms |
10840 KB |
Output is correct |
47 |
Correct |
2 ms |
10844 KB |
Output is correct |
48 |
Correct |
2 ms |
10844 KB |
Output is correct |
49 |
Correct |
2 ms |
10844 KB |
Output is correct |
50 |
Correct |
2 ms |
10844 KB |
Output is correct |
51 |
Correct |
1 ms |
10844 KB |
Output is correct |
52 |
Correct |
2 ms |
10840 KB |
Output is correct |
53 |
Correct |
1 ms |
10844 KB |
Output is correct |
54 |
Correct |
2 ms |
10844 KB |
Output is correct |
55 |
Correct |
2 ms |
10844 KB |
Output is correct |
56 |
Correct |
3 ms |
10844 KB |
Output is correct |
57 |
Correct |
2 ms |
10844 KB |
Output is correct |
58 |
Correct |
1 ms |
10844 KB |
Output is correct |
59 |
Correct |
2 ms |
10844 KB |
Output is correct |
60 |
Correct |
2 ms |
10844 KB |
Output is correct |
61 |
Correct |
2 ms |
10844 KB |
Output is correct |
62 |
Correct |
1 ms |
10844 KB |
Output is correct |
63 |
Correct |
2 ms |
10844 KB |
Output is correct |
64 |
Correct |
2 ms |
10844 KB |
Output is correct |
65 |
Correct |
2 ms |
10844 KB |
Output is correct |
66 |
Correct |
2 ms |
10844 KB |
Output is correct |
67 |
Correct |
2 ms |
10844 KB |
Output is correct |
68 |
Correct |
2 ms |
10844 KB |
Output is correct |
69 |
Correct |
2 ms |
10912 KB |
Output is correct |
70 |
Correct |
2 ms |
10840 KB |
Output is correct |
71 |
Correct |
2 ms |
10844 KB |
Output is correct |
72 |
Correct |
2 ms |
10844 KB |
Output is correct |
73 |
Correct |
2 ms |
10844 KB |
Output is correct |
74 |
Correct |
2 ms |
10844 KB |
Output is correct |
75 |
Correct |
2 ms |
10844 KB |
Output is correct |
76 |
Correct |
2 ms |
10840 KB |
Output is correct |
77 |
Correct |
2 ms |
10844 KB |
Output is correct |
78 |
Correct |
2 ms |
10844 KB |
Output is correct |
79 |
Correct |
2 ms |
10844 KB |
Output is correct |
80 |
Correct |
2 ms |
10828 KB |
Output is correct |
81 |
Correct |
2 ms |
10856 KB |
Output is correct |
82 |
Correct |
2 ms |
10844 KB |
Output is correct |
83 |
Correct |
2 ms |
10844 KB |
Output is correct |
84 |
Correct |
3 ms |
10840 KB |
Output is correct |
85 |
Correct |
3 ms |
10872 KB |
Output is correct |
86 |
Correct |
3 ms |
10840 KB |
Output is correct |
87 |
Correct |
3 ms |
10844 KB |
Output is correct |
88 |
Correct |
3 ms |
10844 KB |
Output is correct |
89 |
Correct |
4 ms |
11356 KB |
Output is correct |
90 |
Correct |
4 ms |
11356 KB |
Output is correct |
91 |
Correct |
3 ms |
11608 KB |
Output is correct |
92 |
Correct |
3 ms |
11360 KB |
Output is correct |
93 |
Correct |
3 ms |
11100 KB |
Output is correct |
94 |
Correct |
3 ms |
11356 KB |
Output is correct |
95 |
Correct |
3 ms |
11388 KB |
Output is correct |
96 |
Correct |
3 ms |
11104 KB |
Output is correct |
97 |
Correct |
4 ms |
11360 KB |
Output is correct |
98 |
Correct |
3 ms |
11204 KB |
Output is correct |
99 |
Correct |
4 ms |
11360 KB |
Output is correct |
100 |
Correct |
3 ms |
11172 KB |
Output is correct |
101 |
Correct |
4 ms |
10928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
10844 KB |
Output is correct |
2 |
Correct |
2 ms |
10844 KB |
Output is correct |
3 |
Correct |
1 ms |
10844 KB |
Output is correct |
4 |
Correct |
1 ms |
10844 KB |
Output is correct |
5 |
Correct |
1 ms |
10844 KB |
Output is correct |
6 |
Correct |
1 ms |
10844 KB |
Output is correct |
7 |
Correct |
1 ms |
10844 KB |
Output is correct |
8 |
Correct |
1 ms |
10844 KB |
Output is correct |
9 |
Correct |
1 ms |
10844 KB |
Output is correct |
10 |
Correct |
1 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 |
2 ms |
10840 KB |
Output is correct |
14 |
Correct |
1 ms |
10844 KB |
Output is correct |
15 |
Correct |
2 ms |
10844 KB |
Output is correct |
16 |
Correct |
2 ms |
10844 KB |
Output is correct |
17 |
Correct |
2 ms |
10844 KB |
Output is correct |
18 |
Correct |
1 ms |
10844 KB |
Output is correct |
19 |
Correct |
2 ms |
10844 KB |
Output is correct |
20 |
Correct |
2 ms |
10844 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
2 ms |
10844 KB |
Output is correct |
23 |
Correct |
2 ms |
10844 KB |
Output is correct |
24 |
Correct |
1 ms |
10844 KB |
Output is correct |
25 |
Correct |
2 ms |
10844 KB |
Output is correct |
26 |
Correct |
3 ms |
10844 KB |
Output is correct |
27 |
Correct |
4 ms |
11356 KB |
Output is correct |
28 |
Correct |
2 ms |
11356 KB |
Output is correct |
29 |
Correct |
3 ms |
11356 KB |
Output is correct |
30 |
Correct |
3 ms |
11352 KB |
Output is correct |
31 |
Correct |
3 ms |
11100 KB |
Output is correct |
32 |
Correct |
3 ms |
11348 KB |
Output is correct |
33 |
Correct |
3 ms |
11356 KB |
Output is correct |
34 |
Correct |
2 ms |
10844 KB |
Output is correct |
35 |
Correct |
2 ms |
10844 KB |
Output is correct |
36 |
Correct |
1 ms |
10844 KB |
Output is correct |
37 |
Correct |
2 ms |
10864 KB |
Output is correct |
38 |
Correct |
2 ms |
10844 KB |
Output is correct |
39 |
Correct |
2 ms |
10844 KB |
Output is correct |
40 |
Correct |
2 ms |
10840 KB |
Output is correct |
41 |
Correct |
2 ms |
10840 KB |
Output is correct |
42 |
Correct |
2 ms |
10844 KB |
Output is correct |
43 |
Correct |
2 ms |
10844 KB |
Output is correct |
44 |
Correct |
2 ms |
10844 KB |
Output is correct |
45 |
Correct |
2 ms |
10844 KB |
Output is correct |
46 |
Correct |
2 ms |
10840 KB |
Output is correct |
47 |
Correct |
2 ms |
10844 KB |
Output is correct |
48 |
Correct |
2 ms |
10844 KB |
Output is correct |
49 |
Correct |
2 ms |
10844 KB |
Output is correct |
50 |
Correct |
2 ms |
10844 KB |
Output is correct |
51 |
Correct |
1 ms |
10844 KB |
Output is correct |
52 |
Correct |
2 ms |
10840 KB |
Output is correct |
53 |
Correct |
1 ms |
10844 KB |
Output is correct |
54 |
Correct |
2 ms |
10844 KB |
Output is correct |
55 |
Correct |
2 ms |
10844 KB |
Output is correct |
56 |
Correct |
3 ms |
10844 KB |
Output is correct |
57 |
Correct |
2 ms |
10844 KB |
Output is correct |
58 |
Correct |
1 ms |
10844 KB |
Output is correct |
59 |
Correct |
2 ms |
10844 KB |
Output is correct |
60 |
Correct |
2 ms |
10844 KB |
Output is correct |
61 |
Correct |
2 ms |
10844 KB |
Output is correct |
62 |
Correct |
1 ms |
10844 KB |
Output is correct |
63 |
Correct |
2 ms |
10844 KB |
Output is correct |
64 |
Correct |
2 ms |
10844 KB |
Output is correct |
65 |
Correct |
2 ms |
10844 KB |
Output is correct |
66 |
Correct |
2 ms |
10844 KB |
Output is correct |
67 |
Correct |
2 ms |
10844 KB |
Output is correct |
68 |
Correct |
2 ms |
10844 KB |
Output is correct |
69 |
Correct |
2 ms |
10912 KB |
Output is correct |
70 |
Correct |
2 ms |
10840 KB |
Output is correct |
71 |
Correct |
2 ms |
10844 KB |
Output is correct |
72 |
Correct |
2 ms |
10844 KB |
Output is correct |
73 |
Correct |
2 ms |
10844 KB |
Output is correct |
74 |
Correct |
2 ms |
10844 KB |
Output is correct |
75 |
Correct |
2 ms |
10844 KB |
Output is correct |
76 |
Correct |
2 ms |
10840 KB |
Output is correct |
77 |
Correct |
2 ms |
10844 KB |
Output is correct |
78 |
Correct |
2 ms |
10844 KB |
Output is correct |
79 |
Correct |
2 ms |
10844 KB |
Output is correct |
80 |
Correct |
2 ms |
10828 KB |
Output is correct |
81 |
Correct |
2 ms |
10856 KB |
Output is correct |
82 |
Correct |
2 ms |
10844 KB |
Output is correct |
83 |
Correct |
2 ms |
10844 KB |
Output is correct |
84 |
Correct |
3 ms |
10840 KB |
Output is correct |
85 |
Correct |
3 ms |
10872 KB |
Output is correct |
86 |
Correct |
3 ms |
10840 KB |
Output is correct |
87 |
Correct |
3 ms |
10844 KB |
Output is correct |
88 |
Correct |
3 ms |
10844 KB |
Output is correct |
89 |
Correct |
4 ms |
11356 KB |
Output is correct |
90 |
Correct |
4 ms |
11356 KB |
Output is correct |
91 |
Correct |
3 ms |
11608 KB |
Output is correct |
92 |
Correct |
3 ms |
11360 KB |
Output is correct |
93 |
Correct |
3 ms |
11100 KB |
Output is correct |
94 |
Correct |
3 ms |
11356 KB |
Output is correct |
95 |
Correct |
3 ms |
11388 KB |
Output is correct |
96 |
Correct |
3 ms |
11104 KB |
Output is correct |
97 |
Correct |
4 ms |
11360 KB |
Output is correct |
98 |
Correct |
3 ms |
11204 KB |
Output is correct |
99 |
Correct |
4 ms |
11360 KB |
Output is correct |
100 |
Correct |
3 ms |
11172 KB |
Output is correct |
101 |
Correct |
4 ms |
10928 KB |
Output is correct |
102 |
Correct |
84 ms |
15988 KB |
Output is correct |
103 |
Correct |
104 ms |
15952 KB |
Output is correct |
104 |
Correct |
169 ms |
49596 KB |
Output is correct |
105 |
Correct |
69 ms |
18064 KB |
Output is correct |
106 |
Correct |
84 ms |
17544 KB |
Output is correct |
107 |
Correct |
117 ms |
43788 KB |
Output is correct |
108 |
Correct |
126 ms |
45612 KB |
Output is correct |
109 |
Correct |
60 ms |
43204 KB |
Output is correct |
110 |
Correct |
182 ms |
42716 KB |
Output is correct |
111 |
Correct |
115 ms |
48564 KB |
Output is correct |
112 |
Correct |
104 ms |
43440 KB |
Output is correct |
113 |
Correct |
79 ms |
33788 KB |
Output is correct |
114 |
Correct |
84 ms |
43176 KB |
Output is correct |
115 |
Correct |
89 ms |
50768 KB |
Output is correct |
116 |
Correct |
131 ms |
44208 KB |
Output is correct |
117 |
Correct |
119 ms |
38916 KB |
Output is correct |
118 |
Correct |
122 ms |
40712 KB |
Output is correct |
119 |
Correct |
123 ms |
21240 KB |
Output is correct |
120 |
Correct |
81 ms |
15444 KB |
Output is correct |