#include "beechtree.h"
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using ld = long double;
//#define int ll
#define sz(x) ((int)(x).size())
using pii = pair<int,int>;
using tii = tuple<int,int,int>;
const int nmax = 3e5 + 5;
const int mod = 998244853;
struct Mint {
int val;
Mint(ll x = 0): val((x % mod + mod) % mod) {;}
Mint operator +(const Mint& x) const { return Mint(val + x.val); }
Mint operator -(const Mint& x) const { return Mint(val - x.val); }
Mint operator *(const Mint& x) const { return Mint((ll)val * x.val); }
Mint operator +=(const Mint& x) { return *this = Mint(val + x.val); }
Mint operator -=(const Mint& x) { return *this = Mint(val - x.val); }
Mint operator *=(const Mint& x) { return *this = Mint((ll)val * x.val); }
Mint operator ^(const int& _b) const {
Mint accum = 1, a = *this;
int b = _b;
while(b) {
accum = (b & 1? accum * a : accum);
a *= a;
b >>= 1;
}
return accum;
}
Mint operator /(const Mint& x) { return Mint((ll)val * (x ^ (mod - 2)).val); }
Mint operator /=(const Mint& x) { return *this = Mint((ll)val * (x ^ (mod - 2)).val); }
};
Mint p[2][nmax];
#define hash bjsefdjhsdsfhoi
struct hash {
Mint v[2];
int len;
hash(Mint a = 0, Mint b = 0, int c = 0) { v[0] = a; v[1] = b; len = c; }
hash operator +(const hash& x) const {
return hash(v[0] * p[0][x.len] + x.v[0], v[1] * p[1][x.len] + x.v[1], len + x.len);
}
hash operator -(const hash& x) const {
return hash(v[0] - p[0][len - x.len] * x.v[0], v[1] - p[1][len - x.len] * x.v[1], len - x.len);
}
bool operator !=(const hash& x) const {
return v[0].val != x.v[0].val || v[1].val != x.v[1].val || len != x.len;
}
ll operator()() const { return (ll)v[0].val * mod + v[1].val; }
};
vector<pii> g[nmax];
vector<pii> invg[nmax];
vector<int> P, C;
bool isanc(unordered_set<int>& A, unordered_set<int>& B) {
if(sz(A) < sz(B)) return 0;
for(auto &x : B)
if(!A.count(x)) return 0;
return 1;
}
vector<int> sol;
int h[nmax];
int area[nmax], pin[nmax], pout[nmax], inp;
hash subarb[nmax];
bool superimposable(int x, int y) { // x peste y
if(sz(g[x]) == 0 || x == y) return 1;
if(area[x] == area[y] && subarb[x]() == subarb[y]()) return 1;
if(pin[y] <= pin[x] && pout[x] <= pout[y] && sol[y]) return 1;
//if(calc[x][y]) return SI[x][y];
//calc[x][y] = 1;
//SI[x][y] = 1;
for(auto [a, c] : g[x]) {
auto it = lower_bound(all(invg[y]), pii{c, -1});
if(it == end(invg[y]) || it -> first != c) { return 0; }
if(!superimposable(a, it -> second)) { return 0; }
}
return 1;
}
void insert(int& works, map<int, int>& st, int node) {
if(!works) return;
auto it = st.upper_bound(area[node]);
if(it == st.end());
else if(!superimposable(node, it -> second)) { works = 0; return; }
if(it == st.begin());
else if(!superimposable(prev(it) -> second, node)) { works = 0; return; }
st[area[node]] = node;
return;
}
map<int, int> dfs(int node) {
pin[node] = inp++;
map<int, int> here;
sol[node] = 1;
area[node] = 1;
vector<hash> fils;
unordered_set<int> pula;
for(auto [x, c] : g[node]) {
pula.insert(c);
auto T = dfs(x);
//fils.emplace_back(hash(c) + subarb[x]);
area[node] += area[x];
sol[node] &= sol[x];
if(sz(T) > sz(here)) swap(here, T);
for(auto [a, x] : T) insert(sol[node], here, x);
}
//sort(all(fils), [&](auto a, auto b) { return a() < b(); });
subarb[node] = hash(node);
//for(auto x : fils) subarb[node] = subarb[node] + x;
//subarb[node] = subarb[node] + hash(12);
insert(sol[node], here, node);
pout[node] = inp++;
if(sz(g[node]) != sz(pula)) sol[node] = 0;
return here;
}
std::vector<int> beechtree(int N, int M, std::vector<int> P_, std::vector<int> C_) {
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
p[0][0] = p[1][0] = 1;
p[0][1] = rng() % (mod - 1000) + 503;
p[1][1] = rng() % (mod - 1200) + 505;
for(int i = 2; i < nmax; i++)
p[0][i] = p[0][i - 1] * p[0][1],
p[1][i] = p[1][i - 1] * p[1][1];
P = P_;
C = C_;
for(int i = 1; i < N; i++) {
g[P[i]].emplace_back(i, C[i]);
invg[P[i]].emplace_back(C[i], i);
}
for(int i = 0; i < N; i++) sort(all(invg[i]));
sol.assign(N, 0);
dfs(0);
return sol;
}
/**
Töte es durch genaue Untersuchung\Töte es kann es nur noch schlimmer machen\Es lässt es irgendwie atmen
--
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
24924 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
24908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
24920 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
25092 KB |
Output is correct |
4 |
Correct |
7 ms |
24924 KB |
Output is correct |
5 |
Correct |
7 ms |
24920 KB |
Output is correct |
6 |
Correct |
6 ms |
24920 KB |
Output is correct |
7 |
Correct |
7 ms |
24924 KB |
Output is correct |
8 |
Correct |
7 ms |
25072 KB |
Output is correct |
9 |
Correct |
7 ms |
24924 KB |
Output is correct |
10 |
Correct |
6 ms |
25092 KB |
Output is correct |
11 |
Correct |
9 ms |
24920 KB |
Output is correct |
12 |
Correct |
6 ms |
24892 KB |
Output is correct |
13 |
Correct |
6 ms |
25092 KB |
Output is correct |
14 |
Correct |
6 ms |
24920 KB |
Output is correct |
15 |
Correct |
6 ms |
24920 KB |
Output is correct |
16 |
Correct |
6 ms |
24924 KB |
Output is correct |
17 |
Correct |
7 ms |
25016 KB |
Output is correct |
18 |
Correct |
7 ms |
24924 KB |
Output is correct |
19 |
Correct |
7 ms |
24888 KB |
Output is correct |
20 |
Correct |
8 ms |
24924 KB |
Output is correct |
21 |
Correct |
7 ms |
24920 KB |
Output is correct |
22 |
Correct |
8 ms |
24924 KB |
Output is correct |
23 |
Correct |
7 ms |
24920 KB |
Output is correct |
24 |
Correct |
6 ms |
24924 KB |
Output is correct |
25 |
Correct |
7 ms |
25076 KB |
Output is correct |
26 |
Correct |
6 ms |
24924 KB |
Output is correct |
27 |
Correct |
7 ms |
24924 KB |
Output is correct |
28 |
Correct |
7 ms |
24924 KB |
Output is correct |
29 |
Correct |
8 ms |
24920 KB |
Output is correct |
30 |
Correct |
8 ms |
24900 KB |
Output is correct |
31 |
Correct |
7 ms |
24924 KB |
Output is correct |
32 |
Correct |
7 ms |
24924 KB |
Output is correct |
33 |
Correct |
6 ms |
24924 KB |
Output is correct |
34 |
Correct |
7 ms |
25088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
24920 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
25092 KB |
Output is correct |
4 |
Correct |
7 ms |
24924 KB |
Output is correct |
5 |
Correct |
7 ms |
24920 KB |
Output is correct |
6 |
Correct |
6 ms |
24920 KB |
Output is correct |
7 |
Correct |
120 ms |
121184 KB |
Output is correct |
8 |
Correct |
126 ms |
121168 KB |
Output is correct |
9 |
Correct |
8 ms |
25180 KB |
Output is correct |
10 |
Correct |
7 ms |
25136 KB |
Output is correct |
11 |
Correct |
7 ms |
25180 KB |
Output is correct |
12 |
Correct |
7 ms |
25180 KB |
Output is correct |
13 |
Correct |
9 ms |
25948 KB |
Output is correct |
14 |
Correct |
8 ms |
25888 KB |
Output is correct |
15 |
Correct |
8 ms |
25944 KB |
Output is correct |
16 |
Correct |
8 ms |
25836 KB |
Output is correct |
17 |
Correct |
179 ms |
121340 KB |
Output is correct |
18 |
Correct |
191 ms |
123808 KB |
Output is correct |
19 |
Correct |
140 ms |
123732 KB |
Output is correct |
20 |
Correct |
145 ms |
123652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
24920 KB |
Output is correct |
2 |
Correct |
7 ms |
24912 KB |
Output is correct |
3 |
Correct |
7 ms |
24924 KB |
Output is correct |
4 |
Correct |
6 ms |
24920 KB |
Output is correct |
5 |
Correct |
7 ms |
24904 KB |
Output is correct |
6 |
Correct |
7 ms |
24920 KB |
Output is correct |
7 |
Correct |
8 ms |
24924 KB |
Output is correct |
8 |
Correct |
9 ms |
24924 KB |
Output is correct |
9 |
Correct |
6 ms |
24924 KB |
Output is correct |
10 |
Correct |
7 ms |
25100 KB |
Output is correct |
11 |
Correct |
8 ms |
24924 KB |
Output is correct |
12 |
Correct |
8 ms |
24924 KB |
Output is correct |
13 |
Correct |
7 ms |
24912 KB |
Output is correct |
14 |
Correct |
8 ms |
24920 KB |
Output is correct |
15 |
Correct |
54 ms |
30536 KB |
Output is correct |
16 |
Correct |
49 ms |
30312 KB |
Output is correct |
17 |
Correct |
48 ms |
30292 KB |
Output is correct |
18 |
Correct |
51 ms |
30548 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
24920 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
24924 KB |
Output is correct |
4 |
Correct |
7 ms |
25072 KB |
Output is correct |
5 |
Correct |
120 ms |
121184 KB |
Output is correct |
6 |
Correct |
126 ms |
121168 KB |
Output is correct |
7 |
Correct |
7 ms |
24924 KB |
Output is correct |
8 |
Correct |
7 ms |
24924 KB |
Output is correct |
9 |
Correct |
8 ms |
25180 KB |
Output is correct |
10 |
Correct |
7 ms |
25192 KB |
Output is correct |
11 |
Correct |
87 ms |
43752 KB |
Output is correct |
12 |
Correct |
84 ms |
34648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
24924 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
24908 KB |
Output is correct |
4 |
Correct |
8 ms |
24920 KB |
Output is correct |
5 |
Correct |
7 ms |
24924 KB |
Output is correct |
6 |
Correct |
7 ms |
25092 KB |
Output is correct |
7 |
Correct |
7 ms |
24924 KB |
Output is correct |
8 |
Correct |
7 ms |
24920 KB |
Output is correct |
9 |
Correct |
6 ms |
24920 KB |
Output is correct |
10 |
Correct |
7 ms |
24924 KB |
Output is correct |
11 |
Correct |
7 ms |
25072 KB |
Output is correct |
12 |
Correct |
7 ms |
24924 KB |
Output is correct |
13 |
Correct |
6 ms |
25092 KB |
Output is correct |
14 |
Correct |
9 ms |
24920 KB |
Output is correct |
15 |
Correct |
6 ms |
24892 KB |
Output is correct |
16 |
Correct |
6 ms |
25092 KB |
Output is correct |
17 |
Correct |
6 ms |
24920 KB |
Output is correct |
18 |
Correct |
6 ms |
24920 KB |
Output is correct |
19 |
Correct |
6 ms |
24924 KB |
Output is correct |
20 |
Correct |
7 ms |
25016 KB |
Output is correct |
21 |
Correct |
7 ms |
24924 KB |
Output is correct |
22 |
Correct |
7 ms |
24888 KB |
Output is correct |
23 |
Correct |
8 ms |
24924 KB |
Output is correct |
24 |
Correct |
7 ms |
24920 KB |
Output is correct |
25 |
Correct |
8 ms |
24924 KB |
Output is correct |
26 |
Correct |
7 ms |
24920 KB |
Output is correct |
27 |
Correct |
6 ms |
24924 KB |
Output is correct |
28 |
Correct |
7 ms |
25076 KB |
Output is correct |
29 |
Correct |
6 ms |
24924 KB |
Output is correct |
30 |
Correct |
7 ms |
24924 KB |
Output is correct |
31 |
Correct |
7 ms |
24924 KB |
Output is correct |
32 |
Correct |
8 ms |
24920 KB |
Output is correct |
33 |
Correct |
8 ms |
24900 KB |
Output is correct |
34 |
Correct |
7 ms |
24924 KB |
Output is correct |
35 |
Correct |
7 ms |
24924 KB |
Output is correct |
36 |
Correct |
6 ms |
24924 KB |
Output is correct |
37 |
Correct |
7 ms |
25088 KB |
Output is correct |
38 |
Correct |
8 ms |
25180 KB |
Output is correct |
39 |
Correct |
7 ms |
25136 KB |
Output is correct |
40 |
Correct |
7 ms |
25180 KB |
Output is correct |
41 |
Correct |
7 ms |
25180 KB |
Output is correct |
42 |
Correct |
7 ms |
24920 KB |
Output is correct |
43 |
Correct |
7 ms |
24912 KB |
Output is correct |
44 |
Correct |
7 ms |
24924 KB |
Output is correct |
45 |
Correct |
6 ms |
24920 KB |
Output is correct |
46 |
Correct |
7 ms |
24904 KB |
Output is correct |
47 |
Correct |
7 ms |
24920 KB |
Output is correct |
48 |
Correct |
8 ms |
24924 KB |
Output is correct |
49 |
Correct |
9 ms |
24924 KB |
Output is correct |
50 |
Correct |
6 ms |
24924 KB |
Output is correct |
51 |
Correct |
7 ms |
25100 KB |
Output is correct |
52 |
Correct |
7 ms |
24924 KB |
Output is correct |
53 |
Correct |
7 ms |
24924 KB |
Output is correct |
54 |
Correct |
7 ms |
24924 KB |
Output is correct |
55 |
Correct |
7 ms |
24984 KB |
Output is correct |
56 |
Correct |
7 ms |
24924 KB |
Output is correct |
57 |
Correct |
7 ms |
24924 KB |
Output is correct |
58 |
Correct |
7 ms |
24920 KB |
Output is correct |
59 |
Correct |
7 ms |
24924 KB |
Output is correct |
60 |
Correct |
7 ms |
24920 KB |
Output is correct |
61 |
Correct |
7 ms |
24924 KB |
Output is correct |
62 |
Correct |
6 ms |
24924 KB |
Output is correct |
63 |
Correct |
7 ms |
24976 KB |
Output is correct |
64 |
Correct |
6 ms |
24924 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
24920 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
24924 KB |
Output is correct |
4 |
Correct |
7 ms |
25072 KB |
Output is correct |
5 |
Correct |
7 ms |
24924 KB |
Output is correct |
6 |
Correct |
6 ms |
25092 KB |
Output is correct |
7 |
Correct |
9 ms |
24920 KB |
Output is correct |
8 |
Correct |
6 ms |
24892 KB |
Output is correct |
9 |
Correct |
6 ms |
25092 KB |
Output is correct |
10 |
Correct |
6 ms |
24920 KB |
Output is correct |
11 |
Correct |
6 ms |
24920 KB |
Output is correct |
12 |
Correct |
6 ms |
24924 KB |
Output is correct |
13 |
Correct |
7 ms |
25016 KB |
Output is correct |
14 |
Correct |
7 ms |
24924 KB |
Output is correct |
15 |
Correct |
7 ms |
24888 KB |
Output is correct |
16 |
Correct |
8 ms |
24924 KB |
Output is correct |
17 |
Correct |
7 ms |
24920 KB |
Output is correct |
18 |
Correct |
8 ms |
24924 KB |
Output is correct |
19 |
Correct |
7 ms |
24920 KB |
Output is correct |
20 |
Correct |
6 ms |
24924 KB |
Output is correct |
21 |
Correct |
7 ms |
25076 KB |
Output is correct |
22 |
Correct |
6 ms |
24924 KB |
Output is correct |
23 |
Correct |
7 ms |
24924 KB |
Output is correct |
24 |
Correct |
7 ms |
24924 KB |
Output is correct |
25 |
Correct |
10 ms |
25948 KB |
Output is correct |
26 |
Correct |
8 ms |
25948 KB |
Output is correct |
27 |
Correct |
8 ms |
25948 KB |
Output is correct |
28 |
Correct |
7 ms |
26024 KB |
Output is correct |
29 |
Correct |
11 ms |
26148 KB |
Output is correct |
30 |
Correct |
12 ms |
25180 KB |
Output is correct |
31 |
Correct |
9 ms |
25180 KB |
Output is correct |
32 |
Correct |
8 ms |
25244 KB |
Output is correct |
33 |
Correct |
8 ms |
25180 KB |
Output is correct |
34 |
Correct |
9 ms |
25180 KB |
Output is correct |
35 |
Correct |
10 ms |
25180 KB |
Output is correct |
36 |
Correct |
8 ms |
25176 KB |
Output is correct |
37 |
Correct |
9 ms |
25448 KB |
Output is correct |
38 |
Correct |
9 ms |
25372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
24924 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
24908 KB |
Output is correct |
4 |
Correct |
8 ms |
24920 KB |
Output is correct |
5 |
Correct |
7 ms |
24924 KB |
Output is correct |
6 |
Correct |
7 ms |
25092 KB |
Output is correct |
7 |
Correct |
7 ms |
24924 KB |
Output is correct |
8 |
Correct |
7 ms |
24920 KB |
Output is correct |
9 |
Correct |
6 ms |
24920 KB |
Output is correct |
10 |
Correct |
7 ms |
24924 KB |
Output is correct |
11 |
Correct |
7 ms |
25072 KB |
Output is correct |
12 |
Correct |
7 ms |
24924 KB |
Output is correct |
13 |
Correct |
6 ms |
25092 KB |
Output is correct |
14 |
Correct |
9 ms |
24920 KB |
Output is correct |
15 |
Correct |
6 ms |
24892 KB |
Output is correct |
16 |
Correct |
6 ms |
25092 KB |
Output is correct |
17 |
Correct |
6 ms |
24920 KB |
Output is correct |
18 |
Correct |
6 ms |
24920 KB |
Output is correct |
19 |
Correct |
6 ms |
24924 KB |
Output is correct |
20 |
Correct |
7 ms |
25016 KB |
Output is correct |
21 |
Correct |
7 ms |
24924 KB |
Output is correct |
22 |
Correct |
7 ms |
24888 KB |
Output is correct |
23 |
Correct |
8 ms |
24924 KB |
Output is correct |
24 |
Correct |
7 ms |
24920 KB |
Output is correct |
25 |
Correct |
8 ms |
24924 KB |
Output is correct |
26 |
Correct |
7 ms |
24920 KB |
Output is correct |
27 |
Correct |
6 ms |
24924 KB |
Output is correct |
28 |
Correct |
7 ms |
25076 KB |
Output is correct |
29 |
Correct |
6 ms |
24924 KB |
Output is correct |
30 |
Correct |
7 ms |
24924 KB |
Output is correct |
31 |
Correct |
7 ms |
24924 KB |
Output is correct |
32 |
Correct |
8 ms |
24920 KB |
Output is correct |
33 |
Correct |
8 ms |
24900 KB |
Output is correct |
34 |
Correct |
7 ms |
24924 KB |
Output is correct |
35 |
Correct |
7 ms |
24924 KB |
Output is correct |
36 |
Correct |
6 ms |
24924 KB |
Output is correct |
37 |
Correct |
7 ms |
25088 KB |
Output is correct |
38 |
Correct |
8 ms |
25180 KB |
Output is correct |
39 |
Correct |
7 ms |
25136 KB |
Output is correct |
40 |
Correct |
7 ms |
25180 KB |
Output is correct |
41 |
Correct |
7 ms |
25180 KB |
Output is correct |
42 |
Correct |
9 ms |
25948 KB |
Output is correct |
43 |
Correct |
8 ms |
25888 KB |
Output is correct |
44 |
Correct |
8 ms |
25944 KB |
Output is correct |
45 |
Correct |
8 ms |
25836 KB |
Output is correct |
46 |
Correct |
7 ms |
24920 KB |
Output is correct |
47 |
Correct |
7 ms |
24912 KB |
Output is correct |
48 |
Correct |
7 ms |
24924 KB |
Output is correct |
49 |
Correct |
6 ms |
24920 KB |
Output is correct |
50 |
Correct |
7 ms |
24904 KB |
Output is correct |
51 |
Correct |
7 ms |
24920 KB |
Output is correct |
52 |
Correct |
8 ms |
24924 KB |
Output is correct |
53 |
Correct |
9 ms |
24924 KB |
Output is correct |
54 |
Correct |
6 ms |
24924 KB |
Output is correct |
55 |
Correct |
7 ms |
25100 KB |
Output is correct |
56 |
Correct |
8 ms |
24924 KB |
Output is correct |
57 |
Correct |
8 ms |
24924 KB |
Output is correct |
58 |
Correct |
7 ms |
24912 KB |
Output is correct |
59 |
Correct |
8 ms |
24920 KB |
Output is correct |
60 |
Correct |
7 ms |
24924 KB |
Output is correct |
61 |
Correct |
7 ms |
24924 KB |
Output is correct |
62 |
Correct |
8 ms |
25180 KB |
Output is correct |
63 |
Correct |
7 ms |
25192 KB |
Output is correct |
64 |
Correct |
7 ms |
24924 KB |
Output is correct |
65 |
Correct |
7 ms |
24984 KB |
Output is correct |
66 |
Correct |
7 ms |
24924 KB |
Output is correct |
67 |
Correct |
7 ms |
24924 KB |
Output is correct |
68 |
Correct |
7 ms |
24920 KB |
Output is correct |
69 |
Correct |
7 ms |
24924 KB |
Output is correct |
70 |
Correct |
7 ms |
24920 KB |
Output is correct |
71 |
Correct |
7 ms |
24924 KB |
Output is correct |
72 |
Correct |
6 ms |
24924 KB |
Output is correct |
73 |
Correct |
7 ms |
24976 KB |
Output is correct |
74 |
Correct |
6 ms |
24924 KB |
Output is correct |
75 |
Correct |
10 ms |
25948 KB |
Output is correct |
76 |
Correct |
8 ms |
25948 KB |
Output is correct |
77 |
Correct |
8 ms |
25948 KB |
Output is correct |
78 |
Correct |
7 ms |
26024 KB |
Output is correct |
79 |
Correct |
11 ms |
26148 KB |
Output is correct |
80 |
Correct |
12 ms |
25180 KB |
Output is correct |
81 |
Correct |
9 ms |
25180 KB |
Output is correct |
82 |
Correct |
8 ms |
25244 KB |
Output is correct |
83 |
Correct |
8 ms |
25180 KB |
Output is correct |
84 |
Correct |
9 ms |
25180 KB |
Output is correct |
85 |
Correct |
10 ms |
25180 KB |
Output is correct |
86 |
Correct |
8 ms |
25176 KB |
Output is correct |
87 |
Correct |
9 ms |
25448 KB |
Output is correct |
88 |
Correct |
9 ms |
25372 KB |
Output is correct |
89 |
Correct |
11 ms |
25436 KB |
Output is correct |
90 |
Correct |
11 ms |
25176 KB |
Output is correct |
91 |
Correct |
8 ms |
25180 KB |
Output is correct |
92 |
Correct |
8 ms |
25168 KB |
Output is correct |
93 |
Correct |
9 ms |
25180 KB |
Output is correct |
94 |
Correct |
8 ms |
25176 KB |
Output is correct |
95 |
Correct |
8 ms |
25176 KB |
Output is correct |
96 |
Correct |
8 ms |
25120 KB |
Output is correct |
97 |
Correct |
7 ms |
25432 KB |
Output is correct |
98 |
Correct |
10 ms |
25176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
24920 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
24924 KB |
Output is correct |
4 |
Correct |
7 ms |
25072 KB |
Output is correct |
5 |
Correct |
7 ms |
24924 KB |
Output is correct |
6 |
Correct |
6 ms |
25092 KB |
Output is correct |
7 |
Correct |
9 ms |
24920 KB |
Output is correct |
8 |
Correct |
6 ms |
24892 KB |
Output is correct |
9 |
Correct |
6 ms |
25092 KB |
Output is correct |
10 |
Correct |
6 ms |
24920 KB |
Output is correct |
11 |
Correct |
6 ms |
24920 KB |
Output is correct |
12 |
Correct |
6 ms |
24924 KB |
Output is correct |
13 |
Correct |
7 ms |
25016 KB |
Output is correct |
14 |
Correct |
7 ms |
24924 KB |
Output is correct |
15 |
Correct |
7 ms |
24888 KB |
Output is correct |
16 |
Correct |
8 ms |
24924 KB |
Output is correct |
17 |
Correct |
7 ms |
24920 KB |
Output is correct |
18 |
Correct |
8 ms |
24924 KB |
Output is correct |
19 |
Correct |
7 ms |
24920 KB |
Output is correct |
20 |
Correct |
6 ms |
24924 KB |
Output is correct |
21 |
Correct |
7 ms |
25076 KB |
Output is correct |
22 |
Correct |
6 ms |
24924 KB |
Output is correct |
23 |
Correct |
7 ms |
24924 KB |
Output is correct |
24 |
Correct |
7 ms |
24924 KB |
Output is correct |
25 |
Correct |
10 ms |
25948 KB |
Output is correct |
26 |
Correct |
8 ms |
25948 KB |
Output is correct |
27 |
Correct |
8 ms |
25948 KB |
Output is correct |
28 |
Correct |
7 ms |
26024 KB |
Output is correct |
29 |
Correct |
11 ms |
26148 KB |
Output is correct |
30 |
Correct |
12 ms |
25180 KB |
Output is correct |
31 |
Correct |
9 ms |
25180 KB |
Output is correct |
32 |
Correct |
8 ms |
25244 KB |
Output is correct |
33 |
Correct |
8 ms |
25180 KB |
Output is correct |
34 |
Correct |
9 ms |
25180 KB |
Output is correct |
35 |
Correct |
10 ms |
25180 KB |
Output is correct |
36 |
Correct |
8 ms |
25176 KB |
Output is correct |
37 |
Correct |
9 ms |
25448 KB |
Output is correct |
38 |
Correct |
9 ms |
25372 KB |
Output is correct |
39 |
Correct |
207 ms |
121372 KB |
Output is correct |
40 |
Correct |
160 ms |
122948 KB |
Output is correct |
41 |
Correct |
157 ms |
123004 KB |
Output is correct |
42 |
Correct |
166 ms |
123020 KB |
Output is correct |
43 |
Execution timed out |
2063 ms |
94396 KB |
Time limit exceeded |
44 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
24924 KB |
Output is correct |
2 |
Correct |
7 ms |
24924 KB |
Output is correct |
3 |
Correct |
7 ms |
24908 KB |
Output is correct |
4 |
Correct |
8 ms |
24920 KB |
Output is correct |
5 |
Correct |
7 ms |
24924 KB |
Output is correct |
6 |
Correct |
7 ms |
25092 KB |
Output is correct |
7 |
Correct |
7 ms |
24924 KB |
Output is correct |
8 |
Correct |
7 ms |
24920 KB |
Output is correct |
9 |
Correct |
6 ms |
24920 KB |
Output is correct |
10 |
Correct |
7 ms |
24924 KB |
Output is correct |
11 |
Correct |
7 ms |
25072 KB |
Output is correct |
12 |
Correct |
7 ms |
24924 KB |
Output is correct |
13 |
Correct |
6 ms |
25092 KB |
Output is correct |
14 |
Correct |
9 ms |
24920 KB |
Output is correct |
15 |
Correct |
6 ms |
24892 KB |
Output is correct |
16 |
Correct |
6 ms |
25092 KB |
Output is correct |
17 |
Correct |
6 ms |
24920 KB |
Output is correct |
18 |
Correct |
6 ms |
24920 KB |
Output is correct |
19 |
Correct |
6 ms |
24924 KB |
Output is correct |
20 |
Correct |
7 ms |
25016 KB |
Output is correct |
21 |
Correct |
7 ms |
24924 KB |
Output is correct |
22 |
Correct |
7 ms |
24888 KB |
Output is correct |
23 |
Correct |
8 ms |
24924 KB |
Output is correct |
24 |
Correct |
7 ms |
24920 KB |
Output is correct |
25 |
Correct |
8 ms |
24924 KB |
Output is correct |
26 |
Correct |
7 ms |
24920 KB |
Output is correct |
27 |
Correct |
6 ms |
24924 KB |
Output is correct |
28 |
Correct |
7 ms |
25076 KB |
Output is correct |
29 |
Correct |
6 ms |
24924 KB |
Output is correct |
30 |
Correct |
7 ms |
24924 KB |
Output is correct |
31 |
Correct |
7 ms |
24924 KB |
Output is correct |
32 |
Correct |
8 ms |
24920 KB |
Output is correct |
33 |
Correct |
8 ms |
24900 KB |
Output is correct |
34 |
Correct |
7 ms |
24924 KB |
Output is correct |
35 |
Correct |
7 ms |
24924 KB |
Output is correct |
36 |
Correct |
6 ms |
24924 KB |
Output is correct |
37 |
Correct |
7 ms |
25088 KB |
Output is correct |
38 |
Correct |
120 ms |
121184 KB |
Output is correct |
39 |
Correct |
126 ms |
121168 KB |
Output is correct |
40 |
Correct |
8 ms |
25180 KB |
Output is correct |
41 |
Correct |
7 ms |
25136 KB |
Output is correct |
42 |
Correct |
7 ms |
25180 KB |
Output is correct |
43 |
Correct |
7 ms |
25180 KB |
Output is correct |
44 |
Correct |
9 ms |
25948 KB |
Output is correct |
45 |
Correct |
8 ms |
25888 KB |
Output is correct |
46 |
Correct |
8 ms |
25944 KB |
Output is correct |
47 |
Correct |
8 ms |
25836 KB |
Output is correct |
48 |
Correct |
179 ms |
121340 KB |
Output is correct |
49 |
Correct |
191 ms |
123808 KB |
Output is correct |
50 |
Correct |
140 ms |
123732 KB |
Output is correct |
51 |
Correct |
145 ms |
123652 KB |
Output is correct |
52 |
Correct |
7 ms |
24920 KB |
Output is correct |
53 |
Correct |
7 ms |
24912 KB |
Output is correct |
54 |
Correct |
7 ms |
24924 KB |
Output is correct |
55 |
Correct |
6 ms |
24920 KB |
Output is correct |
56 |
Correct |
7 ms |
24904 KB |
Output is correct |
57 |
Correct |
7 ms |
24920 KB |
Output is correct |
58 |
Correct |
8 ms |
24924 KB |
Output is correct |
59 |
Correct |
9 ms |
24924 KB |
Output is correct |
60 |
Correct |
6 ms |
24924 KB |
Output is correct |
61 |
Correct |
7 ms |
25100 KB |
Output is correct |
62 |
Correct |
8 ms |
24924 KB |
Output is correct |
63 |
Correct |
8 ms |
24924 KB |
Output is correct |
64 |
Correct |
7 ms |
24912 KB |
Output is correct |
65 |
Correct |
8 ms |
24920 KB |
Output is correct |
66 |
Correct |
54 ms |
30536 KB |
Output is correct |
67 |
Correct |
49 ms |
30312 KB |
Output is correct |
68 |
Correct |
48 ms |
30292 KB |
Output is correct |
69 |
Correct |
51 ms |
30548 KB |
Output is correct |
70 |
Correct |
7 ms |
24924 KB |
Output is correct |
71 |
Correct |
7 ms |
24924 KB |
Output is correct |
72 |
Correct |
8 ms |
25180 KB |
Output is correct |
73 |
Correct |
7 ms |
25192 KB |
Output is correct |
74 |
Correct |
87 ms |
43752 KB |
Output is correct |
75 |
Correct |
84 ms |
34648 KB |
Output is correct |
76 |
Correct |
7 ms |
24924 KB |
Output is correct |
77 |
Correct |
7 ms |
24984 KB |
Output is correct |
78 |
Correct |
7 ms |
24924 KB |
Output is correct |
79 |
Correct |
7 ms |
24924 KB |
Output is correct |
80 |
Correct |
7 ms |
24920 KB |
Output is correct |
81 |
Correct |
7 ms |
24924 KB |
Output is correct |
82 |
Correct |
7 ms |
24920 KB |
Output is correct |
83 |
Correct |
7 ms |
24924 KB |
Output is correct |
84 |
Correct |
6 ms |
24924 KB |
Output is correct |
85 |
Correct |
7 ms |
24976 KB |
Output is correct |
86 |
Correct |
6 ms |
24924 KB |
Output is correct |
87 |
Correct |
10 ms |
25948 KB |
Output is correct |
88 |
Correct |
8 ms |
25948 KB |
Output is correct |
89 |
Correct |
8 ms |
25948 KB |
Output is correct |
90 |
Correct |
7 ms |
26024 KB |
Output is correct |
91 |
Correct |
11 ms |
26148 KB |
Output is correct |
92 |
Correct |
12 ms |
25180 KB |
Output is correct |
93 |
Correct |
9 ms |
25180 KB |
Output is correct |
94 |
Correct |
8 ms |
25244 KB |
Output is correct |
95 |
Correct |
8 ms |
25180 KB |
Output is correct |
96 |
Correct |
9 ms |
25180 KB |
Output is correct |
97 |
Correct |
10 ms |
25180 KB |
Output is correct |
98 |
Correct |
8 ms |
25176 KB |
Output is correct |
99 |
Correct |
9 ms |
25448 KB |
Output is correct |
100 |
Correct |
9 ms |
25372 KB |
Output is correct |
101 |
Correct |
11 ms |
25436 KB |
Output is correct |
102 |
Correct |
11 ms |
25176 KB |
Output is correct |
103 |
Correct |
8 ms |
25180 KB |
Output is correct |
104 |
Correct |
8 ms |
25168 KB |
Output is correct |
105 |
Correct |
9 ms |
25180 KB |
Output is correct |
106 |
Correct |
8 ms |
25176 KB |
Output is correct |
107 |
Correct |
8 ms |
25176 KB |
Output is correct |
108 |
Correct |
8 ms |
25120 KB |
Output is correct |
109 |
Correct |
7 ms |
25432 KB |
Output is correct |
110 |
Correct |
10 ms |
25176 KB |
Output is correct |
111 |
Correct |
207 ms |
121372 KB |
Output is correct |
112 |
Correct |
160 ms |
122948 KB |
Output is correct |
113 |
Correct |
157 ms |
123004 KB |
Output is correct |
114 |
Correct |
166 ms |
123020 KB |
Output is correct |
115 |
Execution timed out |
2063 ms |
94396 KB |
Time limit exceeded |
116 |
Halted |
0 ms |
0 KB |
- |