Submission #597273

#TimeUsernameProblemLanguageResultExecution timeMemory
597273vh50Nicelines (RMI20_nicelines)C++17
0 / 100
6 ms208 KiB
#include <bits/stdc++.h> #include "nice_lines.h" using namespace std; int BB(int y) { long double ini = -1e12, fim = 1e12; if(query(ini, y) < query(fim, y)) while(ini < fim) { long double m = (ini + fim)/2.0; if(query(ini, y) == 0.0) return ini; if(query(m, y) < query(ini, y)) ini = m; else fim = m; } else while(ini < fim) { long double m = (ini + fim)/2.0; if(query(fim, y) == 0.0) return fim; if(query(m, y) < query(fim, y)) fim = m; else ini = m; } return ini; } void solve(int subtask_id, int N) { vector <int> a, b; if(N == 1) { long double x_1 = BB(0); long double x_2 = BB(1); a.push_back(1/(x_2 - x_1)); b.push_back(-x_1/(x_2 - x_1)); } the_lines_are(a, b); }
#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...