This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#include "nice_lines.h"
#define maxn 10000
#define dist(a,b,x,y) pow(pow(((long double)y-a*b-a*a*x)/(1+a*a),2)+pow(((long double)a*x+a*y+b-y-a*a*y)/(1+a*a),2),0.5)
void solve(int subtask_id,int N){
int x[]={0,0,100,100},y[]={0,100,0,100};
long double ans[]={query(0,0),query(0,100),query(100,0),query(100,100)};
for(int a=-maxn;a<=maxn;++a){
int bb=(int)pow(1+a*a,0.5)*ans[0];
vector<int> v;
v.push_back(bb);
v.push_back(bb+1);
v.push_back(bb-1);
v.push_back(-bb);
v.push_back(-bb+1);
v.push_back(-bb-1);
for(int b:v){
bool can=true;
//printf("%d %d: ",a,b);
for(int i=0;i<4;++i){
//printf("(%Lf %Lf) ",dist(a,b,x[i],y[i]),ans[i]);
if(dist(a,b,x[i],y[i])-ans[i]>1e-6)can=false;
}
//printf("\n");
if(can)the_lines_are({a},{b});
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |