QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#800415#8086. CloysterSFlyerAC ✓25ms10204kbC++141.3kb2024-12-06 10:10:322024-12-06 10:10:40

Judging History

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

  • [2024-12-06 10:10:40]
  • 评测
  • 测评结果:AC
  • 用时:25ms
  • 内存:10204kb
  • [2024-12-06 10:10:32]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const int N = 2e3+3;

int n,a[N][N]; 

int ask(int x,int y){
	cout<<"? "<<x<<" "<<y<<endl;
	int res;
	cin>>res;
	return res;
}

int mx,ax,ay;

void on(int x,int y){
	if (1<=x && x<=n && 1<=y && y<=n){
		if (!a[x][y]) a[x][y]=ask(x,y);
		if (a[x][y]>mx) mx=a[x][y],ax=x,ay=y;
	}
}

void chk(int x,int y){
	on(x-1,y-1),on(x-1,y),on(x-1,y+1);
	on(x,y-1),on(x,y+1);
	on(x+1,y-1),on(x+1,y),on(x+1,y+1);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin>>n;
	int l=1,r=n,u=1,d=n;
	while (l<r || u<d){
		if (r-l+1<=d-u+1){
			int mid=u+d>>1;
			for (int i=l; i<=r; i++) on(mid,i);
			chk(ax,ay);
			if (ax<=mid) d=mid;
			else u=mid+1;
		}
		else{
			int mid=l+r>>1;
			for (int i=u; i<=d; i++) on(i,mid);
			chk(ax,ay);
			if (ay<=mid) r=mid;
			else l=mid+1;
		}
	}
	cout<<"! "<<ax<<" "<<ay<<endl;
	return 0;
}

// TRY! TRY! TRY!

/*
Think twice before coding. Have you overkilled?
Think twice before submitting.
Check on the samples and constraints carefully.
*/

/*
Be brave to guess.
Is your former/first approach correct?
Follow your intuition.
Use a notebook to note down your ideas and check whether they are correct.
*/

/*
A simple brute force may work? There is some limit on the answer?
Try to find patterns.
*/

详细

Test #1:

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

input:

3
7
5
4
1
2
6
8
9

output:

? 2 1
? 2 2
? 2 3
? 1 1
? 1 2
? 3 1
? 3 2
? 3 3
! 3 3

result:

ok used 8 queries (allowed: 219)

Test #2:

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

input:

5
83
13
11
7
47
89
23
79
5
31
19
97
29

output:

? 3 1
? 3 2
? 3 3
? 3 4
? 3 5
? 2 1
? 2 2
? 4 1
? 4 2
? 1 3
? 2 3
? 1 1
? 1 2
! 1 1

result:

ok used 13 queries (allowed: 225)

Test #3:

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

input:

2
100
200
250
300

output:

? 1 1
? 1 2
? 2 1
? 2 2
! 2 2

result:

ok used 4 queries (allowed: 216)

Test #4:

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

input:

2
20
40
30
10

output:

? 1 1
? 1 2
? 2 1
? 2 2
! 1 2

result:

ok used 4 queries (allowed: 216)

Test #5:

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

input:

5
64
73
74
69
56
66
67
68
72
71
70
52
65

output:

? 3 1
? 3 2
? 3 3
? 3 4
? 3 5
? 2 2
? 2 3
? 2 4
? 4 2
? 4 3
? 4 4
? 1 3
? 2 1
! 3 3

result:

ok used 13 queries (allowed: 225)

Test #6:

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

input:

5
70
21
72
23
69
66
17
68
80
27
73
75
25
76
31

output:

? 3 1
? 3 2
? 3 3
? 3 4
? 3 5
? 2 2
? 2 3
? 2 4
? 4 2
? 4 3
? 4 4
? 5 3
? 4 1
? 5 1
? 5 2
! 4 2

result:

ok used 15 queries (allowed: 225)

Test #7:

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

input:

5
6
35
10
3
29
36
7
8
34
5
4
26
37
9

output:

? 3 1
? 3 2
? 3 3
? 3 4
? 3 5
? 2 1
? 2 2
? 2 3
? 4 1
? 4 2
? 4 3
? 1 3
? 1 1
? 1 2
! 1 1

