QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#538075#5128. Dividing DNA qwqqwqqwqeAC ✓78ms3884kbC++171.4kb2024-08-30 22:52:562024-08-30 22:52:56

Judging History

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

  • [2024-08-30 22:52:56]
  • 评测
  • 测评结果:AC
  • 用时:78ms
  • 内存:3884kb
  • [2024-08-30 22:52:56]
  • 提交

answer

#include"bits/stdc++.h"
#define _det(...) fprintf(stderr,__VA_ARGS__)
#define Print(a) cerr<<a<<"\n"
#define IOS ios::sync_with_stdio(0);cin.tie(0)
#define Cases int T;cin>>T;while(T--)
#define Debug(in) cerr<<#in<<" = "<<(in)<<"\n"
#define Watch(in) Detect;Debug(in);
#define Detect _det("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
using namespace std;

const int maxn = 1e4+5;
int a[maxn];
int dp[maxn];

int query (int l, int r) {
    cout<<"? "<<l-1<<" "<<r<<endl;
    string s;cin>>s;
    if (s == "present") return true;
    else return false;
}
signed main () {
    int n; cin>>n;
    int r = 1;
    int l = 1;
    while (r<=n) {
        int present = query(l,r);
        if (present) {
            a[r] = l-1;
            if (a[r] == 0) a[r] = -1;
        }
        else {
            while (l<r && !present) {
                l++;
                present = query(l,r);
            }
            if (l == r && !present) a[r] = r;
            else a[r] = l-1;
        }
        r++;
    }   
    // for (int i=1;i<=n;i++) {
    //     cerr<<a[i]<<" ";
    // }
    // cerr<<endl;
    for (int i=1;i<=n;i++) {
        if (a[i] == -1) continue;
        for (int j=0;j<a[i];j++) {
            dp[i] = max(dp[i],dp[j]+1);
        }
    }
    cout<<"! "<<dp[n]<<endl;
}
/*
5
present
absent
present
absent
present
present
absent
absent
present
*/

詳細信息

Test #1:

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

input:

1
absent

output:

? 0 1
! 1

result:

ok Used 1 queries

Test #2:

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

input:

5
present
absent
present
absent
present
present
absent
absent
present

output:

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

result:

ok Used 9 queries

Test #3:

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

input:

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

output:

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

result:

ok Used 38 queries

Test #4:

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

input:

30
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
absent
absent
absent
absent
absent
absent
absent
present
present
present
present
present
present
present
absent
absent
absent
absent
absent
absent
absent
absent
present
absent
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
? 1 14
? 2 14
? 3 14
? 4 14
? 5 14
? 6 14
? 7 14
? 8 14
? 8 15
? 8 16
? 8 17
? 8 18
? 8 19
? 8 20
? 8 21
? 9 21
? 10 21
? 11 21
? 12 21
? 13 21
? 14 21
? 15 21
? 16 21
? 16 22
? 17 22
? 17 23
? 17 24
? 17 25
? 1...

result:

ok Used 47 queries

Test #5:

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

input:

40
present
present
present
present
present
present
present
present
present
present
absent
absent
absent
absent
present
present
present
present
present
present
present
present
present
present
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
present
absent
absent
absent
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
? 1 11
? 2 11
? 3 11
? 4 11
? 4 12
? 4 13
? 4 14
? 4 15
? 4 16
? 4 17
? 4 18
? 4 19
? 4 20
? 4 21
? 5 21
? 6 21
? 7 21
? 8 21
? 9 21
? 10 21
? 11 21
? 12 21
? 13 21
? 14 21
? 14 22
? 15 22
? 16 22
? 17 22
? 17 23
? 17 24
? 17 25
? 1...

result:

ok Used 68 queries

Test #6:

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

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
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
prese...

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
? 1 27
? 2 27
? 3 27
? 4 27
? 5 27
? 6 27
? 7 27
? 8 27
? 9 27
? 10 27
? 11 27
? 12 27
? 12 28
? 12 29
? 12 30
? 12 31
?...

