QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#795869 | #9804. Guess the Polygon | ucup-team191# | WA | 1ms | 3936kb | C++23 | 822b | 2024-12-01 02:58:41 | 2024-12-01 02:58:42 |
Judging History
answer
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
using pii=pair<int,int>;
using ll=long long;
using vi=vector<int>;
using vl=vector<ll>;
#define pb push_back
#define all(a) begin(a),end(a)
const int N=300010,MOD=1e9+7;
const char en='\n';
const ll LLINF=1ll<<60;
int t,n,tr;
double qu(int a)
{
cout<<"? "<<a<<' '<<1<<endl;
double x,y;
cin>>x>>y;
return x/y;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>t;
while (t--)
{
cin>>n;
vi x;
for (int i=0;i<n;++i)
{
int a;
cin>>a>>tr;
x.pb(a);
}
sort(all(x));
double an=0;
for (int i=1;i<n-1;++i)
{
an+=(x[i+1]-x[i-1])*1.*qu(x[i]);
}
ll aa=round(an);
if (aa%2) cout<<"! "<<aa<<' '<<2<<endl;
else cout<<"! "<<aa/2<<' '<<1<<endl;
}
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3648kb
input:
2 4 3 0 1 3 1 1 0 0 2 1 2 1 3 0 0 999 1000 1000 999 1999 1000
output:
? 1 1 ? 1 1 ! 3 1 ? 999 1 ! 1999 2
result:
ok correct! (2 test cases)
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3936kb
input:
9 4 1 1 1 3 3 0 0 0 3 1 3 1
output:
? 1 1 ? 1 1 ! 9 2
result:
wrong answer the answer is incorrect, expect: 5/2, find: 9/2 (test case 1)