result:

ok used 14 queries (allowed: 225)

Test #8:

score: 0
Accepted
time: 17ms
memory: 8964kb

input:

2000
104247776
105169027
107244277
107283527
107189527
107601527
104643277
108893528
106495777
109300278
109959028
108891528
111685528
109428278
109733278
112478529
112027278
113260529
114067029
114496279
113506779
113455529
111220278
115345779
116972280
114866529
114349029
117285530
117462530
11515...

output:

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

result:

ok used 6054 queries (allowed: 6210)

Test #9:

score: 0
Accepted
time: 7ms
memory: 8992kb

input:

2000
87160528
89927884
90478452
90655695
89430645
91482226
91692053
90214985
92447710
92153336
89384685
92655382
92801642
92542485
93901117
92784062
93094369
95339745
95363009
94323793
97218112
97432800
96435694
93231193
97630244
99327860
99847744
98752750
99752794
92426504
101229064
100266603
10255...

output:

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

result:

ok used 6071 queries (allowed: 6210)

Test #10:

score: 0
Accepted
time: 7ms
memory: 8936kb

input:

1999
138808087
138078582
138888479
138626717
139422896
137914697
135830287
137512306
137380188
138939352
138106208
137398684
138117351
137669221
137584215
138708949
138596506
138097220
138696116
138746694
137388853
138345943
138270745
138495023
138363062
137344246
137931760
135802642
137089037
13730...

output:

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

result:

ok used 6077 queries (allowed: 6207)

Test #11:

score: 0
Accepted
time: 13ms
memory: 9004kb

input:

2000
2461030
664316
1330559
2786175
2787406
303137
2514140
1650815
1279079
1320159
1805850
2790029
2344082
2794363
2792968
781045
775433
1517275
364878
247714
2796531
1288947
1969631
2800820
1473264
1517493
1062740
2803015
1713694
2803867
2804058
2123858
1954924
7311
965421
2803168
543510
1645884
10...

output:

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

result:

ok used 6087 queries (allowed: 6210)

Test #12:

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

input:

2000
6894842
705886
3927329
6900747
209513
6897257
1720243
5011649
6894684
2860226
6903497
6896229
6905832
3263191
1617331
6930729
6931474
1764228
1686693
6927777
3225803
6629739
1005811
1445293
6942857
6334976
5345814
3107376
2733436
1007053
1733283
1702293
6951349
5274169
4634359
44943
5855234
471...

output:

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

result:

ok used 6055 queries (allowed: 6210)

Test #13:

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

input:

1999
49661893
49663760
41390110
37682371
43485220
43095197
49666521
42055610
46579149
49667198
42741276
42070252
49658380
49659830
38826433
49660342
49659769
41555039
39544686
49662827
35202428
31033926
43588300
42124236
37105399
49644952
45884255
49661980
49662536
46249353
39676726
49653302
4965255...

output:

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

result:

ok used 6008 queries (allowed: 6207)

Test #14:

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

input:

1999
4103402
2303149
2303150
2303159
2782793
4103429
2303692
4103431
4103432
2303700
4103434
4103435
2303671
2303704
2304005
4103439
4103440
2782791
2303999
2381816
4225638
2303996
2303995
4225635
4225634
2381817
2303925
3804846
14385
14384
14383
4225684
14381
14379
3804950
2303964
4225820
16473
229...

output:

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

result:

ok used 5971 queries (allowed: 6207)

Test #15:

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

input:

2000
999206437
996519393
999206425
999556190
999556189
999556188
996519417
996519416
996519330
996519329
996519438
996519437
999551103
999551148
996519429
996519346
996519344
999551156
996519456
999550732
999550731
999551400
996785461
996785460
999551397
999550733
996710745
999551387
996710741
99678...

output:

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

result:

ok used 6038 queries (allowed: 6210)

Test #16:

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

input:

