# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
647005 | 2022-10-01T11:02:51 Z | danikoynov | Nicelines (RMI20_nicelines) | C++14 | 61 ms | 288 KB |
/** ____ ____ ____ ____ ____ ____ ||l |||e |||i |||n |||a |||d || ||__|||__|||__|||__|||__|||__|| |/__\|/__\|/__\|/__\|/__\|/__\| **/ #include<bits/stdc++.h> #define endl '\n' #include "nice_lines.h" using namespace std; using namespace std; typedef long long ll; int maxcor = 1e4; const long double eps = 1e-9; vector < long long > cur; long long x; int _N; void intersection_points() { long long base = -maxcor * maxcor; while(cur.size() < _N) { ll lf = base, rf = maxcor * maxcor; long double db = query(x, base); while(rf - lf > 1) { ll mf = (lf + rf) / 2; long double md = query(x, mf); long double am = (long double)(base + mf) / 2.0; long double df = query(x, am); ///cout << lf << " " << rf << " " << endl; if (abs((df - db) - (md - df)) < eps) lf = mf; else rf = mf - 1; } cur.push_back(lf); base = lf + 1; } } void solve(int subtask_id, int N) { _N = N; if (N > 3) maxcor = 510; ///cout << (ceil)(2.0) << endl; cur.clear(); x = maxcor * 2; long long lf = -maxcor * maxcor, rf = maxcor * maxcor; intersection_points(); vector < long long > it1 = cur; cur.clear(); x = maxcor * 2 + 1; intersection_points(); vector < long long > it2 = cur; sort(it1.begin(), it1.end()); sort(it2.begin(), it2.end()); vector < int > a, b; for (int i = 0; i < it1.size(); i ++) { a.push_back((round)(it2[i] - it1[i])); b.push_back((round)(it2[i] - x * (it2[i] - it1[i]))); } the_lines_are(a, b); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 208 KB | Output is correct |
2 | Incorrect | 2 ms | 208 KB | Incorrect |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 208 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 208 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 61 ms | 288 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 208 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 61 ms | 288 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |