QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#131858#5128. Dividing DNA Yarema#AC ✓50ms3564kbC++17776b2023-07-28 16:32:542023-07-28 16:32:55

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-28 16:32:55]
  • 评测
  • 测评结果:AC
  • 用时:50ms
  • 内存:3564kb
  • [2023-07-28 16:32:54]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FILL(a, b) memset(a, b, sizeof(a))

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

const int INF = 1e9 + 7;

int main()
{
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	
	int n;
	cin >> n;
	
	int cnt = 0;
	int l = 0;
	string s;
	FOR (i, 0, n)
	{
		cout << "? " << l << ' ' << i + 1 << endl;
		cin >> s;
		if (s == "absent")
		{
			cnt++;
			l = i + 1;
		}
	}
	cout << "! " << cnt << endl;
	 
	return 0;
}

詳細信息

Test #1:

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

input:

1
absent

output:

? 0 1
! 1

result:

ok Used 1 queries

Test #2:

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

input:

5
present
absent
present
present
absent

output:

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

result:

ok Used 5 queries

Test #3:

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

input:

20
present
present
present
present
present
present
absent
present
absent
present
absent
present
present
present
present
absent
present
absent
present
present

output:

? 0 1
? 0 2
? 0 3
? 0 4
? 0 5
? 0 6
? 0 7
? 7 8
? 7 9
? 9 10
? 9 11
? 11 12
? 11 13
? 11 14
? 11 15
? 11 16
? 16 17
? 16 18
? 18 19
? 18 20
! 5

result:

ok Used 20 queries

Test #4:

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

input:

30
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present

output:

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

result:

ok Used 30 queries

Test #5:

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

input:

40
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
pres...

output:

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

result:

ok Used 40 queries

Test #6:

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

input:

50
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
present
pr...

output:

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

result:

ok Used 50 queries

Test #7:

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

input:

60
present
present
present
present
absent
present
present
present
present
present
absent
present
absent
present
present
present
absent
present
present
present
present
absent
present
present
present
present
present
present
absent
present
present
present
absent
present
present
present
present
present
...

output:

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

result:

ok Used 60 queries

Test #8:

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

input:

33
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present

output:

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

result:

ok Used 33 queries

Test #9:

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

input:

54
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absen...

output:

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

result:

ok Used 54 queries

Test #10:

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

input:

43
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
...

output:

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

result:

ok Used 43 queries

Test #11:

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

input:

55
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
pres...

output:

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

result:

ok Used 55 queries

Test #12:

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

input:

60
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
pr...

output:

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

result:

ok Used 60 queries

Test #13:

score: 0
Accepted
time: 24ms
memory: 3444kb

input:

10000
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
a...

output:

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

result:

ok Used 10000 queries

Test #14:

score: 0
Accepted
time: 42ms
memory: 3432kb

input:

10000
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
ab...

output:

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

result:

ok Used 10000 queries

Test #15:

score: 0
Accepted
time: 21ms
memory: 3516kb

input:

10000
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
present
present
prese...

output:

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

result:

ok Used 10000 queries

Test #16:

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

input:

10000
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
p...

output:

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

result:

ok Used 10000 queries

Test #17:

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

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #18:

score: 0
Accepted
time: 26ms
memory: 3544kb

input:

10000
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
...

output:

? 0 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...

result:

ok Used 10000 queries

Test #19:

score: 0
Accepted
time: 24ms
memory: 3496kb

input:

10000
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
a...

output:

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

result:

ok Used 10000 queries

Test #20:

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

input:

10000
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
ab...

output:

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

result:

ok Used 10000 queries

Test #21:

score: 0
Accepted
time: 50ms
memory: 3476kb

input:

10000
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
p...

output:

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

result:

ok Used 10000 queries

Test #22:

score: 0
Accepted
time: 20ms
memory: 3448kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #23:

score: 0
Accepted
time: 19ms
memory: 3564kb

input:

10000
present
present
present
present
absent
present
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
absent
absent
present
present
present
present
present
absent
absent
present
present
present
absent
present
absent
present
present
present...