2000
3180935
3244345
3244346
3180934
872820
873827
3237621
872824
3237631
872826
873870
873871
3237644
873874
873876
3237667
876667
876659
3237681
3237680
876703
872527
3237693
876711
3199184
3199204
3199188
872924
3237744
872902
3199164
3237735
3237734
872895
3237724
876761
876765
3237765
876769
87...

output:

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

result:

ok used 6064 queries (allowed: 6210)

Test #17:

score: 0
Accepted
time: 8ms
memory: 9004kb

input:

2000
2939059
1769337
1769338
2939064
1769343
1769344
2939076
1769348
2938341
4002697
4002698
1769361
1769364
2938345
1767345
2938350
1767368
1767400
1767401
4002676
1767409
2942449
2942450
1767336
1769557
4002653
4002652
1740720
1769574
1741009
1741015
4001551
1741013
1741011
1769724
1741007
2939826...

output:

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

result:

ok used 6052 queries (allowed: 6210)

Test #18:

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

input:

2000
24378790
24379005
5833783
5833755
24450763
24450755
5833665
5833646
5833100
24382635
5833132
5833128
5833150
24450578
5832197
5874707
5874681
5874682
5874687
5831772
5874602
5874599
5874587
5874569
24450478
24450445
5874539
5874525
24327767
5874501
5833364
24342128
5833339
5833327
5833232
58332...

output:

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

result:

ok used 6057 queries (allowed: 6210)

Test #19:

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

input:

2000
170283
4132450
2803223
170292
4132460
171236
171237
4132468
170469
2805323
2805324
2805385
171220
2805333
171217
2805327
170490
2805865
171203
171190
2805853
2805852
171189
2805850
170379
2805840
2805839
2805838
2805837
2805407
171160
2805767
172440
4131869
169400
4131867
169398
4131865
169409
...

output:

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

result:

ok used 6044 queries (allowed: 6210)

Test #20:

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

input:

250
24925
25416
25557
25909
26218
26533
26786
27079
27284
27409
27855
28102
28542
28800
28935
29517
29757
30168
30214
30611
30941
31252
31468
31839
32308
32727
33065
33402
33721
34057
34429
34499
34960
35492
35663
35944
36504
36632
36893
37218
37535
37994
38483
38775
38878
39166
39667
39894
40171
40...

output:

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

result:

ok used 775 queries (allowed: 960)

Test #21:

score: 0
Accepted
time: 14ms
memory: 8712kb

input:

1999
87662258
74687675
87728422
74632308
87795178
74580155
87859782
74516616
87924053
74457351
87988391
74404639
88054023
74347268
88116868
74280961
88180999
74206031
88242190
74130584
88305529
74067960
88367237
74022563
88429421
73959126
88491898
73897242
88553235
73815425
88615189
73763629
8867612...

output:

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

result:

ok used 6017 queries (allowed: 6207)

Test #22:

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

input:

2000
846062793
845717388
955555067
845147987
845038383
844599647
955968882
844092001
843899371
843378976
956376296
842811899
842700796
842263412
956784075
841755210
841524471
841251387
957185332
840623820
840406848
840054461
957583684
839594472
839104301
838989134
957980810
838226113
837903654
83773...

output:

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

result:

ok used 6034 queries (allowed: 6210)

Test #23:

score: 0
Accepted
time: 25ms
memory: 8684kb

input:

2000
209451321
209584738
210057671
210173129
210431075
210748968
210962053
211245106
211751024
211835790
212317589
212365462
212847573
213022888
213189665
213608101
213961808
214229673
214363983
214879131
215041663
215434436
215635572
215856639
216320601
216414572
216944941
217055395
217506848
21782...

output:

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

result:

ok used 6017 queries (allowed: 6210)

Test #24:

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

input:

2000
114190659
114325116
114446682
114595202
114734347
114954822
114992011
115129437
115292333
115497730
115691407
115838756
115971103
116139858
116170875
116396273
116510260
116621357
116748158
116914335
117114654
117194109
117398256
117497243
117722563
117856708
118001946
118075230
118277267
11839...

output:

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

result:

ok used 6044 queries (allowed: 6210)

Test #25:

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

input:

