QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#416379 | #8239. Mysterious Tree | Godwang# | AC ✓ | 5ms | 3876kb | C++14 | 3.2kb | 2024-05-21 19:44:45 | 2024-05-21 19:44:45 |
Judging History
answer
#include <iostream>
using namespace std;
#include <set>
#include <algorithm>
#include <cmath>
#include <map>
#include <cstdio>
#include <string>
#include <cstring>
#include <string.h>
#include <stdlib.h>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <stack>
#include <queue>
#include <ctype.h>
#include <vector>
#include <random>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll ,ll >
//#define endl '\n'
const double pai = acos(-1);
ll extend_gcd(ll a, ll b, ll &x, ll &y)
{
if (b == 0)
{
x = 1;
y = 0;
return a;
}
ll d = extend_gcd(b, a % b, y, x);
y -= a / b * x;
return d;
}
ll fastpow(ll a, ll n, ll mod)
{
ll ans = 1;
a %= mod;
while (n)
{
if (n & 1)
ans = (ans * a)%mod; //% mod
a = (a * a)%mod; //% mod
n >>= 1;
}
return ans;
}
int dir[4][2] =
{
{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; // d a w s
const ll inf = 1000000000000000000ll;
const ll mod = 1e9 + 7, P1 = 13331;
const double eps = 1e-7;
const int N = 4e5 + 10, M = 1e6 + 10;
int t,n;
ll a[N];
int query(int u,int v)
{
cout<<"? "<<u<<' '<<v<<endl;
int ans;
cin>>ans;
return ans;
}
void solve()
{
int n;
cin>>n;
bool flag=false;
int pos1=-1,pos2=-1;
for(int i=1;i+1<=n;i+=2)
{
int ans=query(i,i+1);
if(ans==1)
{
pos1=i;
pos2=i+1;
flag=true;
break;
}
}
if(flag==false&&n%2==1)
{
if(query(1,n)==1)
{
flag=true;
pos1=1;
pos2=n;
}
}
if(!flag)
{
cout<<"! 1"<<endl;
return;
}
else
{
int cnt=3;
int cnt1=0,cnt0=0;
vector<int>candidate;
for(int i=1;i<=n;i++)
{
if(i==pos1||i==pos2)
continue;
candidate.push_back(i);
if(candidate.size()==2)
break;
}
int ans1=query(candidate[0],pos1);
if(ans1==true)
{
int ans2=query(candidate[1],pos1);
if(ans2==true)
{
cout<<"! 2"<<endl;
return;
}
else if(ans2==false)
{
cout<<"! 1"<<endl;
return;
}
}
else if(ans1==false)
{
int ans2=query(candidate[0],pos2);
int ans3=query(candidate[1],pos2);
if(ans2&&ans3)
{
cout<<"! 2"<<endl;
}
else
{
cout<<"! 1"<<endl;
}
}
}
}
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//freopen("ain.txt", "r", stdin);freopen("aout.txt", "w", stdout);
int t;
cin>>t;
while(t--)
{
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3576kb
input:
2 4 1 0 1 0 4 0 1 1 1
output:
? 1 2 ? 3 1 ? 3 2 ? 4 2 ! 1 ? 1 2 ? 3 4 ? 1 3 ? 2 3 ! 2
result:
ok Correct (2 test cases)
Test #2:
score: 0
Accepted
time: 3ms
memory: 3836kb
input:
87 13 0 0 0 0 0 1 0 1 1 15 0 0 0 0 0 0 1 1 1 7 0 0 0 1 0 1 1 15 0 0 0 1 0 0 0 19 0 0 0 0 0 1 1 1 20 0 0 0 0 0 0 0 0 0 0 7 0 0 1 0 1 1 20 0 0 0 0 0 0 0 1 1 1 17 0 0 0 0 0 0 0 0 0 11 1 0 0 1 14 0 0 0 0 0 0 0 13 0 0 0 0 0 0 0 18 0 0 0 0 0 1 0 1 1 14 0 1 0 1 1 20 0 0 0 0 1 0 0 0 11 0 0 0 1 0 0 0 11 0 1 ...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 1 11 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? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (5 test cases)
Test #6:
score: 0
Accepted
time: 1ms
memory: 3836kb
input:
7 147 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 801 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 27 0 0 0 0 0 0 0...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (7 test cases)
Test #7:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
160 4 0 0 9 0 0 0 0 0 7 0 0 0 1 0 1 1 4 0 0 9 0 0 0 0 1 0 1 1 9 0 0 0 0 1 0 1 1 6 0 0 1 0 1 1 7 0 0 0 1 0 1 1 4 0 0 6 0 0 1 0 1 1 4 0 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? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35...
result:
ok Correct (23 test cases)
Test #12:
score: 0
Accepted
time: 2ms
memory: 3572kb
input:
20 39 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 44 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 35 0 0 0 0 0 0 0 0 0 1 0 1 1 94 0 0 0 0 0 0 0 0 0 1 0 0 0 92 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 1 37 ? 2 37 ! 2 ? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 1 25 ? 1 26 ? 2 26 ! 2 ? 1 2 ? 3 4 ? 5 6 ?...
result:
ok Correct (20 test cases)
Test #13:
score: 0
Accepted
time: 3ms
memory: 3576kb
input:
9 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 189 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 72 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 1 69 ! 1 ? 1 2 ? 3 4 ? 5 6 ? 7 8 ? ...
result:
ok Correct (9 test cases)
Test #14:
score: 0
Accepted
time: 3ms
memory: 3872kb
input:
6 243 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 181 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (6 test cases)
Test #15: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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (1 test case)
Test #30:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
2 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (2 test cases)
Test #31:
score: 0
Accepted
time: 2ms
memory: 3596kb
input:
4 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (1 test case)
Test #33:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
1 1000 1 1 1
output:
? 1 2 ? 3 1 ? 4 1 ! 2
result:
ok Correct (1 test case)
Test #34:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
1 1000 0 0 0 0 1 0 1 1
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 1 9 ? 1 10 ? 2 10 ! 2
result:
ok Correct (1 test case)
Test #35:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
2 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (2 test cases)
Test #36:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
2 500 1 1 1 500 1 1 0
output:
? 1 2 ? 3 1 ? 4 1 ! 2 ? 1 2 ? 3 1 ? 4 1 ! 1
result:
ok Correct (2 test cases)
Test #37:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
2 500 1 1 1 500 0 1 0 1 1
output:
? 1 2 ? 3 1 ? 4 1 ! 2 ? 1 2 ? 3 4 ? 1 3 ? 1 4 ? 2 4 ! 2
result:
ok Correct (2 test cases)
Test #38:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
4 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (4 test cases)
Test #39:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
4 250 1 1 0 250 1 1 0 250 1 1 1 250 1 1 0
output:
? 1 2 ? 3 1 ? 4 1 ! 1 ? 1 2 ? 3 1 ? 4 1 ! 1 ? 1 2 ? 3 1 ? 4 1 ! 2 ? 1 2 ? 3 1 ? 4 1 ! 1
result:
ok Correct (4 test cases)
Test #40:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
4 250 0 0 0 0 1 0 1 1 250 0 0 0 0 1 0 1 1 250 0 0 1 1 0 250 0 0 1 0 1 1
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 1 9 ? 1 10 ? 2 10 ! 2 ? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 1 9 ? 1 10 ? 2 10 ! 2 ? 1 2 ? 3 4 ? 5 6 ? 1 5 ? 2 5 ! 1 ? 1 2 ? 3 4 ? 5 6 ? 1 5 ? 1 6 ? 2 6 ! 2
result:
ok Correct (4 test cases)
Test #41:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
? 1 2 ? 3 4 ? 5 6 ? 7 8 ? 9 10 ? 11 12 ? 13 14 ? 15 16 ? 17 18 ? 19 20 ? 21 22 ? 23 24 ? 25 26 ? 27 28 ? 29 30 ? 31 32 ? 33 34 ? 35 36 ? 37 38 ? 39 40 ? 41 42 ? 43 44 ? 45 46 ? 47 48 ? 49 50 ? 51 52 ? 53 54 ? 55 56 ? 57 58 ? 59 60 ? 61 62 ? 63 64 ? 65 66 ? 67 68 ? 69 70 ? 71 72 ? 73 74 ? 75 76 ? 77 ...
result:
ok Correct (1 test case)
Extra Test:
score: 0
Extra Test Passed