Submission #742910

#TimeUsernameProblemLanguageResultExecution timeMemory
742910jamezzzNicelines (RMI20_nicelines)C++17
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> using namespace std; #include "nice_lines.h" #define maxn 100 #define dist(a,b,x,y) pow(pow((y-a*b-a*a*x)/(1+a*a),2)+pow((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,1,1},y[]={0,1,0,1}; long double ans[]={query(0,0),query(0,1),query(1,0),query(1,1)}; for(int a=-maxn;a<=maxn;++a){ long double denom=pow(1+a*a,0.5); for(int b=-maxn;b<=maxn;++b){ bool can=true; for(int i=0;i<4;++i){ if(dist(a,b,x[i],y[i])-ans[i]>1e-6)can=false; } if(can)the_lines_are({a},{b}); } } }

Compilation message (stderr)

nicelines.cpp: In function 'void solve(int, int)':
nicelines.cpp:13:15: warning: unused variable 'denom' [-Wunused-variable]
   13 |   long double denom=pow(1+a*a,0.5);
      |               ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...