Submission #938403

# Submission time Handle Problem Language Result Execution time Memory
938403 2024-03-05T05:55:55 Z Pacybwoah Mađioničar (COI22_madionicar) C++17
100 / 100
1113 ms 596 KB
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool ask(int l,int r){
    cout<<"? "<<l<<" "<<r<<endl;
    bool flag;
    cin>>flag;
    return flag;
}
int main(){
    int n;
    cin>>n;
    int ans=0;
    for(int i=2;i<=2*n;i++){
        int l,r;
        if((i-ans+1)%2==0) l=(i-ans+1)/2-1;
        else l=(i-ans+1)/2;
        r=i-l;
        while(l>=1&&r<=n&&ask(l,r)){
            l--;
            r++;
        }
        l++;
        r--;
        ans=max(ans,r-l+1);
    }
    cout<<"! "<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 108 ms 344 KB Output is correct
2 Correct 65 ms 344 KB Output is correct
3 Correct 67 ms 340 KB Output is correct
4 Correct 66 ms 344 KB Output is correct
5 Correct 73 ms 344 KB Output is correct
6 Correct 72 ms 344 KB Output is correct
7 Correct 70 ms 596 KB Output is correct
8 Correct 51 ms 344 KB Output is correct
9 Correct 59 ms 596 KB Output is correct
10 Correct 70 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 108 ms 344 KB Output is correct
2 Correct 65 ms 344 KB Output is correct
3 Correct 67 ms 340 KB Output is correct
4 Correct 66 ms 344 KB Output is correct
5 Correct 73 ms 344 KB Output is correct
6 Correct 72 ms 344 KB Output is correct
7 Correct 70 ms 596 KB Output is correct
8 Correct 51 ms 344 KB Output is correct
9 Correct 59 ms 596 KB Output is correct
10 Correct 70 ms 344 KB Output is correct
11 Correct 678 ms 344 KB Output is correct
12 Correct 649 ms 344 KB Output is correct
13 Correct 657 ms 344 KB Output is correct
14 Correct 688 ms 344 KB Output is correct
15 Correct 604 ms 344 KB Output is correct
16 Correct 639 ms 344 KB Output is correct
17 Correct 666 ms 344 KB Output is correct
18 Correct 655 ms 344 KB Output is correct
19 Correct 704 ms 344 KB Output is correct
20 Correct 633 ms 344 KB Output is correct
21 Correct 702 ms 344 KB Output is correct
22 Correct 650 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 950 ms 344 KB Output is correct
2 Correct 503 ms 344 KB Output is correct
3 Correct 1080 ms 344 KB Output is correct
4 Correct 999 ms 344 KB Output is correct
5 Correct 979 ms 344 KB Output is correct
6 Correct 1036 ms 344 KB Output is correct
7 Correct 1056 ms 344 KB Output is correct
8 Correct 924 ms 344 KB Output is correct
9 Correct 943 ms 344 KB Output is correct
10 Correct 967 ms 344 KB Output is correct
11 Correct 1073 ms 344 KB Output is correct
12 Correct 1027 ms 344 KB Output is correct
13 Correct 978 ms 344 KB Output is correct
14 Correct 1072 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 108 ms 344 KB Output is correct
2 Correct 65 ms 344 KB Output is correct
3 Correct 67 ms 340 KB Output is correct
4 Correct 66 ms 344 KB Output is correct
5 Correct 73 ms 344 KB Output is correct
6 Correct 72 ms 344 KB Output is correct
7 Correct 70 ms 596 KB Output is correct
8 Correct 51 ms 344 KB Output is correct
9 Correct 59 ms 596 KB Output is correct
10 Correct 70 ms 344 KB Output is correct
11 Correct 678 ms 344 KB Output is correct
12 Correct 649 ms 344 KB Output is correct
13 Correct 657 ms 344 KB Output is correct
14 Correct 688 ms 344 KB Output is correct
15 Correct 604 ms 344 KB Output is correct
16 Correct 639 ms 344 KB Output is correct
17 Correct 666 ms 344 KB Output is correct
18 Correct 655 ms 344 KB Output is correct
19 Correct 704 ms 344 KB Output is correct
20 Correct 633 ms 344 KB Output is correct
21 Correct 702 ms 344 KB Output is correct
22 Correct 650 ms 344 KB Output is correct
23 Correct 950 ms 344 KB Output is correct
24 Correct 503 ms 344 KB Output is correct
25 Correct 1080 ms 344 KB Output is correct
26 Correct 999 ms 344 KB Output is correct
27 Correct 979 ms 344 KB Output is correct
28 Correct 1036 ms 344 KB Output is correct
29 Correct 1056 ms 344 KB Output is correct
30 Correct 924 ms 344 KB Output is correct
31 Correct 943 ms 344 KB Output is correct
32 Correct 967 ms 344 KB Output is correct
33 Correct 1073 ms 344 KB Output is correct
34 Correct 1027 ms 344 KB Output is correct
35 Correct 978 ms 344 KB Output is correct
36 Correct 1072 ms 344 KB Output is correct
37 Correct 966 ms 344 KB Output is correct
38 Correct 1064 ms 344 KB Output is correct
39 Correct 999 ms 344 KB Output is correct
40 Correct 999 ms 344 KB Output is correct
41 Correct 965 ms 344 KB Output is correct
42 Correct 918 ms 344 KB Output is correct
43 Correct 940 ms 344 KB Output is correct
44 Correct 947 ms 344 KB Output is correct
45 Correct 940 ms 344 KB Output is correct
46 Correct 949 ms 344 KB Output is correct
47 Correct 1014 ms 344 KB Output is correct
48 Correct 1012 ms 344 KB Output is correct
49 Correct 1113 ms 344 KB Output is correct
50 Correct 773 ms 344 KB Output is correct
51 Correct 1014 ms 344 KB Output is correct
52 Correct 1042 ms 344 KB Output is correct