QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#81810 | #2838. 2D Geometry | AHSFNU_team_0# | WA | 2ms | 3656kb | C++14 | 503b | 2023-02-26 13:50:15 | 2023-02-26 13:50:16 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,x[200005],y[200005],num,t,ans;
mt19937 rnd(20230226);
int main(){
while(~scanf("%d",&n)){
for(int i=1;i<=n;++i)
scanf("%d%d",x+i,y+i);
ans=0;
for(int k=1,u,v;k<=100;++k){
u=rnd()%n+1,v=rnd()%n+1;
if(u==v)continue;
num=0;
for(int i=1;i<=n;++i)
if((ll)(x[u]-x[i])*(y[v]-y[i])==(ll)(x[v]-x[i])*(y[u]-y[i]))++num;
ans=max(ans,num-(n-num)*2);
}
printf("%d\n",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3656kb
input:
3 0 0 0 1 0 2 3 0 0 0 1 1 0 6 0 0 0 1 0 2 0 3 1 1 1 2
output:
3 0 0
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3564kb
input:
1 0 0 2 0 0 1 1 3 0 0 0 1 0 2 3 0 0 0 1 1 0 4 3 0 0 2 3 3 3 1 4 2 3 1 1 0 3 0 2 4 0 0 0 3 0 2 0 1 5 8 6 9 2 2 3 7 4 1 5 5 2 2 4 2 6 2 7 2 0 4 5 3 7 5 4 4 4 9 4 9 9 5 5 4 5 9 5 5 4 3 1 0 5 3 2 1 2 7 2 6 2 5 2 6 7 2 7 9 0 3 8 8 4 4 3 8 6 2 8 2 5 3 5 3 8 2 0 0 2 6 2 3 8 4 2 9 2 2 2 6 4 9 6 2 1 7 6 6 5 ...
output:
0 2 3 0 1 0 4 0 2 0 0 5 0 0 0 0 0 0 0 3 0 6
result:
wrong answer 1st lines differ - expected: '1', found: '0'