1999
29066441
29100588
29126939
29140428
29165140
29197773
29209247
29235435
29259484
29277002
29314177
29334334
29357620
29373949
29404267
29432933
29459584
29468143
29510836
29528116
29543406
29566266
29604955
29618731
29652753
29673674
29704692
29724099
29737888
29755618
29802765
29805030
2983223...

output:

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

result:

ok used 6028 queries (allowed: 6207)

Test #26:

score: 0
Accepted
time: 7ms
memory: 8712kb

input:

2000
772113193
772734332
772984561
773703939
774089344
774577080
774928647
775762039
776141126
776772539
776979234
777543956
778140353
778198760
778801781
779459138
779941929
780438873
780909852
781071248
781772457
782087272
782709433
782940084
783466063
783822788
784354240
784705563
785372743
78596...

output:

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

result:

ok used 6044 queries (allowed: 6210)

Test #27:

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

input:

2000
531402133
531468883
531512133
531637633
531654133
531738133
531841133
531901883
531991633
532030383
532110383
532217633
532246883
532328633
532417883
532457883
532562133
532620383
532650383
532701133
532805383
532852133
532892883
532962133
533058633
533106883
533194383
533248133
533310633
53336...

output:

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

result:

ok used 6032 queries (allowed: 6210)

Test #28:

score: 0
Accepted
time: 14ms
memory: 8604kb

input:

1999
18457566
18495334
18505383
18519746
18539566
18558590
18588270
18599051
18630220
18655646
18680003
18699373
18717995
18736053
18748029
18775732
18789191
18824904
18846450
18860062
18875903
18898638
18922794
18945557
18962678
18989955
19017927
19036557
19059872
19067597
19099323
19133257
1913588...

output:

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

result:

ok used 6023 queries (allowed: 6207)

Test #29:

score: 0
Accepted
time: 18ms
memory: 8736kb

input:

2000
269533137
269826224
269985458
270249567
270688446
270994352
271162409
271336923
271891017
272119146
272419584
272496415
272956213
273224712
273402925
273766413
274169102
274296975
274777923
275123726
275455582
275624081
275905387
276291498
276550546
276866896
276999990
277368985
277895541
27821...

output:

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

result:

ok used 6052 queries (allowed: 6210)

Test #30:

score: 0
Accepted
time: 7ms
memory: 8668kb

input:

2000
528901091
528987207
529805348
530004391
530658976
531005317
531802655
532308710
532786451
533138000
533594813
534207827
534529651
535124741
535467632
536295681
536644051
536864181
537681687
538240378
538537614
539156700
539479833
539925291
540759345
540780153
541419825
541899819
542559209
54307...

output:

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

result:

ok used 6019 queries (allowed: 6210)

Test #31:

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

input:

2000
1998500
1998501
1998502
1998503
1998504
1998505
1998506
1998507
1998508
1998509
1998510
1998511
1998512
1998513
1998514
1998515
1998516
1998517
1998518
1998519
1998520
1998521
1998522
1998523
1998524
1998525
1998526
1998527
1998528
1998529
1998530
1998531
1998532
1998533
1998534
1998535
1998536...

output:

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

result:

ok used 6041 queries (allowed: 6210)

Test #32:

score: 0
Accepted
time: 23ms
memory: 9076kb

input:

2000
2001497
2001496
2001495
2001494
2001493
2001492
2001491
2001490
2001489
2001488
2001487
2001486
2001485
2001484
2001483
2001482
2001481
2001480
2001479
2001478
2001477
2001476
2001475
2001474
2001473
2001472
2001471
2001470
2001469
2001468
2001467
2001466
2001465
2001464
2001463
2001462
2001461...

output:

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

result:

ok used 6044 queries (allowed: 6210)

Test #33:

score: 0
Accepted
time: 7ms
memory: 8940kb

input:

2000
3996999
3997000
3997001
3997002
3997003
3997004
3997005
3997006
3997007
3997008
3997009
3997010
3997011
3997012
3997013
3997014
3997015
3997016
3997017
3997018
3997019
3997020
3997021
3997022
3997023
3997024
3997025
3997026
3997027
3997028
3997029
3997030
3997031
3997032
3997033
3997034
3997035...

output:

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

result:

