QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#616760 | #2364. Endgame | erering | WA | 326ms | 3736kb | C++20 | 1.1kb | 2024-10-06 11:14:28 | 2024-10-06 11:14:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define endl '\n'
#define int long long
const int N=1e5+5,MOD=325235241211,inf=2e18;
signed main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
srand(1298659691);
int n; cin>>n;
map<pair<int,int>,bool> mp;
int x1,y1,x2,y2; cin>>x1>>y1>>x2>>y2;
bool flag=0;
pair<int,int> a[n+1];
a[n]={0,0};
mp[{0,0}]=1;
for(int i=0;i<n;i++){
cin>>a[i].first>>a[i].second;
int x=a[i].first,y=a[i].second;
mp[{x,y}]=1;
if(mp[{x2-(x1+x),y2-(y+y1)}])flag=1;
}
if(flag){
cout<<"Alice wins";
}
else{
for(int j=0;j<8000000;j++){
int a1=rand()%n+1,b1=rand()%n+1;
flag=0;
for(int i=0;i<=n;i++){
int x=a[i].first,y=a[i].second;
if(mp[{a1-(x2+x),b1-(y+y2)}]){
flag=1;
break;
}
}
if(!flag){
cout<<"tie "<<a1<<" "<<b1;
return 0;
}
}
cout<<"Bob wins";
}
}
详细
Test #1:
score: 100
Accepted
time: 311ms
memory: 3524kb
input:
3 2 3 1 3 1 0 0 -1 1 -1
output:
Bob wins
result:
ok
Test #2:
score: 0
Accepted
time: 321ms
memory: 3596kb
input:
3 3 3 1 1 1 0 1 1 0 1
output:
Bob wins
result:
ok
Test #3:
score: 0
Accepted
time: 326ms
memory: 3736kb
input:
3 2 2 3 1 -1 0 -1 1 0 1
output:
Bob wins
result:
ok
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3732kb
input:
5 2 1 1 2 -2 2 1 -1 1 1 2 2 3 3
output:
Alice wins
result:
wrong answer Author claims 'alice', but judge claims 'tie'