QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#869493#8615. Equal Stringsucup-team5008#AC ✓6ms3840kbC++20942b2025-01-25 10:20:472025-01-25 10:20:47

Judging History

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

  • [2025-01-25 10:20:47]
  • 评测
  • 测评结果:AC
  • 用时:6ms
  • 内存:3840kb
  • [2025-01-25 10:20:47]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define rep2(i,j,k) for(ll i=ll(j); i<ll(k); i++)
#define rep(i,j) rep2(i,0,j)
#define rrep2(i,j,k) for(ll i=ll(j)-1;i>=ll(k);i--)
#define rrep(i,j) rrep2(i,j,0)
#define SZ(a) ll(a.size())
#define all(a) a.begin(),a.end()
#define eb emplace_back
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using vp=vector<P>;
using vvp=vector<vp>;
const ll inf=LLONG_MAX/4;
template<typename T>
bool chmin(T& a,T b){return a>b?a=b,1:0;}
template<typename T>
bool chmax(T& a,T b){return a<b?a=b,1:0;}

int ask(int i, int j) {
	cout << i+1 << ' ' << j+1 << endl;
	int d;
	cin >> d;
	if(d == 0) exit(0);
	return d;
}

int main(){
	cin.tie(0)->sync_with_stdio(0);
	int n;
	cin >> n;
	vector<map<int,int>> ch(n);
	rep2(i, 1, n) {
		int r = 0;
		while(true) {
			int d = ask(r, i);
			if(ch[r].count(d)) {
				r = ch[r][d];
			} else {
				ch[r][d] = i;
				break;
			}
		}
	}
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

4
21
24
21
0

output:

1 2
1 3
1 4
2 4

result:

ok Found equal strings: 2, 4

Test #2:

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

input:

4
28
0

output:

1 2
1 3

result:

ok Found equal strings: 1, 3

Test #3:

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

input:

10
23
24
24
26
21
25
29
25
28
24
0

output:

1 2
1 3
1 4
3 4
1 5
1 6
1 7
1 8
6 8
1 9
3 9

result:

ok Found equal strings: 3, 9

Test #4:

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

input:

100
23
33
22
31
21
20
29
18
21
18
34
31
18
24
20
28
25
26
19
29
22
31
22
28
20
24
25
18
29
26
26
18
28
26
26
24
21
24
20
16
21
24
22
31
22
22
24
28
22
22
27
29
26
18
23
22
29
20
23
22
30
21
24
28
23
26
32
31
22
24
23
18
31
22
26
28
26
26
24
18
27
22
25
30
19
22
30
26
22
25
26
24
20
22
22
24
33
20
25...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
6 10
1 11
1 12
5 12
1 13
1 14
7 14
1 15
1 16
1 17
1 18
8 18
1 19
5 19
1 20
1 21
7 21
1 22
15 22
1 23
8 23
1 24
16 24
1 25
20 25
1 26
16 26
1 27
6 27
1 28
7 28
1 29
6 29
27 29
1 30
5 30
19 30
1 31
13 31
1 32
4 32
1 33
1 34
8 34
23 34
1 35
2 35
1 36
8 36
1 37
2 37
...

result:

ok Found equal strings: 62, 100

Test #5:

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

input:

500
27
26
25
25
20
26
22
30
21
26
28
29
24
22
25
20
26
26
26
25
28
26
28
26
22
30
25
20
26
22
19
23
23
26
26
26
22
23
28
26
32
27
28
28
24
28
27
30
25
30
28
22
25
26
24
26
30
20
21
22
21
24
23
20
31
26
22
30
32
29
22
24
20
26
32
22
20
17
23
18
24
30
30
22
18
29
28
24
32
27
26
23
22
32
24
24
22
25
22...

output:

1 2
1 3
1 4
1 5
4 5
1 6
3 6
1 7
1 8
1 9
3 9
1 10
1 11
1 12
1 13
4 13
5 13
1 14
3 14
1 15
4 15
1 16
3 16
9 16
1 17
12 17
1 18
4 18
5 18
13 18
1 19
1 20
1 21
20 21
1 22
3 22
14 22
1 23
20 23
1 24
3 24
1 25
2 25
1 26
1 27
11 27
1 28
2 28
1 29
4 29
1 30
26 30
1 31
4 31
1 32
11 32
1 33
7 33
1 34
8 34
1 3...

result:

ok Found equal strings: 100, 334

Test #6:

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

input:

750
25
27
27
28
23
28
23
30
18
30
25
18
23
20
28
28
27
24
23
30
20
24
26
24
24
24
28
22
23
24
27
26
22
16
23
26
26
28
21
27
24
30
28
26
20
27
26
18
18
22
30
24
26
28
26
24
20
27
30
28
26
20
20
30
25
18
22
31
24
24
22
27
32
20
20
20
20
22
23
24
28
30
22
26
24
24
24
24
16
22
30
32
20
28
24
28
30
25
30...

output:

1 2
1 3
1 4
3 4
1 5
1 6
1 7
5 7
1 8
1 9
1 10
2 10
1 11
5 11
1 12
6 12
1 13
3 13
1 14
5 14
7 14
1 15
1 16
1 17
15 17
1 18
15 18
1 19
1 20
5 20
1 21
3 21
1 22
19 22
1 23
5 23
1 24
16 24
1 25
1 26
3 26
13 26
1 27
6 27
1 28
1 29
3 29
21 29
1 30
8 30
1 31
9 31
1 32
16 32
24 32
1 33
15 33
1 34
3 34
1 35
6...

result:

ok Found equal strings: 130, 698

Test #7:

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

input:

999
25
26
22
24
27
23
26
30
33
23
28
26
28
26
28
26
31
24
24
27
22
24
26
27
26
25
22
26
24
26
20
24
24
26
32
23
24
26
30
20
28
22
28
22
26
29
24
22
25
30
25
24
22
24
26
24
24
24
28
26
26
26
28
22
30
24
20
26
30
24
23
28
22
31
30
25
20
28
30
21
29
24
26
26
24
24
32
29
24
24
22
20
21
20
23
28
20
23
26...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
3 8
1 9
1 10
7 10
1 11
3 11
1 12
3 12
11 12
1 13
1 14
5 14
1 15
6 15
1 16
5 16
1 17
6 17
1 18
2 18
1 19
3 19
1 20
3 20
1 21
5 21
14 21
1 22
1 23
7 23
1 24
3 24
8 24
1 25
1 26
4 26
1 27
4 27
1 28
1 29
5 29
1 30
2 30
1 31
2 31
1 32
4 32
1 33
3 33
19 33
1 34
5 34
1 35
3 35
1...

result:

ok Found equal strings: 205, 281

Test #8:

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

input:

1000
21
18
24
18
28
28
19
30
28
26
26
27
30
26
21
28
31
18
24
29
23
26
24
24
24
29
26
28
24
31
26
24
28
24
26
23
24
25
28
26
20
27
28
27
18
24
28
22
22
33
28
22
29
20
28
28
24
20
26
32
28
32
27
28
22
19
24
25
26
24
24
28
26
28
21
24
24
22
27
22
24
20
24
21
24
14
27
28
28
19
24
26
24
22
30
29
30
25
3...

output:

1 2
1 3
1 4
1 5
3 5
1 6
1 7
1 8
1 9
6 9
1 10
1 11
1 12
8 12
1 13
2 13
1 14
1 15
3 15
1 16
1 17
1 18
10 18
1 19
4 19
1 20
16 20
1 21
6 21
1 22
14 22
1 23
4 23
1 24
4 24
1 25
17 25
1 26
1 27
6 27
9 27
1 28
11 28
1 29
11 29
1 30
4 30
23 30
1 31
1 32
1 33
6 33
1 34
16 34
1 35
6 35
1 36
4 36
1 37
10 37
1...

result:

ok Found equal strings: 211, 327

Test #9:

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

input:

1000
26
31
25
28
25
24
28
26
27
23
19
28
28
23
30
17
31
26
26
24
23
28
23
20
17
22
20
27
20
25
28
25
22
20
20
24
23
34
32
24
26
28
32
28
30
23
20
22
30
25
22
18
24
22
26
28
26
30
23
24
24
24
18
26
24
24
23
20
24
22
25
24
26
28
30
30
24
20
26
20
27
18
24
30
26
16
30
22
29
27
22
26
24
26
22
20
22
30
3...

output:

1 2
1 3
1 4
1 5
1 6
4 6
1 7
5 7
1 8
1 9
1 10
1 11
5 11
1 12
9 12
1 13
1 14
3 14
1 15
2 15
1 16
9 16
1 17
9 17
1 18
13 18
1 19
1 20
8 20
1 21
4 21
1 22
4 22
1 23
19 23
1 24
1 25
9 25
1 26
1 27
24 27
1 28
5 28
1 29
5 29
1 30
9 30
17 30
1 31
1 32
4 32
22 32
1 33
24 33
1 34
2 34
1 35
2 35
1 36
9 36
1 37...

result:

ok Found equal strings: 220, 448

Test #10:

score: 0
Accepted
time: 3ms
memory: 3712kb

input:

1000
25
23
22
30
24
33
26
28
27
24
28
27
28
23
20
35
24
22
24
20
29
23
26
29
26
28
26
22
28
30
26
25
20
26
22
26
26
26
24
28
24
25
24
24
18
19
29
18
23
22
26
20
21
21
26
27
20
25
24
26
25
16
27
26
24
28
26
14
22
28
26
20
25
28
27
22
24
24
28
24
28
25
24
26
30
23
32
23
22
34
28
30
21
30
26
24
20
23
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
6 11
1 12
10 12
1 13
3 13
1 14
1 15
6 15
1 16
6 16
1 17
1 18
3 18
1 19
17 19
1 20
9 20
1 21
4 21
1 22
5 22
1 23
2 23
1 24
8 24
1 25
8 25
1 26
8 26
1 27
9 27
1 28
2 28
1 29
6 29
1 30
1 31
17 31
1 32
3 32
1 33
8 33
1 34
1 35
34 35
1 36
10 36
1 37
2 37
28 37
1 ...

result:

ok Found equal strings: 279, 970

Test #11:

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

input:

1000
24
28
22
30
21
22
30
27
26
25
24
26
21
26
27
18
27
24
23
26
24
29
26
24
24
22
28
32
26
24
24
26
24
28
31
26
22
19
23
22
28
26
26
18
25
20
21
22
24
20
22
22
29
20
26
20
22
28
26
23
22
20
20
26
28
28
28
28
20
24
26
28
28
26
26
22
28
24
24
28
24
26
26
25
20
24
21
24
25
22
30
24
28
26
28
25
30
27
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
4 7
1 8
1 9
1 10
1 11
2 11
1 12
6 12
1 13
8 13
1 14
8 14
1 15
1 16
9 16
1 17
1 18
9 18
16 18
1 19
4 19
1 20
1 21
9 21
16 21
18 21
1 22
2 22
1 23
1 24
9 24
1 25
1 26
15 26
1 27
3 27
1 28
9 28
1 29
10 29
1 30
6 30
1 31
2 31
1 32
4 32
1 33
17 33
1 34
9 34
1 35
4 35
19 35
1 36
15...

result:

ok Found equal strings: 619, 843

Test #12:

score: 0
Accepted
time: 3ms
memory: 3584kb

input:

1000
25
25
26
25
26
34
25
28
33
24
26
27
27
28
25
30
23
31
24
22
22
24
26
23
28
22
24
25
22
26
24
24
26
26
15
31
24
14
31
22
26
22
20
27
26
24
30
23
24
25
20
29
28
23
22
23
20
17
24
28
24
28
30
29
30
19
27
28
30
27
20
27
32
29
28
24
22
24
28
24
26
32
26
28
28
20
28
28
28
20
20
22
22
25
22
22
20
22
2...

output:

1 2
1 3
2 3
1 4
2 4
3 4
1 5
2 5
1 6
1 7
1 8
1 9
1 10
9 10
1 11
2 11
1 12
1 13
1 14
7 14
1 15
1 16
7 16
1 17
12 17
1 18
15 18
1 19
2 19
1 20
8 20
1 21
7 21
16 21
1 22
1 23
13 23
1 24
1 25
13 25
1 26
8 26
1 27
1 28
9 28
1 29
7 29
1 30
12 30
1 31
2 31
1 32
1 33
1 34
12 34
1 35
12 35
1 36
1 37
7 37
1 38...

result:

ok Found equal strings: 678, 717

Test #13:

score: 0
Accepted
time: 5ms
memory: 3584kb

input:

1000
27
25
26
23
18
23
24
23
20
29
24
21
24
24
31
30
27
26
29
24
25
30
33
23
22
21
26
29
26
25
26
24
34
26
30
27
28
27
28
20
31
26
23
14
21
30
27
26
24
25
28
21
24
28
27
18
25
26
22
25
28
22
24
26
27
22
26
26
19
24
30
28
26
20
19
26
29
18
26
28
30
26
22
22
28
26
28
22
23
26
25
30
26
24
22
25
22
18
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
5 7
1 8
5 8
1 9
1 10
1 11
1 12
10 12
1 13
1 14
1 15
2 15
1 16
9 16
1 17
3 17
1 18
1 19
5 19
1 20
11 20
1 21
9 21
1 22
3 22
1 23
10 23
1 24
4 24
1 25
2 25
1 26
2 26
25 26
1 27
13 27
1 28
5 28
1 29
11 29
1 30
2 30
15 30
1 31
3 31
1 32
11 32
1 33
1 34
2 34
1 35
3 35
22 35
1 36
3...

result:

ok Found equal strings: 239, 737

Test #14:

score: 0
Accepted
time: 3ms
memory: 3712kb

input:

1000
24
24
28
31
23
23
22
28
29
26
26
20
23
28
26
22
22
28
22
33
26
24
23
20
25
18
29
30
20
19
25
24
28
28
31
18
24
22
22
30
22
22
28
32
26
20
26
21
31
20
24
22
26
24
24
25
26
29
24
21
20
22
26
21
24
25
32
23
28
30
29
18
22
26
24
21
22
23
26
27
26
30
29
16
27
28
31
22
27
24
26
22
22
25
24
28
23
28
2...

output:

1 2
1 3
2 3
1 4
1 5
1 6
5 6
1 7
1 8
1 9
1 10
9 10
1 11
5 11
1 12
9 12
1 13
1 14
7 14
1 15
1 16
9 16
1 17
5 17
1 18
1 19
1 20
8 20
1 21
1 22
1 23
18 23
1 24
7 24
1 25
4 25
1 26
2 26
1 27
13 27
1 28
13 28
1 29
7 29
1 30
9 30
10 30
1 31
1 32
4 32
1 33
2 33
26 33
1 34
2 34
1 35
18 35
1 36
8 36
1 37
31 3...

result:

ok Found equal strings: 112, 796

Test #15:

score: 0
Accepted
time: 4ms
memory: 3840kb

input:

1000
24
31
28
25
27
26
25
28
23
28
24
23
24
30
29
26
24
24
16
28
20
28
26
24
26
23
26
20
27
22
28
26
26
26
26
32
23
20
23
22
26
22
27
28
30
22
30
28
24
26
22
26
12
22
22
24
28
26
26
26
33
30
26
28
26
28
27
24
30
26
24
29
26
18
29
20
28
22
29
24
35
26
24
30
20
26
29
24
24
28
24
24
26
26
22
22
24
28
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
5 8
1 9
1 10
4 10
1 11
9 11
1 12
1 13
1 14
7 14
1 15
2 15
1 16
4 16
1 17
4 17
1 18
2 18
1 19
9 19
1 20
1 21
6 21
1 22
4 22
17 22
1 23
7 23
1 24
1 25
9 25
1 26
9 26
1 27
7 27
1 28
6 28
1 29
12 29
1 30
12 30
1 31
2 31
18 31
1 32
7 32
1 33
1 34
33 34
1 35
4 35
17 35
22 35
1 ...

result:

ok Found equal strings: 634, 855

Test #16:

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

input:

1000
25
25
22
26
24
27
22
25
16
27
28
24
26
24
24
25
22
12
28
20
30
24
22
25
34
30
24
27
30
21
29
24
24
20
26
24
21
22
29
24
25
26
28
28
26
24
22
31
29
30
25
30
27
28
26
28
22
25
24
26
30
27
22
24
28
16
23
26
22
22
22
32
24
20
22
24
28
26
26
18
29
32
19
20
26
21
28
20
22
25
26
22
24
26
28
23
28
22
2...

output:

1 2
1 3
2 3
1 4
1 5
1 6
1 7
1 8
2 8
1 9
6 9
1 10
5 10
1 11
5 11
1 12
2 12
3 12
1 13
1 14
1 15
1 16
5 16
1 17
2 17
1 18
15 18
1 19
6 19
1 20
1 21
1 22
5 22
11 22
1 23
4 23
1 24
20 24
1 25
21 25
1 26
2 26
1 27
13 27
1 28
4 28
23 28
1 29
1 30
21 30
1 31
2 31
1 32
6 32
9 32
1 33
13 33
1 34
2 34
1 35
4 3...

result:

ok Found equal strings: 196, 508

Test #17:

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

input:

1000
26
23
24
19
31
25
29
24
22
29
30
26
32
30
23
28
23
22
28
27
24
26
30
24
21
27
28
27
28
26
25
28
18
26
26
24
22
28
25
20
27
22
22
20
29
26
27
30
29
24
28
30
25
22
24
18
27
26
24
28
24
22
24
22
22
29
20
30
24
24
25
22
18
30
24
24
20
22
20
18
18
26
18
24
22
26
18
26
27
18
29
22
26
28
31
22
25
26
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
4 9
1 10
8 10
1 11
2 11
1 12
1 13
3 13
1 14
3 14
1 15
1 16
1 17
4 17
1 18
12 18
1 19
1 20
16 20
1 21
16 21
20 21
1 22
7 22
1 23
1 24
2 24
1 25
4 25
9 25
1 26
7 26
1 27
16 27
1 28
1 29
1 30
8 30
1 31
16 31
1 32
8 32
1 33
15 33
1 34
7 34
1 35
4 35
1 36
16 36
1 37
4 37
1...

result:

ok Found equal strings: 30, 255

Test #18:

score: 0
Accepted
time: 5ms
memory: 3712kb

input:

1000
20
29
27
30
22
26
28
30
26
25
22
26
24
24
30
22
26
22
24
26
25
28
30
24
24
20
25
24
23
22
24
22
24
22
24
26
22
25
22
25
24
24
28
28
26
30
27
26
24
26
28
21
22
22
26
26
23
24
18
25
20
23
30
26
28
27
18
24
20
28
27
20
25
22
28
26
24
27
22
24
20
24
23
24
26
20
22
33
24
24
24
24
22
29
28
26
22
23
3...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
5 9
1 10
1 11
6 11
1 12
1 13
12 13
1 14
6 14
11 14
1 15
12 15
1 16
10 16
1 17
5 17
1 18
12 18
1 19
10 19
1 20
1 21
6 21
1 22
6 22
21 22
1 23
12 23
15 23
1 24
10 24
1 25
10 25
19 25
1 26
8 26
1 27
7 27
1 28
4 28
1 29
12 29
15 29
1 30
1 31
6 31
1 32
7 32
1 33
20 33
1 34...

result:

ok Found equal strings: 284, 957

Test #19:

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

input:

1000
26
27
24
21
28
26
24
25
26
26
28
20
34
24
20
22
25
20
27
30
29
30
23
21
24
27
24
23
30
26
26
22
28
26
26
30
27
30
30
21
24
20
24
24
20
28
28
25
22
21
22
26
28
26
22
28
28
22
25
26
26
22
28
22
28
35
23
22
31
24
24
24
28
28
14
23
28
29
22
26
20
23
26
26
22
24
19
26
18
20
24
23
22
24
23
26
28
26
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
2 7
1 8
1 9
2 9
1 10
6 10
1 11
1 12
4 12
1 13
1 14
8 14
1 15
3 15
1 16
1 17
1 18
1 19
5 19
1 20
3 20
1 21
18 21
1 22
2 22
9 22
1 23
6 23
1 24
2 24
1 25
3 25
15 25
1 26
5 26
19 26
1 27
4 27
1 28
1 29
6 29
1 30
8 30
1 31
5 31
1 32
2 32
1 33
2 33
1 34
6 34
29 34
1 35
8 35
1 36
2...

result:

ok Found equal strings: 343, 478

Test #20:

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

input:

1000
19
26
17
23
28
33
29
28
20
26
22
30
29
24
30
22
33
26
24
19
28
28
20
26
30
18
25
28
22
24
20
25
26
27
30
22
22
25
24
26
18
26
16
28
30
28
28
16
28
24
26
28
22
26
22
22
24
24
21
23
22
23
24
25
26
22
18
26
28
20
27
24
23
22
22
24
26
25
32
30
24
25
24
30
29
26
25
22
20
29
24
20
21
24
32
24
28
26
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
6 9
1 10
3 10
1 11
1 12
8 12
1 13
11 13
1 14
7 14
1 15
1 16
2 16
1 17
6 17
9 17
1 18
11 18
1 19
1 20
6 20
1 21
15 21
1 22
19 22
1 23
1 24
11 24
13 24
1 25
19 25
1 26
3 26
1 27
3 27
1 28
6 28
1 29
6 29
1 30
1 31
6 31
1 32
3 32
1 33
1 34
3 34
10 34
1 35
15 35
1 36
1 37
...

result:

ok Found equal strings: 352, 402

Test #21:

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

input:

1000
23
28
26
24
24
20
29
21
26
24
27
29
26
27
28
29
24
28
24
23
28
28
26
17
25
25
20
31
24
28
22
26
20
25
30
20
25
24
30
23
22
22
22
26
22
35
17
26
24
30
23
28
26
20
24
28
24
28
24
26
22
20
25
14
30
28
18
27
30
18
26
20
28
26
26
27
30
22
23
22
18
29
26
22
26
26
26
20
28
22
20
26
30
22
25
22
21
22
2...

output:

1 2
1 3
1 4
1 5
1 6
5 6
1 7
1 8
1 9
4 9
1 10
1 11
7 11
1 12
10 12
1 13
7 13
1 14
3 14
1 15
2 15
1 16
3 16
1 17
1 18
1 19
18 19
1 20
1 21
5 21
1 22
1 23
4 23
1 24
18 24
1 25
1 26
18 26
1 27
1 28
2 28
1 29
22 29
1 30
4 30
1 31
1 32
17 32
1 33
5 33
1 34
2 34
15 34
1 35
25 35
1 36
3 36
14 36
1 37
5 37
1...

result:

ok Found equal strings: 462, 874

Test #22:

score: 0
Accepted
time: 5ms
memory: 3712kb

input:

1000
27
20
28
27
20
32
26
27
26
26
26
26
26
28
32
26
29
25
27
24
27
18
19
23
27
26
26
22
25
16
26
22
27
30
24
26
32
21
21
20
23
22
28
24
26
24
21
26
29
18
28
26
32
22
24
24
35
28
24
28
27
26
28
29
28
28
20
26
22
26
29
22
26
36
18
25
28
24
26
28
24
20
27
24
26
30
28
32
28
26
22
25
32
27
26
32
28
22
3...

output:

1 2
1 3
1 4
1 5
2 5
1 6
1 7
1 8
2 8
1 9
7 9
1 10
7 10
9 10
1 11
6 11
1 12
1 13
1 14
2 14
1 15
2 15
1 16
1 17
1 18
2 18
8 18
1 19
1 20
13 20
1 21
7 21
1 22
2 22
1 23
1 24
7 24
1 25
1 26
25 26
1 27
17 27
1 28
4 28
1 29
7 29
1 30
25 30
1 31
12 31
1 32
4 32
1 33
6 33
1 34
23 34
1 35
1 36
4 36
28 36
1 37...

result:

ok Found equal strings: 521, 747

Test #23:

score: 0
Accepted
time: 3ms
memory: 3712kb

input:

1000
32
30
27
29
27
26
20
25
29
22
28
22
20
24
29
20
26
29
26
30
18
22
26
28
24
23
26
24
19
28
26
22
28
25
24
25
26
25
28
26
22
26
22
24
20
22
21
27
26
24
21
28
25
26
26
19
22
30
28
32
22
21
20
26
24
32
23
28
25
26
26
22
25
30
23
24
20
20
27
28
27
22
29
30
26
26
25
24
22
21
22
31
23
24
24
22
18
25
2...

output:

1 2
1 3
1 4
1 5
1 6
4 6
1 7
1 8
1 9
5 9
1 10
1 11
1 12
7 12
1 13
5 13
1 14
1 15
5 15
1 16
3 16
1 17
11 17
1 18
10 18
1 19
1 20
14 20
1 21
1 22
10 22
1 23
11 23
1 24
8 24
1 25
8 25
1 26
8 26
1 27
14 27
1 28
14 28
27 28
1 29
7 29
1 30
1 31
4 31
6 31
1 32
30 32
1 33
8 33
25 33
1 34
21 34
1 35
3 35
1 36...

result:

ok Found equal strings: 621, 861

Test #24:

score: 0
Accepted
time: 5ms
memory: 3712kb

input:

1000
21
25
24
21
22
21
24
25
18
20
21
20
27
29
29
30
30
24
22
23
28
27
20
29
26
20
24
29
26
22
32
22
24
26
23
22
19
27
22
31
28
24
30
24
26
26
24
28
26
24
22
26
28
18
26
32
26
28
21
18
29
20
17
31
22
9
24
26
16
29
24
26
26
26
24
24
27
22
28
20
20
31
16
29
22
33
25
26
23
18
21
24
28
25
22
22
22
24
26...

output:

1 2
1 3
1 4
1 5
2 5
1 6
2 6
1 7
3 7
1 8
1 9
2 9
1 10
1 11
1 12
11 12
1 13
1 14
4 14
1 15
1 16
1 17
10 17
1 18
11 18
1 19
8 19
1 20
11 20
18 20
1 21
1 22
1 23
4 23
1 24
15 24
1 25
1 26
10 26
1 27
1 28
16 28
1 29
13 29
1 30
1 31
30 31
1 32
16 32
1 33
4 33
14 33
1 34
16 34
1 35
30 35
1 36
30 36
1 37
2 ...

result:

ok Found equal strings: 143, 920

Test #25:

score: 0
Accepted
time: 5ms
memory: 3712kb

input:

1000
24
26
31
29
29
18
26
28
25
21
20
25
28
24
26
22
24
16
27
26
26
28
35
26
20
26
20
22
28
26
22
28
27
30
19
27
28
24
22
18
24
20
24
28
24
28
18
23
27
24
26
26
24
28
24
30
22
22
27
24
24
22
26
24
24
23
26
24
28
22
24
30
33
23
28
24
26
24
27
20
27
26
24
24
32
22
30
23
20
26
28
24
22
30
22
23
28
30
3...

output:

1 2
1 3
1 4
1 5
1 6
5 6
1 7
3 7
1 8
1 9
1 10
1 11
8 11
1 12
2 12
1 13
1 14
2 14
1 15
1 16
3 16
1 17
1 18
1 19
3 19
1 20
3 20
19 20
1 21
17 21
1 22
13 22
1 23
15 23
1 24
1 25
15 25
1 26
2 26
1 27
1 28
2 28
1 29
2 29
1 30
2 30
29 30
1 31
1 32
15 32
1 33
3 33
16 33
1 34
17 34
1 35
1 36
13 36
1 37
15 37...

result:

ok Found equal strings: 17, 979

Test #26:

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

input:

1000
23
21
26
24
25
26
26
24
18
29
25
24
21
26
31
27
26
28
32
28
20
27
26
25
26
32
24
20
22
31
22
24
26
25
28
24
26
28
23
26
26
22
28
30
21
28
21
28
24
24
24
20
22
18
29
24
26
28
22
22
24
30
25
20
25
14
19
20
24
23
22
25
26
28
24
24
26
32
24
22
31
20
17
32
20
16
29
26
27
20
28
20
23
22
20
26
26
26
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
4 7
1 8
5 8
1 9
1 10
6 10
1 11
3 11
1 12
1 13
1 14
4 14
1 15
1 16
1 17
1 18
13 18
1 19
6 19
1 20
15 20
1 21
17 21
1 22
12 22
1 23
5 23
1 24
6 24
1 25
5 25
23 25
1 26
2 26
1 27
4 27
1 28
16 28
1 29
3 29
1 30
3 30
29 30
1 31
5 31
1 32
17 32
21 32
1 33
9 33
1 34
4 34
14 34
1 35
...

result:

ok Found equal strings: 39, 538

Test #27:

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

input:

1000
26
21
33
27
24
24
32
25
24
26
21
26
27
30
23
23
22
23
18
28
23
22
24
25
26
26
24
28
28
27
30
20
18
27
26
27
28
22
26
26
26
26
28
27
22
24
22
23
16
25
22
30
29
30
22
19
23
28
23
24
26
22
25
28
27
28
26
23
14
23
32
24
28
28
28
26
28
28
26
20
24
28
26
24
24
31
17
29
28
27
28
28
30
24
30
22
18
26
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
6 7
1 8
1 9
6 9
1 10
3 10
1 11
5 11
1 12
1 13
12 13
1 14
12 14
1 15
1 16
12 16
13 16
1 17
8 17
1 18
2 18
1 19
15 19
1 20
5 20
11 20
1 21
1 22
5 22
1 23
5 23
1 24
1 25
2 25
1 26
2 26
25 26
1 27
5 27
1 28
6 28
1 29
12 29
1 30
8 30
1 31
1 32
1 33
31 33
1 34
1 35
12 35
1 36
12 36...

result:

ok Found equal strings: 98, 412

Test #28:

score: 0
Accepted
time: 3ms
memory: 3712kb

input:

1000
26
24
24
30
20
28
25
25
26
24
20
29
26
26
24
28
25
24
21
23
23
26
28
26
24
22
26
28
22
30
25
22
18
28
26
30
29
28
19
26
26
18
26
26
26
30
22
26
32
23
26
20
23
22
24
34
23
22
22
26
22
26
24
24
28
20
27
25
22
18
21
24
29
28
32
23
30
26
26
26
26
21
26
25
18
24
22
26
30
28
26
26
24
27
24
27
26
24
2...

output:

1 2
1 3
1 4
3 4
1 5
1 6
1 7
1 8
7 8
1 9
3 9
1 10
1 11
2 11
1 12
3 12
1 13
7 13
1 14
1 15
1 16
15 16
1 17
6 17
1 18
3 18
1 19
2 19
1 20
1 21
1 22
7 22
1 23
1 24
6 24
17 24
1 25
10 25
1 26
1 27
2 27
11 27
1 28
2 28
11 28
1 29
21 29
1 30
2 30
1 31
15 31
16 31
1 32
15 32
1 33
3 33
1 34
15 34
32 34
1 35
...

result:

ok Found equal strings: 598, 970

Test #29:

score: 0
Accepted
time: 6ms
memory: 3712kb

input:

1000
22
23
29
28
18
28
26
23
22
26
21
24
25
28
20
25
20
30
23
26
20
29
22
20
22
33
24
20
26
28
27
24
28
24
26
25
28
27
22
28
22
21
26
19
27
24
20
26
24
30
24
24
21
26
22
23
26
28
27
30
27
18
26
26
26
22
25
26
30
24
26
24
25
26
22
27
20
27
26
18
22
28
26
22
27
24
24
27
24
22
23
26
26
29
22
20
23
22
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
5 7
1 8
3 8
1 9
1 10
1 11
1 12
1 13
5 13
1 14
12 14
1 15
1 16
3 16
1 17
1 18
4 18
1 19
17 19
1 20
1 21
11 21
1 22
9 22
1 23
1 24
11 24
1 25
11 25
1 26
12 26
1 27
23 27
1 28
5 28
1 29
10 29
1 30
1 31
23 31
1 32
17 32
1 33
11 33
1 34
11 34
1 35
10 35
29 35
1 36
3 36
16 36
1 37
...

result:

ok Found equal strings: 657, 844

Test #30:

score: 0
Accepted
time: 4ms
memory: 3712kb

input:

1000
26
19
25
23
23
20
23
24
28
25
30
28
22
29
26
24
26
28
26
26
31
22
24
23
22
23
26
24
24
24
30
21
25
18
20
27
21
26
28
20
19
22
23
26
26
18
28
26
24
24
30
24
30
22
24
22
19
28
30
24
24
26
26
22
31
24
28
28
24
22
28
21
22
20
26
22
22
27
26
23
24
18
26
26
24
24
18
22
24
20
26
28
19
24
24
22
20
24
2...

output:

1 2
1 3
1 4
1 5
1 6
5 6
1 7
5 7
1 8
1 9
4 9
1 10
8 10
1 11
1 12
2 12
1 13
2 13
1 14
2 14
1 15
1 16
1 17
1 18
5 18
1 19
5 19
1 20
17 20
1 21
17 21
1 22
1 23
4 23
1 24
1 25
1 26
22 26
1 27
8 27
1 28
3 28
1 29
5 29
19 29
1 30
1 31
8 31
1 32
17 32
20 32
1 33
17 33
21 33
1 34
17 34
1 35
3 35
1 36
1 37
17...

result:

ok Found equal strings: 716, 718

Test #31:

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

input:

1000
18
23
17
22
22
24
31
22
24
24
20
19
29
28
23
20
19
20
28
20
23
24
19
24
23
22
20
28
25
29
24
27
30
21
23
20
24
24
26
25
32
27
28
24
24
25
22
34
32
23
28
27
22
26
14
29
26
22
24
22
24
30
31
18
25
24
25
30
24
26
24
28
21
18
27
22
28
26
24
22
28
24
22
23
18
21
24
20
22
29
22
32
20
28
22
26
28
23
2...

output:

1 2
1 3
1 4
1 5
1 6
5 6
1 7
1 8
5 8
6 8
1 9
1 10
1 11
1 12
1 13
3 13
1 14
10 14
1 15
12 15
1 16
3 16
1 17
10 17
1 18
3 18
1 19
9 19
1 20
1 21
11 21
1 22
1 23
1 24
1 25
3 25
13 25
1 26
1 27
1 28
20 28
1 29
22 29
1 30
26 30
1 31
20 31
1 32
1 33
1 34
3 34
1 35
22 35
1 36
27 36
1 37
11 37
1 38
5 38
6 38...

result:

ok Found equal strings: 57, 240

Test #32:

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

input:

1000
21
16
29
23
24
25
28
20
16
22
27
28
20
23
30
27
20
20
24
26
17
20
24
30
33
19
32
27
28
31
28
24
28
26
19
26
22
25
18
26
22
28
24
28
23
24
20
26
20
22
20
24
24
27
26
28
26
28
21
26
23
24
20
22
22
18
24
26
26
28
26
22
26
26
20
26
26
23
28
27
20
30
31
20
26
30
22
26
30
24
22
25
30
20
34
22
26
18
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
3 10
1 11
1 12
8 12
1 13
5 13
1 14
11 14
1 15
9 15
1 16
1 17
1 18
9 18
15 18
1 19
1 20
1 21
1 22
11 22
1 23
1 24
8 24
1 25
8 25
1 26
20 26
1 27
1 28
7 28
1 29
16 29
1 30
8 30
24 30
1 31
5 31
1 32
9 32
1 33
9 33
1 34
9 34
15 34
1 35
11 35
1 36
8 36
25 36
1 37
2 37...

result:

ok Found equal strings: 113, 116

Test #33:

score: 0
Accepted
time: 5ms
memory: 3840kb

input:

1000
30
30
26
28
21
27
28
26
30
22
27
24
22
27
24
28
21
26
28
30
25
21
26
20
28
26
26
25
22
21
26
30
25
28
20
29
28
28
23
22
26
25
28
20
26
24
27
22
24
28
21
30
26
24
24
28
30
24
26
28
18
17
24
22
27
18
26
24
30
27
28
23
28
20
30
26
26
24
22
20
24
30
26
24
22
25
24
29
24
27
20
23
26
24
26
26
28
26
2...

output:

1 2
1 3
2 3
1 4
1 5
1 6
1 7
4 7
1 8
2 8
1 9
6 9
1 10
1 11
6 11
9 11
1 12
5 12
1 13
4 13
1 14
1 15
5 15
12 15
1 16
4 16
7 16
1 17
14 17
1 18
5 18
12 18
1 19
14 19
1 20
1 21
1 22
4 22
1 23
1 24
10 24
1 25
14 25
19 25
1 26
1 27
1 28
6 28
1 29
27 29
1 30
5 30
1 31
26 31
1 32
27 32
29 32
1 33
27 33
1 34
...

result:

ok Found equal strings: 175, 635

Test #34:

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

input:

1000
25
23
20
27
25
32
25
28
32
31
26
16
30
29
22
35
21
24
24
28
27
28
32
24
27
20
22
24
32
16
28
23
30
23
24
24
26
20
24
24
26
26
22
28
28
22
23
22
26
28
20
26
30
20
18
16
20
28
24
26
24
25
22
25
30
32
24
22
32
28
26
24
16
19
28
28
19
22
21
28
30
28
21
20
26
20
27
24
26
28
24
28
26
25
24
24
24
23
2...

output:

1 2
1 3
1 4
1 5
1 6
2 6
1 7
2 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
17 18
1 19
5 19
1 20
8 20
1 21
5 21
1 22
14 22
1 23
8 23
1 24
1 25
3 25
1 26
3 26
1 27
17 27
1 28
4 28
1 29
17 29
27 29
1 30
14 30
1 31
24 31
1 32
3 32
1 33
10 33
1 34
4 34
1 35
12 35
1 36
1 37
11 37
1 38
24 38
1 39...

result:

ok Found equal strings: 235, 509

Test #35:

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

input:

1000
23
25
25
24
23
22
26
23
20
26
30
19
24
28
26
20
21
25
26
27
22
22
24
31
23
28
20
27
26
27
32
26
28
19
24
24
24
15
26
32
31
20
19
28
23
24
24
26
23
26
22
26
23
22
24
23
22
24
26
20
26
21
24
32
26
22
22
28
32
20
18
21
24
28
31
22
23
26
28
21
22
29
28
22
27
20
29
16
23
28
24
23
20
28
19
26
24
24
2...

output:

1 2
1 3
1 4
3 4
1 5
2 5
1 6
1 7
2 7
1 8
6 8
1 9
1 10
1 11
1 12
6 12
1 13
1 14
3 14
1 15
1 16
1 17
16 17
1 18
1 19
2 19
1 20
1 21
15 21
1 22
15 22
1 23
6 23
1 24
9 24
1 25
10 25
1 26
1 27
6 27
1 28
18 28
1 29
9 29
1 30
2 30
1 31
10 31
1 32
2 32
1 33
16 33
1 34
2 34
5 34
1 35
2 35
5 35
34 35
1 36
20 3...

result:

ok Found equal strings: 30, 294

Test #36:

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

input:

1000
24
27
21
15
25
24
20
25
30
22
31
28
25
24
22
26
25
36
31
22
28
30
28
22
25
26
32
23
33
23
22
30
23
28
29
24
20
24
27
20
27
18
28
26
32
28
24
24
20
32
20
31
28
22
26
26
29
28
28
28
23
28
30
29
22
29
26
22
26
26
24
27
26
21
20
24
30
22
30
26
24
24
30
22
24
26
26
27
26
22
20
24
29
24
28
28
28
23
2...

output:

1 2
1 3
1 4
1 5
1 6
1 7
2 7
1 8
6 8
1 9
1 10
1 11
1 12
6 12
1 13
9 13
1 14
6 14
1 15
10 15
1 16
11 16
1 17
11 17
1 18
6 18
1 19
1 20
1 21
1 22
20 22
1 23
1 24
20 24
1 25
1 26
2 26
7 26
1 27
3 27
1 28
3 28
1 29
11 29
1 30
19 30
1 31
2 31
1 32
1 33
19 33
1 34
10 34
1 35
9 35
13 35
1 36
25 36
1 37
11 3...

result:

ok Found equal strings: 634, 904

Test #37:

score: 0
Accepted
time: 4ms
memory: 3712kb

input:

1000
23
21
26
20
21
26
23
24
18
30
22
18
18
24
21
28
31
23
26
19
22
30
27
23
32
27
26
31
26
20
22
24
20
25
21
26
24
29
20
30
25
24
27
22
24
26
25
24
30
26
30
20
28
26
26
32
15
23
22
22
28
19
24
23
22
28
29
18
26
28
29
32
26
26
28
26
26
28
24
33
26
22
22
26
22
26
18
29
22
28
22
26
22
26
24
24
30
25
2...

output:

1 2
1 3
1 4
1 5
1 6
3 6
1 7
2 7
1 8
1 9
1 10
1 11
8 11
1 12
1 13
3 13
1 14
1 15
2 15
1 16
1 17
10 17
1 18
1 19
2 19
1 20
18 20
1 21
14 21
1 22
5 22
1 23
12 23
1 24
1 25
3 25
6 25
1 26
1 27
5 27
1 28
24 28
1 29
18 29
1 30
12 30
1 31
24 31
28 31
1 32
4 32
1 33
5 33
1 34
4 34
1 35
1 36
1 37
2 37
1 38
1...

result:

ok Found equal strings: 693, 778

Test #38:

score: 0
Accepted
time: 3ms
memory: 3712kb

input:

1000
29
32
29
30
19
24
33
22
27
22
22
18
26
25
32
18
21
23
22
28
17
23
22
23
28
30
19
26
21
24
21
26
28
22
24
25
28
24
26
28
30
25
24
24
28
25
28
28
25
28
28
20
21
26
26
29
26
20
29
22
25
20
24
24
25
24
16
30
22
31
21
22
25
22
22
22
20
25
22
26
26
22
26
28
25
26
25
30
26
22
24
32
20
28
26
29
30
28
2...

output:

1 2
1 3
1 4
2 4
1 5
1 6
1 7
1 8
1 9
1 10
8 10
1 11
1 12
1 13
1 14
3 14
1 15
1 16
1 17
8 17
1 18
1 19
16 19
1 20
16 20
1 21
1 22
5 22
1 23
15 23
1 24
15 24
1 25
1 26
8 26
1 27
13 27
1 28
6 28
1 29
25 29
1 30
13 30
1 31
6 31
1 32
13 32
27 32
1 33
13 33
27 33
32 33
1 34
15 34
24 34
1 35
2 35
1 36
1 37
...

result:

ok Found equal strings: 336, 912

Test #39:

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

input:

2
0

output:

1 2

result:

ok Found equal strings: 1, 2

Extra Test:

score: 0
Extra Test Passed