result:

ok Used 82 queries

Test #7:

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

input:

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

output:

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

result:

ok Used 113 queries

Test #8:

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

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
absent
present
absent
present
absent
present
abse...

output:

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

result:

ok Used 65 queries

Test #9:

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

input:

54
present
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
pres...

output:

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

result:

ok Used 106 queries

Test #10:

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

input:

43
present
present
present
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
pre...

output:

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

result:

ok Used 82 queries

Test #11:

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

input:

55
present
present
present
present
present
present
present
present
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
? 0 3
? 0 4
? 0 5
? 0 6
? 0 7
? 0 8
? 0 9
? 0 10
? 1 10
? 1 11
? 2 11
? 2 12
? 3 12
? 3 13
? 4 13
? 4 14
? 5 14
? 5 15
? 6 15
? 6 16
? 7 16
? 7 17
? 8 17
? 8 18
? 9 18
? 9 19
? 10 19
? 10 20
? 11 20
? 11 21
? 12 21
? 12 22
? 13 22
? 13 23
? 14 23
? 14 24
? 15 24
? 15 25
? 16 25
? 16 26
?...

result:

ok Used 101 queries

Test #12:

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

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
absent
present
absent
present
absent
present
absen...

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
? 1 30
? 1 31
? 2 31
? 2 32
? 3 32
? 3 33
? 4 33
? 4 34
? 5 34
? 5 35
? 6 35
? 6 36
? 7 36
? 7 37
?...

result:

ok Used 91 queries

Test #13:

score: 0
Accepted
time: 48ms
memory: 3856kb

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
? 1 2
? 1 3
? 2 3
? 2 4
? 3 4
? 3 5
? 4 5
? 4 6
? 5 6
? 5 7
? 6 7
? 6 8
? 7 8
? 7 9
? 8 9
? 8 10
? 9 10
? 9 11
? 10 11
? 10 12
? 11 12
? 11 13
? 12 13
? 12 14
? 13 14
? 13 15
? 14 15
? 14 16
? 15 16
? 15 17
? 16 17
? 16 18
? 17 18
? 17 19
? 18 19
? 18 20
? 19 20
? 19 21
? 20 21
? 20 22
?...

result:

ok Used 19999 queries

Test #14:

score: 0
Accepted
time: 62ms
memory: 3844kb

input:

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

output:

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

result:

ok Used 19998 queries

Test #15:

score: 0
Accepted
time: 55ms
memory: 3652kb

input:

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

output:

? 0 1
? 0 2
? 0 3
? 0 4
? 0 5
? 1 5
? 1 6
? 1 7
? 2 7
? 3 7
? 3 8
? 3 9
? 3 10
? 4 10
? 5 10
? 6 10
? 6 11
? 6 12
? 7 12
? 8 12
? 8 13
? 8 14
? 8 15
? 9 15
? 10 15
? 11 15
? 11 16
? 11 17
? 12 17
? 13 17
? 13 18
? 13 19
? 13 20
? 14 20
? 15 20
? 16 20
? 16 21
? 16 22
? 17 22
? 18 22
? 18 23
? 18 24
...

result:

ok Used 19996 queries

Test #16:

score: 0
Accepted
time: 69ms
memory: 3644kb

input:

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

output:

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

result:

ok Used 19991 queries

Test #17:

score: 0
Accepted
time: 67ms
memory: 3676kb

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 19901 queries

Test #18:

score: 0
Accepted
time: 69ms
memory: 3612kb

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
? 0 2
? 1 2
? 1 3
? 2 3
? 2 4
? 3 4
? 3 5
? 4 5
? 4 6
? 5 6
? 5 7
? 6 7
? 6 8
? 7 8
? 7 9
? 8 9
? 8 10
? 9 10
? 9 11
? 10 11
? 10 12
? 11 12
? 11 13
? 12 13
? 12 14
? 13 14
? 13 15
? 14 15
? 14 16
? 15 16
? 15 17
? 16 17
? 16 18
? 17 18
? 17 19
? 18 19
? 18 20
? 19 20
? 19 21
? 20 21
? 20 22
?...

