QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#44505 | #4589. White-Black Tree | triple__a# | AC ✓ | 37ms | 34596kb | C++ | 11.6kb | 2022-08-18 16:44:56 | 2022-08-18 16:44:57 |
Judging History
answer
// #pragma comment(linker, "/STACK:102400000,102400000")
#pragma GCC optimize("O3")
#pragma GCC optimize("O2")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
// #pragma GCC optimize("trapv")
#include<bits/stdc++.h>
// #include <bits/extc++.h>
#define int long long
#define double long double
// #define i128 long long
// #define double long double
using namespace std;
#define rep(i,n) for (int i=0;i<(int)(n);++i)
#define rep1(i,n) for (int i=1;i<=(int)(n);++i)
#define range(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define F first
#define S second
typedef long long ll;
typedef unsigned long long ull;
// typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
namespace internal {
// @param n `0 <= n`
// @return minimum non-negative `x` s.t. `n <= 2**x`
int ceil_pow2(int n) {
int x = 0;
while ((1U << x) < (unsigned int)(n)) x++;
return x;
}
// @param n `1 <= n`
// @return minimum non-negative `x` s.t. `(n & (1 << x)) != 0`
// constexpr int bsf_constexpr(unsigned int n) {
// int x = 0;
// while (!(n & (1 << x))) x++;
// return x;
// }
// @param n `1 <= n`
// @return minimum non-negative `x` s.t. `(n & (1 << x)) != 0`
int bsf(unsigned int n) {
#ifdef _MSC_VER
unsigned long index;
_BitScanForward(&index, n);
return index;
#else
return __builtin_ctz(n);
#endif
}
} // namespace internal
template <class S,
S (*op)(S, S),
S (*e)(),
class F,
S (*mapping)(F, S),
F (*composition)(F, F),
F (*id)()>
struct lazy_segtree {
public:
lazy_segtree() : lazy_segtree(0) {}
explicit lazy_segtree(int n) : lazy_segtree(std::vector<S>(n, e())) {}
explicit lazy_segtree(const std::vector<S>& v) : _n((int)(v.size())) {
log = internal::ceil_pow2(_n);
size = 1 << log;
d = std::vector<S>(2 * size, e());
lz = std::vector<F>(size, id());
for (int i = 0; i < _n; i++) d[size + i] = v[i];
for (int i = size - 1; i >= 1; i--) {
update(i);
}
}
void set(int p, S x) {
assert(0 <= p && p < _n);
p += size;
for (int i = log; i >= 1; i--) push(p >> i);
d[p] = x;
for (int i = 1; i <= log; i++) update(p >> i);
}
S get(int p) {
assert(0 <= p && p < _n);
p += size;
for (int i = log; i >= 1; i--) push(p >> i);
return d[p];
}
S prod(int l, int r) {
assert(0 <= l && l <= r && r <= _n);
if (l == r) return e();
l += size;
r += size;
for (int i = log; i >= 1; i--) {
if (((l >> i) << i) != l) push(l >> i);
if (((r >> i) << i) != r) push((r - 1) >> i);
}
S sml = e(), smr = e();
while (l < r) {
if (l & 1) sml = op(sml, d[l++]);
if (r & 1) smr = op(d[--r], smr);
l >>= 1;
r >>= 1;
}
return op(sml, smr);
}
S all_prod() { return d[1]; }
void apply(int p, F f) {
assert(0 <= p && p < _n);
p += size;
for (int i = log; i >= 1; i--) push(p >> i);
d[p] = mapping(f, d[p]);
for (int i = 1; i <= log; i++) update(p >> i);
}
void apply(int l, int r, F f) {
assert(0 <= l && l <= r && r <= _n);
if (l == r) return;
l += size;
r += size;
for (int i = log; i >= 1; i--) {
if (((l >> i) << i) != l) push(l >> i);
if (((r >> i) << i) != r) push((r - 1) >> i);
}
{
int l2 = l, r2 = r;
while (l < r) {
if (l & 1) all_apply(l++, f);
if (r & 1) all_apply(--r, f);
l >>= 1;
r >>= 1;
}
l = l2;
r = r2;
}
for (int i = 1; i <= log; i++) {
if (((l >> i) << i) != l) update(l >> i);
if (((r >> i) << i) != r) update((r - 1) >> i);
}
}
template <bool (*g)(S)> int max_right(int l) {
return max_right(l, [](S x) { return g(x); });
}
template <class G> int max_right(int l, G g) {
assert(0 <= l && l <= _n);
assert(g(e()));
if (l == _n) return _n;
l += size;
for (int i = log; i >= 1; i--) push(l >> i);
S sm = e();
do {
while (l % 2 == 0) l >>= 1;
if (!g(op(sm, d[l]))) {
while (l < size) {
push(l);
l = (2 * l);
if (g(op(sm, d[l]))) {
sm = op(sm, d[l]);
l++;
}
}
return l - size;
}
sm = op(sm, d[l]);
l++;
} while ((l & -l) != l);
return _n;
}
template <bool (*g)(S)> int min_left(int r) {
return min_left(r, [](S x) { return g(x); });
}
template <class G> int min_left(int r, G g) {
assert(0 <= r && r <= _n);
assert(g(e()));
if (r == 0) return 0;
r += size;
for (int i = log; i >= 1; i--) push((r - 1) >> i);
S sm = e();
do {
r--;
while (r > 1 && (r % 2)) r >>= 1;
if (!g(op(d[r], sm))) {
while (r < size) {
push(r);
r = (2 * r + 1);
if (g(op(d[r], sm))) {
sm = op(d[r], sm);
r--;
}
}
return r + 1 - size;
}
sm = op(d[r], sm);
} while ((r & -r) != r);
return 0;
}
private:
int _n, size, log;
std::vector<S> d;
std::vector<F> lz;
void update(int k) { d[k] = op(d[2 * k], d[2 * k + 1]); }
void all_apply(int k, F f) {
d[k] = mapping(f, d[k]);
if (k < size) lz[k] = composition(f, lz[k]);
}
void push(int k) {
all_apply(2 * k, lz[k]);
all_apply(2 * k + 1, lz[k]);
lz[k] = id();
}
};
struct SplayTree {
struct Node {
int ch[2] = {0, 0}, p = 0;
long long self = 0, path = 0; // Path aggregates
long long sub = 0, vir = 0; // Subtree aggregates
bool flip = 0; // Lazy tags
};
vector<Node> T;
SplayTree(int n) : T(n + 1) {}
void push(int x) {
if (!x || !T[x].flip) return;
int l = T[x].ch[0], r = T[x].ch[1];
T[l].flip ^= 1, T[r].flip ^= 1;
swap(T[x].ch[0], T[x].ch[1]);
T[x].flip = 0;
}
void pull(int x) {
int l = T[x].ch[0], r = T[x].ch[1]; push(l); push(r);
T[x].path = T[l].path + T[x].self + T[r].path;
T[x].sub = T[x].vir + T[l].sub + T[r].sub + T[x].self;
}
void set(int x, int d, int y) {
T[x].ch[d] = y; T[y].p = x; pull(x);
}
void splay(int x) {
auto dir = [&](int x) {
int p = T[x].p; if (!p) return -1;
return T[p].ch[0] == x ? 0 : T[p].ch[1] == x ? 1 : -1;
};
auto rotate = [&](int x) {
int y = T[x].p, z = T[y].p, dx = dir(x), dy = dir(y);
set(y, dx, T[x].ch[!dx]);
set(x, !dx, y);
if (~dy) set(z, dy, x);
T[x].p = z;
};
for (push(x); ~dir(x); ) {
int y = T[x].p, z = T[y].p;
push(z); push(y); push(x);
int dx = dir(x), dy = dir(y);
if (~dy) rotate(dx != dy ? x : y);
rotate(x);
}
}
};
struct LinkCut : SplayTree {
LinkCut(int n) : SplayTree(n) {}
int access(int x) {
int u = x, v = 0;
for (; u; v = u, u = T[u].p) {
splay(u);
int& ov = T[u].ch[1];
T[u].vir += T[ov].sub;
T[u].vir -= T[v].sub;
ov = v; pull(u);
}
return splay(x), v;
}
void reroot(int x) {
access(x); T[x].flip ^= 1; push(x);
}
void Link(int u, int v) {
reroot(u); access(v);
T[v].vir += T[u].sub;
T[u].p = v; pull(v);
}
void Cut(int u, int v) {
reroot(u); access(v);
T[v].ch[0] = T[u].p = 0; pull(v);
}
// Rooted tree LCA. Returns 0 if u and v arent connected.
int LCA(int u, int v) {
if (u == v) return u;
access(u); int ret = access(v);
return T[u].p ? ret : 0;
}
// Query subtree of u where v is outside the subtree.
long long Subtree(int u, int v) {
reroot(v); access(u); return T[u].vir + T[u].self;
}
// Query path [u..v]
long long Path(int u, int v) {
reroot(u); access(v); return T[v].path;
}
// Update vertex u with value v
void Update(int u, long long v) {
access(u); T[u].self = v; pull(u);
}
};
bool dfs(int a, int L, vector<vi>& g, vi& btoa, vi& A, vi& B) {
if (A[a] != L) return 0;
A[a] = -1;
for (int b : g[a]) if (B[b] == L + 1) {
B[b] = 0;
if (btoa[b] == -1 || dfs(btoa[b], L + 1, g, btoa, A, B))
return btoa[b] = a, 1;
}
return 0;
}
int hopcroftKarp(vector<vi>& g, vi& btoa) {
int res = 0;
vi A(g.size()), B(btoa.size()), cur, next;
for (;;) {
fill(range(A), 0);
fill(range(B), 0);
/// Find the starting nodes for BFS (i.e. layer 0).
cur.clear();
for (int a : btoa) if(a != -1) A[a] = -1;
rep(a,sz(g)) if(A[a] == 0) cur.push_back(a);
/// Find all layers using bfs.
for (int lay = 1;; lay++) {
bool islast = 0;
next.clear();
for (int a : cur) for (int b : g[a]) {
if (btoa[b] == -1) {
B[b] = lay;
islast = 1;
}
else if (btoa[b] != a && !B[b]) {
B[b] = lay;
next.push_back(btoa[b]);
}
}
if (islast) break;
if (next.empty()) return res;
for (int a : next) A[a] = lay;
cur.swap(next);
}
/// Use DFS to scan for augmenting paths.
rep(a,sz(g))
res += dfs(a, 0, g, btoa, A, B);
}
}
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
const int mod=998244353;
const int base[]={12321,32123};
const double EPS=1e-9;
const double pi=acos(-1);
const int INF=1e18;
const int N=1000007;
mt19937 rng(1235);
int modpow(int u,int v){
int ans=1, t=u;
while (v){
if (v&1) ans=ans*t%mod;
t=t*t%mod, v>>=1;
}
return ans;
}
// tuple<int,vi,vector<vi>> gauss(vector<vi> a)//sum = a[i][m]
// {
// int n=a.size(),m=a[0].size()-1,i,j,k,l,R=m;
// vi fix(m,-1);
// for (i=l=0;i<m;i++)
// {
// for (j=l;j<n;j++) if (a[j][i]) break;
// if (j==n) continue;
// fix[i]=l;--R;
// swap(a[l],a[j]);
// int x=modpow(a[l][i],mod-2);
// for (k=i;k<=m;k++) a[l][k]=(ll)a[l][k]*x%mod;
// for (auto &v:a) if (v.data()!=a[l].data())
// {
// x=mod-v[i];
// for (k=m;k>=i;k--) v[k]=(v[k]+(ll)x*a[l][k])%mod;
// }
// ++l;
// }
// for (i=l;i<n;i++) if (a[i][m]) return {-1,{},{}};
// vi r(m);
// vector<vi> c;
// for (i=0;i<m;i++) if (fix[i]!=-1) r[i]=a[fix[i]][m];
// for (i=0;i<m;i++) if (fix[i]==-1)
// {
// vi r(m);
// r[i]=1;
// for (j=0;j<m;j++) if (fix[j]!=-1) r[j]=(mod-a[fix[j]][i])%mod;
// c.push_back(r);
// }
// return {R,r,c};
// }
int n,k,d;
int h[N];
int cnt[N];
vi g[N];
void dfs(int u,int p){
for (auto c:g[u]){
dfs(c,u);
h[u]=max(h[u],h[c]+1);
}
}
signed main(){
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cout.precision(15);
cin>>n;
rep1(i,n-1){
int u;
cin>>u; u--;
g[u].pb(i);
}
dfs(0,-1);
rep(i,n){
int w;
cin>>w;
if (w) cnt[h[i]]++;
}
for (int i=0;i<=100000;++i){
if (cnt[i]&1) {cout<<"First\n"; return 0;}
}
cout<<"Second";
return 0;
}
/*
7
1 1 1 3 3 3
0 1 1 0 0 0 1
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 8ms
memory: 27012kb
input:
7 1 1 1 3 3 3 0 1 1 0 0 0 1
output:
First
result:
ok single line: 'First'
Test #2:
score: 0
Accepted
time: 4ms
memory: 27188kb
input:
5 1 1 2 3 0 1 1 0 0
output:
Second
result:
ok single line: 'Second'
Test #3:
score: 0
Accepted
time: 4ms
memory: 27040kb
input:
4 1 1 1 1 1 0 1
output:
First
result:
ok single line: 'First'
Test #4:
score: 0
Accepted
time: 8ms
memory: 27204kb
input:
2 1 0 0
output:
Second
result:
ok single line: 'Second'
Test #5:
score: 0
Accepted
time: 4ms
memory: 27112kb
input:
3 1 2 0 1 1
output:
First
result:
ok single line: 'First'
Test #6:
score: 0
Accepted
time: 2ms
memory: 27124kb
input:
3 1 2 1 1 1
output:
First
result:
ok single line: 'First'
Test #7:
score: 0
Accepted
time: 8ms
memory: 26976kb
input:
3 1 1 1 1 1
output:
First
result:
ok single line: 'First'
Test #8:
score: 0
Accepted
time: 1ms
memory: 27036kb
input:
3 1 1 0 1 0
output:
First
result:
ok single line: 'First'
Test #9:
score: 0
Accepted
time: 7ms
memory: 27192kb
input:
3 1 1 0 1 1
output:
Second
result:
ok single line: 'Second'
Test #10:
score: 0
Accepted
time: 8ms
memory: 27200kb
input:
4 1 1 2 0 1 1 0
output:
First
result:
ok single line: 'First'
Test #11:
score: 0
Accepted
time: 5ms
memory: 27028kb
input:
4 1 1 1 0 1 1 1
output:
First
result:
ok single line: 'First'
Test #12:
score: 0
Accepted
time: 10ms
memory: 27036kb
input:
4 1 2 3 0 1 0 1
output:
First
result:
ok single line: 'First'
Test #13:
score: 0
Accepted
time: 4ms
memory: 27036kb
input:
5 1 1 2 2 0 1 1 1 1
output:
First
result:
ok single line: 'First'
Test #14:
score: 0
Accepted
time: 10ms
memory: 27036kb
input:
5 1 1 2 2 0 0 1 0 1
output:
Second
result:
ok single line: 'Second'
Test #15:
score: 0
Accepted
time: 4ms
memory: 27036kb
input:
2 1 1 0
output:
First
result:
ok single line: 'First'
Test #16:
score: 0
Accepted
time: 8ms
memory: 27008kb
input:
5 1 1 2 2 0 1 1 0 0
output:
First
result:
ok single line: 'First'
Test #17:
score: 0
Accepted
time: 5ms
memory: 27120kb
input:
5 1 1 1 2 0 1 1 1 1
output:
First
result:
ok single line: 'First'
Test #18:
score: 0
Accepted
time: 8ms
memory: 26976kb
input:
5 1 1 1 2 0 1 1 1 1
output:
First
result:
ok single line: 'First'
Test #19:
score: 0
Accepted
time: 4ms
memory: 27184kb
input:
5 1 1 2 3 0 1 1 1 1
output:
Second
result:
ok single line: 'Second'
Test #20:
score: 0
Accepted
time: 8ms
memory: 27112kb
input:
5 1 1 2 3 0 1 1 1 0
output:
First
result:
ok single line: 'First'
Test #21:
score: 0
Accepted
time: 2ms
memory: 27204kb
input:
6 1 1 1 3 3 0 1 0 1 1 1
output:
Second
result:
ok single line: 'Second'
Test #22:
score: 0
Accepted
time: 4ms
memory: 27036kb
input:
6 1 1 1 3 3 0 1 1 0 1 1
output:
First
result:
ok single line: 'First'
Test #23:
score: 0
Accepted
time: 10ms
memory: 27032kb
input:
8 1 2 3 4 5 6 7 0 1 1 1 1 1 1 1
output:
First
result:
ok single line: 'First'
Test #24:
score: 0
Accepted
time: 8ms
memory: 27116kb
input:
10 1 1 1 2 3 4 5 6 7 0 1 1 1 1 1 1 1 1 1
output:
First
result:
ok single line: 'First'
Test #25:
score: 0
Accepted
time: 5ms
memory: 26980kb
input:
15 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1
output:
First
result:
ok single line: 'First'
Test #26:
score: 0
Accepted
time: 3ms
memory: 27012kb
input:
2 1 0 1
output:
First
result:
ok single line: 'First'
Test #27:
score: 0
Accepted
time: 4ms
memory: 27016kb
input:
13 1 1 1 2 3 4 5 6 7 8 9 10 0 1 1 1 1 1 1 1 1 1 1 1 1
output:
First
result:
ok single line: 'First'
Test #28:
score: 0
Accepted
time: 8ms
memory: 27192kb
input:
32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
First
result:
ok single line: 'First'
Test #29:
score: 0
Accepted
time: 8ms
memory: 27036kb
input:
33 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
First
result:
ok single line: 'First'
Test #30:
score: 0
Accepted
time: 12ms
memory: 27044kb
input:
34 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
First
result:
ok single line: 'First'
Test #31:
score: 0
Accepted
time: 8ms
memory: 27060kb
input:
256 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...
output:
First
result:
ok single line: 'First'
Test #32:
score: 0
Accepted
time: 6ms
memory: 27004kb
input:
257 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...
output:
First
result:
ok single line: 'First'
Test #33:
score: 0
Accepted
time: 4ms
memory: 27064kb
input:
258 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...
output:
First
result:
ok single line: 'First'
Test #34:
score: 0
Accepted
time: 31ms
memory: 29768kb
input:
100000 1 2 3 4 4 6 4 7 4 7 8 5 6 5 14 1 17 5 8 10 17 18 13 12 15 11 25 24 3 11 3 21 1 13 30 35 29 6 34 35 41 20 35 36 21 24 37 33 6 37 33 31 8 30 52 43 30 7 25 29 17 12 49 48 30 15 39 10 2 23 44 11 45 17 47 30 73 71 54 36 30 51 37 76 60 9 6 86 60 59 62 16 20 34 13 73 31 60 37 33 58 4 46 66 104 102 1...
output:
First
result:
ok single line: 'First'
Test #35:
score: 0
Accepted
time: 10ms
memory: 29072kb
input:
99999 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
Second
result:
ok single line: 'Second'
Test #36:
score: 0
Accepted
time: 20ms
memory: 28996kb
input:
99999 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
Second
result:
ok single line: 'Second'
Test #37:
score: 0
Accepted
time: 11ms
memory: 27112kb
input:
2 1 1 1
output:
First
result:
ok single line: 'First'
Test #38:
score: 0
Accepted
time: 15ms
memory: 28936kb
input:
99999 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
First
result:
ok single line: 'First'
Test #39:
score: 0
Accepted
time: 15ms
memory: 28312kb
input:
65535 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
First
result:
ok single line: 'First'
Test #40:
score: 0
Accepted
time: 13ms
memory: 28404kb
input:
65535 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
Second
result:
ok single line: 'Second'
Test #41:
score: 0
Accepted
time: 17ms
memory: 28384kb
input:
65535 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
First
result:
ok single line: 'First'
Test #42:
score: 0
Accepted
time: 18ms
memory: 28404kb
input:
65535 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
First
result:
ok single line: 'First'
Test #43:
score: 0
Accepted
time: 26ms
memory: 28472kb
input:
65535 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
Second
result:
ok single line: 'Second'
Test #44:
score: 0
Accepted
time: 16ms
memory: 28400kb
input:
65535 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
Second
result:
ok single line: 'Second'
Test #45:
score: 0
Accepted
time: 14ms
memory: 28396kb
input:
65535 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
output:
First
result:
ok single line: 'First'
Test #46:
score: 0
Accepted
time: 22ms
memory: 33668kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
Second
result:
ok single line: 'Second'
Test #47:
score: 0
Accepted
time: 19ms
memory: 34596kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
First
result:
ok single line: 'First'
Test #48:
score: 0
Accepted
time: 2ms
memory: 27036kb
input:
3 1 2 1 0 0
output:
First
result:
ok single line: 'First'
Test #49:
score: 0
Accepted
time: 14ms
memory: 27704kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #50:
score: 0
Accepted
time: 24ms
memory: 27568kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
Second
result:
ok single line: 'Second'
Test #51:
score: 0
Accepted
time: 33ms
memory: 30024kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
Second
result:
ok single line: 'Second'
Test #52:
score: 0
Accepted
time: 24ms
memory: 29892kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
Second
result:
ok single line: 'Second'
Test #53:
score: 0
Accepted
time: 22ms
memory: 30028kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #54:
score: 0
Accepted
time: 25ms
memory: 30032kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #55:
score: 0
Accepted
time: 29ms
memory: 29804kb
input:
100000 1 1 2 2 2 6 7 8 2 4 8 12 5 4 2 3 7 12 3 14 8 17 3 13 22 7 7 24 7 18 17 5 3 33 33 31 9 36 11 10 32 15 3 29 27 15 46 2 21 12 27 47 44 17 16 30 50 26 30 14 12 10 51 12 3 46 29 4 8 56 12 49 12 28 67 28 72 9 8 9 45 51 27 82 29 10 86 72 75 55 52 89 14 92 64 52 8 80 58 67 36 30 7 100 43 92 24 10 90 ...
output:
First
result:
ok single line: 'First'
Test #56:
score: 0
Accepted
time: 21ms
memory: 34508kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
First
result:
ok single line: 'First'
Test #57:
score: 0
Accepted
time: 37ms
memory: 30096kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #58:
score: 0
Accepted
time: 19ms
memory: 27968kb
input:
100000 1 1 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14...
output:
First
result:
ok single line: 'First'
Test #59:
score: 0
Accepted
time: 4ms
memory: 27188kb
input:
3 1 2 0 1 0
output:
First
result:
ok single line: 'First'
Test #60:
score: 0
Accepted
time: 21ms
memory: 30296kb
input:
100000 1 1 3 4 5 6 7 7 9 10 11 12 13 13 15 16 17 17 19 20 21 22 23 16 25 26 5 28 29 11 3 18 33 34 34 35 36 38 39 40 41 42 43 44 45 43 42 41 44 46 51 52 52 54 54 53 57 58 58 60 59 60 63 62 59 55 67 68 69 70 71 67 73 74 72 76 77 78 76 68 80 81 83 83 85 86 23 88 89 90 37 92 93 93 92 96 96 97 99 100 101...
output:
First
result:
ok single line: 'First'
Test #61:
score: 0
Accepted
time: 20ms
memory: 28660kb
input:
100000 1 1 1 2 2 1 2 1 2 5 1 5 11 1 2 5 14 11 11 11 18 1 18 22 14 18 18 22 2 25 22 18 18 5 22 11 18 11 22 11 31 25 22 25 2 31 14 25 22 18 2 31 18 22 5 25 2 2 14 25 2 5 5 1 1 42 1 67 67 11 67 5 25 1 1 25 42 31 69 80 80 5 25 5 1 5 22 1 5 81 1 11 80 80 42 14 5 18 5 5 67 2 31 14 42 1 25 31 18 1 25 5 81 ...
output:
First
result:
ok single line: 'First'
Test #62:
score: 0
Accepted
time: 29ms
memory: 29656kb
input:
100000 1 1 2 3 3 6 1 2 6 3 7 1 9 12 10 5 4 5 19 2 7 10 7 24 13 19 16 16 21 28 30 28 4 9 13 6 20 30 31 11 34 37 25 32 9 2 38 31 40 36 50 1 23 45 41 30 50 28 31 11 8 30 8 20 12 13 28 26 12 7 30 31 69 44 49 21 10 7 21 73 72 66 8 7 25 65 4 57 71 20 67 31 11 85 60 66 14 45 17 35 34 78 10 26 17 9 83 40 9 ...
output:
First
result:
ok single line: 'First'
Test #63:
score: 0
Accepted
time: 13ms
memory: 34484kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
First
result:
ok single line: 'First'
Test #64:
score: 0
Accepted
time: 23ms
memory: 30092kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #65:
score: 0
Accepted
time: 5ms
memory: 27988kb
input:
100000 1 1 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14...
output:
First
result:
ok single line: 'First'
Test #66:
score: 0
Accepted
time: 23ms
memory: 30376kb
input:
100000 1 2 3 4 3 6 2 8 5 10 11 12 12 14 15 15 17 18 13 20 21 22 23 21 25 26 20 17 29 29 30 32 33 32 35 34 37 36 39 39 33 38 43 27 45 46 46 47 49 24 51 52 53 53 51 54 55 58 58 60 61 62 63 64 65 60 67 68 68 67 71 61 73 74 75 76 77 78 79 80 81 82 82 83 83 81 78 75 89 89 91 92 93 94 95 96 97 98 97 96 84...
output:
First
result:
ok single line: 'First'
Test #67:
score: 0
Accepted
time: 23ms
memory: 28576kb
input:
100000 1 1 1 1 1 1 1 2 9 10 11 9 10 10 2 12 17 12 18 17 9 12 20 24 12 24 9 1 10 11 11 9 11 25 11 17 20 24 20 35 20 35 10 2 2 18 2 2 41 24 11 20 9 17 35 10 18 17 41 50 17 1 35 35 9 17 1 20 12 10 17 35 2 17 24 11 41 41 18 20 9 17 12 12 17 25 9 24 41 20 17 17 41 11 9 20 61 9 98 98 98 50 100 20 10 25 17...
output:
First
result:
ok single line: 'First'
Test #68:
score: 0
Accepted
time: 23ms
memory: 29808kb
input:
100000 1 1 3 2 3 4 3 3 6 5 8 12 1 13 11 14 6 3 12 9 8 14 19 7 18 9 11 8 15 5 27 20 2 19 13 1 30 37 14 16 18 2 11 39 37 35 36 10 2 50 51 12 5 26 55 16 48 23 3 29 55 24 42 29 58 58 10 28 44 46 70 21 14 16 14 66 33 13 47 26 14 51 65 11 23 2 46 75 82 69 75 2 64 42 86 89 75 14 98 47 74 25 16 40 10 10 74 ...
output:
First
result:
ok single line: 'First'
Test #69:
score: 0
Accepted
time: 21ms
memory: 34500kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
First
result:
ok single line: 'First'
Test #70:
score: 0
Accepted
time: 4ms
memory: 27012kb
input:
3 1 2 1 1 0
output:
First
result:
ok single line: 'First'
Test #71:
score: 0
Accepted
time: 20ms
memory: 29940kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #72:
score: 0
Accepted
time: 24ms
memory: 27916kb
input:
100000 1 1 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14...
output:
First
result:
ok single line: 'First'
Test #73:
score: 0
Accepted
time: 28ms
memory: 30208kb
input:
100000 1 2 1 4 5 6 6 4 5 10 11 12 13 14 15 16 17 16 18 19 21 20 17 24 24 26 27 28 29 22 31 32 33 34 23 36 37 38 39 40 40 42 43 43 45 46 46 47 49 50 51 51 53 53 55 54 56 55 59 60 60 61 50 49 62 66 66 67 69 70 71 58 36 74 75 74 75 76 79 41 81 81 83 67 85 57 73 84 89 88 90 92 93 94 95 95 97 98 99 97 10...
output:
First
result:
ok single line: 'First'
Test #74:
score: 0
Accepted
time: 22ms
memory: 28584kb
input:
100000 1 1 2 1 1 1 1 2 1 1 2 2 4 2 1 2 2 14 19 14 20 19 1 14 19 2 19 20 1 14 22 20 22 2 1 19 32 4 19 32 20 2 1 22 14 19 38 22 20 2 32 38 1 38 22 22 32 20 14 4 14 19 32 20 32 1 48 48 22 1 68 20 48 72 1 68 19 2 20 75 32 32 72 22 48 75 1 38 72 19 38 4 75 19 75 72 1 19 1 48 22 2 22 19 72 14 72 19 32 14 ...
output:
First
result:
ok single line: 'First'
Test #75:
score: 0
Accepted
time: 17ms
memory: 29688kb
input:
100000 1 2 3 1 4 2 1 8 5 6 8 5 13 6 6 2 4 17 9 9 1 10 11 14 7 7 12 15 17 18 18 29 23 11 11 14 31 2 6 14 40 3 35 42 14 39 42 37 46 37 32 27 26 14 19 50 31 41 14 46 3 61 53 24 61 43 52 28 6 4 51 13 61 21 21 38 39 22 15 42 2 63 31 12 14 32 25 47 38 57 49 77 58 1 16 8 3 3 28 71 79 71 37 70 89 48 46 94 2...
output:
First
result:
ok single line: 'First'
Test #76:
score: 0
Accepted
time: 23ms
memory: 34452kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
First
result:
ok single line: 'First'
Test #77:
score: 0
Accepted
time: 25ms
memory: 29936kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #78:
score: 0
Accepted
time: 11ms
memory: 27988kb
input:
100000 1 1 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14...
output:
First
result:
ok single line: 'First'
Test #79:
score: 0
Accepted
time: 22ms
memory: 30320kb
input:
100000 1 2 3 4 4 5 7 8 9 9 11 12 13 14 15 16 17 18 19 12 13 22 23 17 25 26 27 28 29 30 30 32 33 25 35 36 37 38 32 14 41 42 42 7 45 45 46 48 49 50 51 52 53 46 55 56 57 58 48 60 61 61 63 59 62 66 67 68 64 70 71 57 73 73 74 76 76 77 78 75 81 75 82 79 85 86 87 86 89 79 91 92 93 94 95 96 95 87 47 100 72 ...
output:
First
result:
ok single line: 'First'
Test #80:
score: 0
Accepted
time: 16ms
memory: 28636kb
input:
100000 1 1 1 1 2 2 6 2 2 8 6 8 6 2 11 1 6 6 8 2 16 22 1 22 16 6 16 11 8 6 2 1 1 23 16 22 2 8 6 23 8 2 6 1 16 16 1 6 11 8 8 16 16 8 11 35 57 6 58 22 58 60 8 63 35 8 35 65 69 69 63 6 8 16 60 8 1 57 23 2 6 16 2 60 16 1 60 11 2 16 69 69 58 70 23 1 63 65 57 60 8 65 8 1 69 63 8 57 11 23 60 1 1 8 95 95 60 ...
output:
First
result:
ok single line: 'First'
Test #81:
score: 0
Accepted
time: 4ms
memory: 27188kb
input:
3 1 2 0 0 1
output:
First
result:
ok single line: 'First'
Test #82:
score: 0
Accepted
time: 28ms
memory: 29804kb
input:
100000 1 1 3 3 2 5 3 3 9 1 6 2 1 5 9 4 10 7 5 19 14 2 7 9 11 20 1 7 8 9 4 13 31 12 32 11 4 19 29 35 6 17 43 12 15 15 27 24 11 7 39 31 35 33 27 11 33 36 13 57 47 56 16 7 41 47 66 15 16 29 61 48 56 13 34 64 19 70 38 9 70 3 49 62 58 71 58 81 64 72 50 2 23 62 61 85 29 60 27 64 47 19 38 103 19 47 23 95 1...
output:
First
result:
ok single line: 'First'
Test #83:
score: 0
Accepted
time: 28ms
memory: 34580kb
input:
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
First
result:
ok single line: 'First'
Test #84:
score: 0
Accepted
time: 30ms
memory: 30024kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #85:
score: 0
Accepted
time: 18ms
memory: 27908kb
input:
100000 1 1 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14...
output:
First
result:
ok single line: 'First'
Test #86:
score: 0
Accepted
time: 19ms
memory: 30280kb
input:
100000 1 1 3 4 5 5 3 8 9 2 11 12 13 9 13 10 17 18 19 20 4 22 23 24 25 26 26 28 29 30 31 27 33 25 35 36 37 38 39 40 40 42 42 44 45 32 47 47 49 50 51 48 30 54 55 56 57 55 33 35 60 62 61 64 65 64 67 68 69 70 70 71 73 74 74 76 69 78 79 80 81 78 83 84 80 86 87 88 89 90 89 92 72 94 94 22 97 98 99 100 100 ...
output:
First
result:
ok single line: 'First'
Test #87:
score: 0
Accepted
time: 25ms
memory: 28564kb
input:
100000 1 1 2 1 2 2 4 8 9 8 2 8 10 2 9 2 1 9 10 9 14 22 4 8 9 23 22 9 27 10 4 30 9 14 10 30 2 10 33 33 10 8 33 1 22 8 33 40 8 40 22 1 2 1 1 4 4 4 10 1 49 10 2 14 62 30 62 14 4 22 23 22 33 8 9 1 40 9 40 66 2 23 27 27 14 66 27 30 23 62 4 66 1 14 81 62 33 1 33 49 10 8 14 14 49 62 30 40 62 27 62 30 9 96 ...
output:
First
result:
ok single line: 'First'
Test #88:
score: 0
Accepted
time: 21ms
memory: 29948kb
input:
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
First
result:
ok single line: 'First'
Test #89:
score: 0
Accepted
time: 32ms
memory: 29796kb
input:
100000 1 1 3 4 2 5 7 4 9 5 4 11 4 1 9 15 12 14 9 7 9 3 19 17 7 26 6 18 25 29 27 19 27 11 8 26 21 17 7 30 10 34 16 18 6 17 47 41 37 31 1 6 51 48 37 31 57 30 41 27 53 39 43 40 20 44 35 38 2 17 29 51 34 27 40 17 32 65 23 10 53 9 33 58 52 50 66 78 7 8 63 48 10 80 41 86 31 9 18 29 32 95 15 97 57 46 1 4 8...
output:
First
result:
ok single line: 'First'
Test #90:
score: 0
Accepted
time: 30ms
memory: 29064kb
input:
100000 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...
output:
First
result:
ok single line: 'First'
Test #91:
score: 0
Accepted
time: 21ms
memory: 27768kb
input:
99999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
First
result:
ok single line: 'First'
Test #92:
score: 0
Accepted
time: 4ms
memory: 27200kb
input:
3 1 2 1 0 1
output:
First
result:
ok single line: 'First'
Test #93:
score: 0
Accepted
time: 22ms
memory: 27696kb
input:
99999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
Second
result:
ok single line: 'Second'