ok used 6060 queries (allowed: 6210)

Test #34:

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

input:

2000
2002000
2001999
2001998
2001997
2001996
2001995
2001994
2001993
2001992
2001991
2001990
2001989
2001988
2001987
2001986
2001985
2001984
2001983
2001982
2001981
2001980
2001979
2001978
2001977
2001976
2001975
2001974
2001973
2001972
2001971
2001970
2001969
2001968
2001967
2001966
2001965
2001964...

output:

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

result:

ok used 6050 queries (allowed: 6210)

Test #35:

score: 0
Accepted
time: 14ms
memory: 9012kb

input:

2000
142416552
32407028
32406966
32406887
32436432
142421155
32439859
142421115
139133608
32439451
142419268
32438972
32438947
32406174
32406179
142419059
142419001
32438674
32438601
32438438
142424038
32432384
32432296
142296614
142296636
142296538
32431488
32431411
142296905
142296272
32432841
324...

output:

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

result:

ok used 6062 queries (allowed: 6210)

Test #36:

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

input:

2000
122730683
122786518
113227385
122786740
113227312
113227927
2411301
122784769
122784777
122784850
2411182
2411083
2410906
122785036
2410309
122772589
2410017
2410003
122772000
2409669
122780477
2408118
2408231
2408373
122764878
2408517
122702071
113234037
2408673
113233183
113233011
113232958
1...

output:

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

result:

ok used 6073 queries (allowed: 6210)

Test #37:

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

input:

2000
149523593
45544589
149524635
45547758
149524669
141238841
45547839
141240751
149517520
45548348
149516951
45559146
45559214
149486850
45347453
45347558
45347715
45347867
45347754
149460116
45347291
149466936
45558204
149466169
149466023
45558158
149466247
45356652
149469955
46370856
149460762
1...

output:

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

result:

ok used 6080 queries (allowed: 6210)

Test #38:

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

input:

2000
49573020
49573071
49573401
49573443
235371494
51815810
235361687
235361750
51815653
51815525
51094124
235368039
51094232
235361170
235360398
51094473
51094548
51078065
51077978
51077371
51077894
235365688
51077829
235365088
235362065
51077038
271684375
51008948
235290979
235291201
235291247
235...

output:

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

result:

ok used 6068 queries (allowed: 6210)

Test #39:

score: 0
Accepted
time: 8ms
memory: 8952kb

input:

2000
3511347
3511360
310660748
1631736
310630743
310633707
3510872
3510278
310634809
1630776
3514534
310637559
310638388
310638456
310638705
3516778
1656656
1656659
1656677
1656896
310099929
310106296
1656516
1656500
310121385
1660982
310124079
310124281
1663272
310124852
310124876
1663201
310125037...

output:

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

result:

ok used 6070 queries (allowed: 6210)

Test #40:

score: 0
Accepted
time: 16ms
memory: 8892kb

input:

2000
236541502
236542009
22714391
22714301
236542804
236543034
232844596
22713869
236362359
22714823
68046051
68045994
236499229
67350653
67353193
236484599
236484569
236484243
67824462
67824455
67824607
236497110
67824956
67824924
67824691
236496019
67844279
67844410
67844451
236492585
67842557
678...

output:

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

result:

ok used 6075 queries (allowed: 6210)

Test #41:

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

input:

2000
224722731
94007271
94007303
224532732
224721789
94007573
94007718
224721346
224532991
94004899
224718922
94004857
94004699
94004689
224716661
224716246
224716146
224716052
94056574
94056581
224715561
94056613
94056855
94056935
94057235
224631369
93808368
93808417
373674267
93808396
224499215
93...

output:

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

result:

ok used 6076 queries (allowed: 6210)

Test #42:

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

input:

2000
268195443
14750317
14539569
268193931
14539667
268192652
17564362
14539542
268191719
17564564
268179057
14539463
17565433
268182615
17565287
17565298
268177858
17638989
268174905
17638143
17638141
17638276
17637701
423026710
14507953
423025995
423025452
423024912
17637458
17637432
422991452
145...

output:

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

result:

ok used 6072 queries (allowed: 6210)