output:

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

result:

ok Used 10000 queries

Test #24:

score: 0
Accepted
time: 26ms
memory: 3432kb

input:

10000
present
present
present
present
absent
present
present
present
absent
absent
present
present
absent
absent
present
present
present
present
absent
present
present
present
absent
present
present
present
present
absent
present
present
absent
present
absent
present
present
present
present
absent
p...

output:

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

result:

ok Used 10000 queries

Test #25:

score: 0
Accepted
time: 47ms
memory: 3496kb

input:

10000
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
pr...

output:

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

result:

ok Used 10000 queries

Test #26:

score: 0
Accepted
time: 41ms
memory: 3452kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
...

output:

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

result:

ok Used 10000 queries

Test #27:

score: 0
Accepted
time: 19ms
memory: 3444kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #28:

score: 0
Accepted
time: 32ms
memory: 3504kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #29:

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

input:

10
present
present
present
present
present
present
present
present
present
present

output:

? 0 1
? 0 2
? 0 3
? 0 4
? 0 5
? 0 6
? 0 7
? 0 8
? 0 9
? 0 10
! 0

result:

ok Used 10 queries

Test #30:

score: 0
Accepted
time: 32ms
memory: 3472kb

input:

10000
present
present
present
absent
present
present
present
present
present
absent
present
present
present
absent
present
present
present
present
present
absent
present
absent
present
present
present
present
absent
present
present
present
absent
present
present
present
present
absent
present
presen...

output:

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

result:

ok Used 10000 queries

Test #31:

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

input:

10000
present
present
present
absent
present
present
absent
present
present
present
present
absent
present
absent
present
present
present
present
present
absent
present
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
present
absent
presen...

output:

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

result:

ok Used 10000 queries

Test #32:

score: 0
Accepted
time: 26ms
memory: 3496kb

input:

10000
present
present
present
present
absent
present
present
present
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
absent
present
pre...

output:

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

result:

ok Used 10000 queries

Test #33:

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

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #34:

score: 0
Accepted
time: 50ms
memory: 3496kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #35:

score: 0
Accepted
time: 20ms
memory: 3448kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present...

output:

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

result:

ok Used 10000 queries

Test #36:

score: 0
Accepted
time: 31ms
memory: 3500kb

input:

10000
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
absent
present
present
ab...

output:

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

result:

ok Used 10000 queries

Test #37:

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

input:

10000
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
p...

output:

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

result:

ok Used 10000 queries

Test #38:

score: 0
Accepted
time: 35ms
memory: 3452kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
...

output:

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

result:

ok Used 10000 queries

Test #39:

score: 0
Accepted
time: 36ms
memory: 3500kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #40:

score: 0
Accepted
time: 31ms
memory: 3500kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #41:

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

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #42:

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

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #43:

score: 0
Accepted
time: 35ms
memory: 3440kb

input:

10000
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
absent
present
present
present
present
present
present
present
absent
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
pr...

output:

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

result:

ok Used 10000 queries

Test #44:

score: 0
Accepted
time: 30ms
memory: 3440kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
...

output:

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

result:

ok Used 10000 queries

Test #45:

score: 0
Accepted
time: 36ms
memory: 3556kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present...

output:

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

result:

ok Used 10000 queries

Test #46:

score: 0
Accepted
time: 42ms
memory: 3432kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
presen...

output:

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

result:

ok Used 10000 queries

Test #47:

score: 0
Accepted
time: 19ms
memory: 3452kb

input:

10000
present
absent
present
absent
present
absent
absent
absent
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
present
absent
absent
present
absent
absent
absent
absent
present
absent
absent
present
absent
absent
absent
present
absent
absent
absent
...

output:

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

result:

ok Used 10000 queries

Test #48:

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

input:

10000
present
absent
present
absent
present
absent
absent
present
absent
absent
absent
present
present
absent
absent
present
absent
present
absent
present
absent
present
present
present
absent
present
present
present
absent
present
present
present
absent
present
absent
present
present
present
absent...

output:

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

result:

ok Used 10000 queries