# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
742896 | jamezzz | Viruses (BOI20_viruses) | C++17 | 0 ms | 0 KiB |
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"
void solve(int subtask_id,int N){
long double ans[]={query(0,0),query(0,1),query(0,2)};
for(int a=-1e4;a<=1e4;++a){
long double denom=pow(1+a*a,0.5);
for(int b=-1e4;b<=1e4;++b){
bool can=true;
//printf("%d %d: ",a,b);
for(int x=0;x<=2;++x){
//printf("(%Lf %Lf) ",(a*x+b)/pow((long double)1+a*a,0.5),ans[x]);
if(abs((long double)(a*x+b)/denom-ans[x])>1e-6)can=false;
}
//printf("\n");
if(can)the_lines_are({a},{b});
}
}
}