Submission #743147

#TimeUsernameProblemLanguageResultExecution timeMemory
743147jamielimNicelines (RMI20_nicelines)C++14
Compilation error
0 ms0 KiB
#include "nice_lines.h" #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb emplace_back #define ALL(x) x.begin(),x.end() #define SZ(x) (int)x.size() typedef long long ll; typedef pair<int,int> ii; typedef pair<ii,ii> i4; typedef vector<int> vi; const int MOD=1000000007; const int INF=1012345678; const ll LLINF=1012345678012345678LL; const double PI=3.1415926536; const double EPS=1e-14; void solve(int subtask_id, int N) { if(N==1){ long double s=query(0,0); long double t=query(0,1); long double k=abs(s-t); long double b=s/k; if(abs(query(0,b))<EPS){ if(query(1,0)-s>-EPS){ // a>=0 => k>0 long double a1=-k*k + sqrt(2*k*k-1) / (k*k-1); long double a2=-k*k - sqrt(2*k*k-1) / (k*k-1); if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b)); else the_lines_are((int)round(a2),(int)round(b)); }else{ // a<0 => k<0 k=-k; long double a1=-k*k + sqrt(2*k*k-1) / (k*k-1); long double a2=-k*k - sqrt(2*k*k-1) / (k*k-1); if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b)); else the_lines_are((int)round(a2),(int)round(b)); } }else{ b=-b; if(s-query(1,0)>-EPS){ // a>=0 => k>0 long double a1=-k*k + sqrt(2*k*k-1) / (k*k-1); long double a2=-k*k - sqrt(2*k*k-1) / (k*k-1); if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b)); else the_lines_are((int)round(a2),(int)round(b)); }else{ // a<0 => k<0 k=-k; long double a1=-k*k + sqrt(2*k*k-1) / (k*k-1); long double a2=-k*k - sqrt(2*k*k-1) / (k*k-1); if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b)); else the_lines_are((int)round(a2),(int)round(b)); } } } }

Compilation message (stderr)

nicelines.cpp: In function 'void solve(int, int)':
nicelines.cpp:33:40: error: could not convert '(int)round()(a1)' from 'int' to 'std::vector<int>'
   33 |     if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b));
      |                                        ^~~~~~~~~~~~~~
      |                                        |
      |                                        int
nicelines.cpp:34:24: error: could not convert '(int)round()(a2)' from 'int' to 'std::vector<int>'
   34 |     else the_lines_are((int)round(a2),(int)round(b));
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        int
nicelines.cpp:40:40: error: could not convert '(int)round()(a1)' from 'int' to 'std::vector<int>'
   40 |     if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b));
      |                                        ^~~~~~~~~~~~~~
      |                                        |
      |                                        int
nicelines.cpp:41:24: error: could not convert '(int)round()(a2)' from 'int' to 'std::vector<int>'
   41 |     else the_lines_are((int)round(a2),(int)round(b));
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        int
nicelines.cpp:49:40: error: could not convert '(int)round()(a1)' from 'int' to 'std::vector<int>'
   49 |     if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b));
      |                                        ^~~~~~~~~~~~~~
      |                                        |
      |                                        int
nicelines.cpp:50:24: error: could not convert '(int)round()(a2)' from 'int' to 'std::vector<int>'
   50 |     else the_lines_are((int)round(a2),(int)round(b));
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        int
nicelines.cpp:56:40: error: could not convert '(int)round()(a1)' from 'int' to 'std::vector<int>'
   56 |     if(query(1,a1+b)<EPS)the_lines_are((int)round(a1),(int)round(b));
      |                                        ^~~~~~~~~~~~~~
      |                                        |
      |                                        int
nicelines.cpp:57:24: error: could not convert '(int)round()(a2)' from 'int' to 'std::vector<int>'
   57 |     else the_lines_are((int)round(a2),(int)round(b));
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        int