result:

ok Used 19999 queries

Test #19:

score: 0
Accepted
time: 57ms
memory: 3812kb

input:

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

output:

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

result:

ok Used 19999 queries

Test #20:

score: 0
Accepted
time: 56ms
memory: 3652kb

input:

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

output:

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

result:

ok Used 19997 queries

Test #21:

score: 0
Accepted
time: 43ms
memory: 3884kb

input:

10000
present
present
present
present
present
present
present
present
present
absent
present
present
present
present
present
present
present
present
present
present
absent
absent
absent
absent
absent
absent
absent
absent
absent
absent
present
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
? 1 10
? 1 11
? 1 12
? 1 13
? 1 14
? 1 15
? 1 16
? 1 17
? 1 18
? 1 19
? 1 20
? 2 20
? 3 20
? 4 20
? 5 20
? 6 20
? 7 20
? 8 20
? 9 20
? 10 20
? 11 20
? 11 21
? 11 22
? 11 23
? 11 24
? 11 25
? 11 26
? 11 27
? 11 28
? 11 29
? 11 30
? 12 30
? ...

result:

ok Used 19991 queries

Test #22:

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

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 19901 queries

Test #23:

score: 0
Accepted
time: 73ms
memory: 3608kb

input:

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

output:

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

result:

ok Used 19867 queries

Test #24:

score: 0
Accepted
time: 40ms
memory: 3836kb

input:

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

output:

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

result:

ok Used 19728 queries

Test #25:

score: 0
Accepted
time: 59ms
memory: 3652kb

input:

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

output:

? 0 1
? 0 2
? 0 3
? 0 4
? 0 5
? 0 6
? 0 7
? 0 8
? 1 8
? 2 8
? 3 8
? 4 8
? 5 8
? 6 8
? 6 9
? 6 10
? 6 11
? 6 12
? 6 13
? 6 14
? 6 15
? 6 16
? 6 17
? 7 17
? 8 17
? 9 17
? 9 18
? 9 19
? 10 19
? 11 19
? 12 19
? 13 19
? 14 19
? 14 20
? 14 21
? 14 22
? 14 23
? 15 23
? 16 23
? 17 23
? 18 23
? 19 23
? 19 24...

result:

ok Used 19870 queries

Test #26:

score: 0
Accepted
time: 52ms
memory: 3672kb

input:

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

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
? 1 15
? 2 15
? 3 15
? 4 15
? 5 15
? 6 15
? 7 15
? 8 15
? 8 16
? 8 17
? 8 18
? 8 19
? 8 20
? 8 21
? 8 22
? 8 23
? 8 24
? 8 25
? 8 26
? 8 27
? 8 28
? 9 28
? 10 28
? 11 28
? 12 28
? 13 28
? 14 28
? 15 28
? ...

result:

ok Used 19773 queries

Test #27:

score: 0
Accepted
time: 57ms
memory: 3884kb

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 19620 queries

Test #28:

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

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 19288 queries

Test #29:

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

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

input:

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

output:

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

result:

ok Used 19920 queries

Test #31:

score: 0
Accepted
time: 74ms
memory: 3804kb

input:

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

output:

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

result:

ok Used 19974 queries

Test #32:

score: 0
Accepted
time: 69ms
memory: 3604kb

input:

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

output:

? 0 1
? 0 2
? 0 3
? 0 4
? 0 5
? 1 5
? 2 5
? 3 5
? 3 6
? 3 7
? 3 8
? 3 9
? 3 10
? 3 11
? 3 12
? 3 13
? 4 13
? 5 13
? 6 13
? 7 13
? 8 13
? 9 13
? 10 13
? 10 14
? 10 15
? 10 16
? 10 17
? 10 18
? 11 18
? 12 18
? 13 18
? 14 18
? 15 18
? 15 19
? 15 20
? 15 21
? 15 22
? 15 23
? 15 24
? 16 24
? 17 24
? 18 2...

