Submission #779416

# Submission time Handle Problem Language Result Execution time Memory
779416 2023-07-11T11:40:58 Z groshi Mađioničar (COI22_madionicar) C++17
100 / 100
1552 ms 292 KB
#include<bits/stdc++.h>
#define int long long
using namespace std;
bool pyta(int x,int y)
{
    cout<<"? "<<x<<" "<<y<<"\n";
    int co;
    cin>>co;
    return co;
}
int32_t main()
{
    //cin.tie(0);
    //cout.tie(0);
    //ios_base::sync_with_stdio(0);
    int n;
    cin>>n;
    int nie=3;
    for(int i=1;i<=n;i++)
    {
        while(i-nie/2>=1 && i+nie/2<=n && pyta(i-nie/2,i+nie/2))
                nie+=2;
    }
    int parz=2;
    for(int i=1;i<=n;i++)
    {
        while(i-parz/2>=1 && i+parz/2-1<=n && pyta(i-parz/2,i+parz/2-1))
            parz+=2;
    }
    cout<<"! "<<max(nie-2,parz-2);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 113 ms 208 KB Output is correct
2 Correct 79 ms 208 KB Output is correct
3 Correct 69 ms 208 KB Output is correct
4 Correct 137 ms 208 KB Output is correct
5 Correct 133 ms 208 KB Output is correct
6 Correct 124 ms 208 KB Output is correct
7 Correct 109 ms 208 KB Output is correct
8 Correct 120 ms 208 KB Output is correct
9 Correct 86 ms 228 KB Output is correct
10 Correct 128 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 208 KB Output is correct
2 Correct 79 ms 208 KB Output is correct
3 Correct 69 ms 208 KB Output is correct
4 Correct 137 ms 208 KB Output is correct
5 Correct 133 ms 208 KB Output is correct
6 Correct 124 ms 208 KB Output is correct
7 Correct 109 ms 208 KB Output is correct
8 Correct 120 ms 208 KB Output is correct
9 Correct 86 ms 228 KB Output is correct
10 Correct 128 ms 208 KB Output is correct
11 Correct 847 ms 208 KB Output is correct
12 Correct 776 ms 208 KB Output is correct
13 Correct 1012 ms 208 KB Output is correct
14 Correct 765 ms 208 KB Output is correct
15 Correct 1026 ms 208 KB Output is correct
16 Correct 835 ms 208 KB Output is correct
17 Correct 930 ms 208 KB Output is correct
18 Correct 754 ms 208 KB Output is correct
19 Correct 864 ms 208 KB Output is correct
20 Correct 907 ms 208 KB Output is correct
21 Correct 885 ms 208 KB Output is correct
22 Correct 827 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1520 ms 208 KB Output is correct
2 Correct 745 ms 208 KB Output is correct
3 Correct 1245 ms 208 KB Output is correct
4 Correct 1125 ms 208 KB Output is correct
5 Correct 1129 ms 208 KB Output is correct
6 Correct 1242 ms 208 KB Output is correct
7 Correct 1345 ms 208 KB Output is correct
8 Correct 1413 ms 292 KB Output is correct
9 Correct 1299 ms 208 KB Output is correct
10 Correct 1260 ms 208 KB Output is correct
11 Correct 1119 ms 208 KB Output is correct
12 Correct 1382 ms 208 KB Output is correct
13 Correct 1331 ms 208 KB Output is correct
14 Correct 1362 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 208 KB Output is correct
2 Correct 79 ms 208 KB Output is correct
3 Correct 69 ms 208 KB Output is correct
4 Correct 137 ms 208 KB Output is correct
5 Correct 133 ms 208 KB Output is correct
6 Correct 124 ms 208 KB Output is correct
7 Correct 109 ms 208 KB Output is correct
8 Correct 120 ms 208 KB Output is correct
9 Correct 86 ms 228 KB Output is correct
10 Correct 128 ms 208 KB Output is correct
11 Correct 847 ms 208 KB Output is correct
12 Correct 776 ms 208 KB Output is correct
13 Correct 1012 ms 208 KB Output is correct
14 Correct 765 ms 208 KB Output is correct
15 Correct 1026 ms 208 KB Output is correct
16 Correct 835 ms 208 KB Output is correct
17 Correct 930 ms 208 KB Output is correct
18 Correct 754 ms 208 KB Output is correct
19 Correct 864 ms 208 KB Output is correct
20 Correct 907 ms 208 KB Output is correct
21 Correct 885 ms 208 KB Output is correct
22 Correct 827 ms 208 KB Output is correct
23 Correct 1520 ms 208 KB Output is correct
24 Correct 745 ms 208 KB Output is correct
25 Correct 1245 ms 208 KB Output is correct
26 Correct 1125 ms 208 KB Output is correct
27 Correct 1129 ms 208 KB Output is correct
28 Correct 1242 ms 208 KB Output is correct
29 Correct 1345 ms 208 KB Output is correct
30 Correct 1413 ms 292 KB Output is correct
31 Correct 1299 ms 208 KB Output is correct
32 Correct 1260 ms 208 KB Output is correct
33 Correct 1119 ms 208 KB Output is correct
34 Correct 1382 ms 208 KB Output is correct
35 Correct 1331 ms 208 KB Output is correct
36 Correct 1362 ms 208 KB Output is correct
37 Correct 1283 ms 208 KB Output is correct
38 Correct 1213 ms 208 KB Output is correct
39 Correct 1291 ms 208 KB Output is correct
40 Correct 1324 ms 208 KB Output is correct
41 Correct 1279 ms 208 KB Output is correct
42 Correct 1219 ms 208 KB Output is correct
43 Correct 1552 ms 208 KB Output is correct
44 Correct 1280 ms 208 KB Output is correct
45 Correct 1452 ms 208 KB Output is correct
46 Correct 1287 ms 208 KB Output is correct
47 Correct 1315 ms 208 KB Output is correct
48 Correct 1002 ms 208 KB Output is correct
49 Correct 1121 ms 208 KB Output is correct
50 Correct 1260 ms 208 KB Output is correct
51 Correct 1336 ms 208 KB Output is correct
52 Correct 1394 ms 208 KB Output is correct