QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212109#4589. White-Black Treeucup-team1004#AC ✓22ms10092kbC++141.0kb2023-10-13 09:06:582023-10-13 09:06:59

Judging History

你现在查看的是最新测评结果

  • [2023-10-13 09:06:59]
  • 评测
  • 测评结果:AC
  • 用时:22ms
  • 内存:10092kb
  • [2023-10-13 09:06:58]
  • 提交

answer

#include<bits/stdc++.h>
#define Gc() getchar() 
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;using LL=__int128;
const int N=1e5+5,M=(1<<20)+5,K=600+5,mod=1e9+7,Mod=mod-1;const db eps=1e-6;const ll INF=1e18+7;mt19937 rnd(263082);
int n,d[N],f[N];vector<int> S[N];
void Solve(){
	int i,j;scanf("%d",&n);
	for(i=2;i<=n;i++) {int x;scanf("%d",&x);S[x].emplace_back(i);}
	for(i=n;i;i--){
		for(int j:S[i]) d[i]=max(d[i],d[j]+1);
	}
	int ans=0;for(i=1;i<=n;i++) {int x;scanf("%d",&x);if(x) f[d[i]]^=1;}
	for(i=0;i<=n;i++) if(f[i]){puts("First");return;}
	puts("Second");
}
int main(){
	int t=1;
	// scanf("%d",&t);
	while(t--) Solve();
	cerr<<clock()*1.0/CLOCKS_PER_SEC<<'\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 6092kb

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: 1ms
memory: 6128kb

input:

5
1 1 2 3
0 1 1 0 0

output:

Second

result:

ok single line: 'Second'

Test #3:

score: 0
Accepted
time: 2ms
memory: 6092kb

input:

4
1 1 1
1 1 0 1

output:

First

result:

ok single line: 'First'

Test #4:

score: 0
Accepted
time: 0ms
memory: 6352kb

input:

2
1
0 0

output:

Second

result:

ok single line: 'Second'

Test #5:

score: 0
Accepted
time: 1ms
memory: 6124kb

input:

3
1 2
0 1 1

output:

First

result:

ok single line: 'First'

Test #6:

score: 0
Accepted
time: 2ms
memory: 6204kb

input:

3
1 2
1 1 1

output:

First

result:

ok single line: 'First'

Test #7:

score: 0
Accepted
time: 2ms
memory: 6116kb

input:

3
1 1
1 1 1

output:

First

result:

ok single line: 'First'

Test #8:

score: 0
Accepted
time: 1ms
memory: 6116kb

input:

3
1 1
0 1 0

output:

First

result:

ok single line: 'First'

Test #9:

score: 0
Accepted
time: 0ms
memory: 6200kb

input:

3
1 1
0 1 1

output:

Second

result:

ok single line: 'Second'

Test #10:

score: 0
Accepted
time: 1ms
memory: 6660kb

input:

4
1 1 2
0 1 1 0

output:

First

result:

ok single line: 'First'

Test #11:

score: 0
Accepted
time: 2ms
memory: 6156kb

input:

4
1 1 1
0 1 1 1

output:

First

result:

ok single line: 'First'

Test #12:

score: 0
Accepted
time: 1ms
memory: 6204kb

input:

4
1 2 3
0 1 0 1

output:

First

result:

ok single line: 'First'

Test #13:

score: 0
Accepted
time: 1ms
memory: 6084kb

input:

5
1 1 2 2
0 1 1 1 1

output:

First

result:

ok single line: 'First'

Test #14:

score: 0
Accepted
time: 1ms
memory: 6084kb

input:

5
1 1 2 2
0 0 1 0 1

output:

Second

result:

ok single line: 'Second'

Test #15:

score: 0
Accepted
time: 0ms
memory: 6036kb

input:

2
1
1 0

output:

First

result:

ok single line: 'First'

Test #16:

score: 0
Accepted
time: 1ms
memory: 6456kb

input:

5
1 1 2 2
0 1 1 0 0

output:

First

result:

ok single line: 'First'

Test #17:

score: 0
Accepted
time: 0ms
memory: 6132kb

input:

5
1 1 1 2
0 1 1 1 1

output:

First

result:

ok single line: 'First'

Test #18:

score: 0
Accepted
time: 1ms
memory: 6156kb

input:

5
1 1 1 2
0 1 1 1 1

output:

First

result:

ok single line: 'First'

Test #19:

score: 0
Accepted
time: 0ms
memory: 6128kb

input:

5
1 1 2 3
0 1 1 1 1

output:

Second

result:

ok single line: 'Second'

Test #20:

score: 0
Accepted
time: 1ms
memory: 6576kb

input:

5
1 1 2 3
0 1 1 1 0

output:

First

result:

ok single line: 'First'

Test #21:

score: 0
Accepted
time: 0ms
memory: 6032kb

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: 1ms
memory: 6124kb

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: 0ms
memory: 6412kb

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: 1ms
memory: 6716kb

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: 1ms
memory: 6056kb

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: 1ms
memory: 6184kb

input:

2
1
0 1

output:

First

result:

ok single line: 'First'

Test #27:

score: 0
Accepted
time: 1ms
memory: 6192kb

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: 0ms
memory: 6160kb

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: 2ms
memory: 6088kb

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: 1ms
memory: 6228kb

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: 1ms
memory: 6384kb

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: 1ms
memory: 6124kb

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: 0ms
memory: 6284kb

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: 14ms
memory: 8472kb

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: 11ms
memory: 7956kb

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: 16ms
memory: 7792kb

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: 1ms
memory: 6172kb

input:

2
1
1 1

output:

First

result:

ok single line: 'First'

Test #38:

score: 0
Accepted
time: 12ms
memory: 7916kb

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: 11ms
memory: 7264kb

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: 5ms
memory: 7712kb

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: 3ms
memory: 7288kb

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: 11ms
memory: 7272kb

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: 11ms
memory: 7328kb

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: 10ms
memory: 7240kb

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: 10ms
memory: 7728kb

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: 11ms
memory: 9552kb

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: 13ms
memory: 9992kb

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: 0ms
memory: 6084kb

input:

3
1 2
1 0 0

output:

First

result:

ok single line: 'First'

Test #49:

score: 0
Accepted
time: 11ms
memory: 6620kb

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: 11ms
memory: 6484kb

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: 15ms
memory: 8960kb

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: 19ms
memory: 8536kb

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: 18ms
memory: 8460kb

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: 18ms
memory: 8460kb

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: 21ms
memory: 8096kb

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: 17ms
memory: 10092kb

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: 14ms
memory: 8500kb

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: 13ms
memory: 7460kb

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: 1ms
memory: 6088kb

input:

3
1 2
0 1 0

output:

First

result:

ok single line: 'First'

Test #60:

score: 0
Accepted
time: 15ms
memory: 8852kb

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: 11ms
memory: 7052kb

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: 18ms
memory: 8548kb

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: 17ms
memory: 9988kb

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: 18ms
memory: 8540kb

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: 12ms
memory: 7244kb

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: 9ms
memory: 8852kb

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: 13ms
memory: 7048kb

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: 12ms
memory: 8088kb

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: 16ms
memory: 10024kb

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: 1ms
memory: 6120kb

input:

3
1 2
1 1 0

output:

First

result:

ok single line: 'First'

Test #71:

score: 0
Accepted
time: 10ms
memory: 8924kb

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: 9ms
memory: 6724kb

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: 18ms
memory: 8772kb

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: 9ms
memory: 7416kb

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: 13ms
memory: 8184kb

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: 17ms
memory: 9928kb

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: 18ms
memory: 8400kb

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: 12ms
memory: 6776kb

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: 18ms
memory: 8948kb

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: 14ms
memory: 7164kb

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: 0ms
memory: 6196kb

input:

3
1 2
0 0 1

output:

First

result:

ok single line: 'First'

Test #82:

score: 0
Accepted
time: 22ms
memory: 8360kb

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: 16ms
memory: 9992kb

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: 11ms
memory: 8532kb

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: 12ms
memory: 6772kb

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: 16ms
memory: 8824kb

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: 9ms
memory: 7432kb

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: 19ms
memory: 8904kb

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: 16ms
memory: 8232kb

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: 16ms
memory: 7852kb

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: 7ms
memory: 6968kb

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: 1ms
memory: 6172kb

input:

3
1 2
1 0 1

output:

First

result:

ok single line: 'First'

Test #93:

score: 0
Accepted
time: 11ms
memory: 6292kb

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'