result:

ok Used 19786 queries

Test #33:

score: 0
Accepted
time: 59ms
memory: 3668kb

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 19629 queries

Test #34:

score: 0
Accepted
time: 71ms
memory: 3652kb

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 19499 queries

Test #35:

score: 0
Accepted
time: 72ms
memory: 3588kb

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
absent
absent
absent
absent
absent
absent
absent
absent
absent
...

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
? 1 29
? 2 29
? 3 29
? 4 29
? 5 29
? 6 29
? 7 29
? 8 29
? 9 29
? 10 29
? 11 29
? 12 29
? 13 29
? 14 29
? 1...

result:

ok Used 19505 queries

Test #36:

score: 0
Accepted
time: 58ms
memory: 3572kb

input:

10000
present
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
p...

output:

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

result:

ok Used 19998 queries

Test #37:

score: 0
Accepted
time: 78ms
memory: 3884kb

input:

10000
present
present
present
present
present
present
present
present
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
prese...

output:

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

result:

ok Used 19991 queries

Test #38:

score: 0
Accepted
time: 63ms
memory: 3880kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
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
? 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
? 1 17
? 1 18
? 2 18
? 2 19
? 3 19
? 3 20
? 4 20
? 4 21
? 5 21
? 5 22
? 6 22
? 6 23
? 7 23
? 7 24
? 8 24
? 8 25
? 9 25
? 9 26
? 10 26
? 10 27
? 11 27
? 11 28
? 12 28
? 12 29
? 13 29
? 13 30
...

result:

ok Used 19984 queries

Test #39:

score: 0
Accepted
time: 63ms
memory: 3660kb

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 19402 queries

Test #40:

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

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 15051 queries

Test #41:

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

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 15001 queries

Test #42:

score: 0
Accepted
time: 29ms
memory: 3648kb

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 15000 queries

Test #43:

score: 0
Accepted
time: 71ms
memory: 3872kb

input:

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

output:

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

result:

ok Used 19997 queries

Test #44:

score: 0
Accepted
time: 55ms
memory: 3820kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
absent
absent
absent
present
present
present
present
present
present
present
present
present
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
? 1 15
? 2 15
? 3 15
? 4 15
? 4 16
? 4 17
? 4 18
? 4 19
? 4 20
? 4 21
? 4 22
? 4 23
? 4 24
? 4 25
? 4 26
? 4 27
? 4 28
? 4 29
? 4 30
? 4 31
? 4 32
? 4 33
? 4 34
? 4 35
? 4 36
? 5 36
? 6 36
? 7 36
? 8 36
?...

result:

ok Used 19977 queries

Test #45:

score: 0
Accepted
time: 51ms
memory: 3872kb

input:

10000
present
present
present
present
present
present
present
present
present
present
present
present
present
present
present
absent
absent
absent
absent
absent
present
present
present
present
present
present
present
present
present
present
absent
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
? 0 12
? 0 13
? 0 14
? 0 15
? 0 16
? 1 16
? 2 16
? 3 16
? 4 16
? 5 16
? 5 17
? 5 18
? 5 19
? 5 20
? 5 21
? 5 22
? 5 23
? 5 24
? 5 25
? 5 26
? 6 26
? 6 27
? 6 28
? 6 29
? 6 30
? 6 31
? 6 32
? 6 33
? 6 34
? 6 35
? 6 36
? 6 37
? 6 38
?...

result:

ok Used 19941 queries

Test #46:

score: 0
Accepted
time: 52ms
memory: 3664kb

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 19728 queries

Test #47:

score: 0
Accepted
time: 57ms
memory: 3656kb

input:

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

output:

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

result:

ok Used 19999 queries

Test #48:

score: 0
Accepted
time: 62ms
memory: 3676kb

input:

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

output:

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

result:

ok Used 19999 queries