# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
964057 |
2024-04-16T09:03:18 Z |
Neco_arc |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
38904 KB |
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(), x.end()
#define Neco "Mobile"
#define resp(x) sort(all(x)), x.resize(unique(all(x)) - x.begin())
#define getbit(x,i) ((x >> i)&1)
#define _left id * 2, l, mid
#define _right id * 2 + 1, mid + 1, r
#define cntbit(x) __builtin_popcountll(x)
#define fi(i, a, b) for(int i = a; i <= b; i++)
#define fid(i, a, b) for(int i = a; i >= b; i--)
#define maxn (int) 1e6 + 7
using namespace std;
const ll mod = 1e9 + 7; //972663749
const ll base = 911382323;
typedef long double ld;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll GetRandom(ll l, ll r)
{
return uniform_int_distribution<ll> (l, r)(rng);
}
int n, L;
pair<ld, ld> a[maxn];
void solve()
{
cin >> n >> L;
fi(i, 1, n) cin >> a[i].first >> a[i].second;
ld l = 1, r = 1.5e9;
while(r - l > 1e-3)
{
ld mid = (l + r) / 2;
ld Curr = 0;
fi(i, 1, n) {
ld L, R;
if(mid < a[i].second) L = R = 0;
else {
ld len = sqrt( (mid * mid) - (a[i].second * a[i].second) );
L = a[i].first - len, R = a[i].first + len;
}
if(Curr >= L) Curr = max(Curr, R);
}
if(Curr >= L) r = mid;
else l = mid;
}
cout << fixed << setprecision(5) << r;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
if(fopen(Neco".inp", "r")) {
freopen(Neco".inp", "r", stdin);
freopen(Neco".out", "w", stdout);
}
int nTest = 1;
// cin >> nTest;
while(nTest--)
{
solve();
}
return 0;
}
Compilation message
mobile.cpp: In function 'int main()':
mobile.cpp:70:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
70 | freopen(Neco".inp", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
mobile.cpp:71:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
71 | freopen(Neco".out", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
604 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
5 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
600 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
4 ms |
604 KB |
Output is correct |
4 |
Correct |
7 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
600 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
6 ms |
580 KB |
Output is correct |
5 |
Correct |
4 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
4488 KB |
Output is correct |
2 |
Correct |
50 ms |
4700 KB |
Output is correct |
3 |
Correct |
34 ms |
2904 KB |
Output is correct |
4 |
Correct |
72 ms |
4736 KB |
Output is correct |
5 |
Correct |
38 ms |
2652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
57 ms |
4732 KB |
Output is correct |
2 |
Correct |
59 ms |
2684 KB |
Output is correct |
3 |
Correct |
71 ms |
4740 KB |
Output is correct |
4 |
Correct |
74 ms |
4688 KB |
Output is correct |
5 |
Correct |
85 ms |
4736 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
45 ms |
4752 KB |
Output is correct |
2 |
Correct |
54 ms |
4700 KB |
Output is correct |
3 |
Correct |
43 ms |
4732 KB |
Output is correct |
4 |
Correct |
107 ms |
4728 KB |
Output is correct |
5 |
Correct |
74 ms |
4736 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
4700 KB |
Output is correct |
2 |
Correct |
58 ms |
4700 KB |
Output is correct |
3 |
Correct |
49 ms |
4700 KB |
Output is correct |
4 |
Correct |
106 ms |
4732 KB |
Output is correct |
5 |
Correct |
94 ms |
4732 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
4696 KB |
Output is correct |
2 |
Correct |
52 ms |
4700 KB |
Output is correct |
3 |
Correct |
50 ms |
4732 KB |
Output is correct |
4 |
Correct |
117 ms |
4488 KB |
Output is correct |
5 |
Correct |
88 ms |
4732 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
263 ms |
17032 KB |
Output is correct |
2 |
Correct |
262 ms |
17032 KB |
Output is correct |
3 |
Correct |
294 ms |
17044 KB |
Output is correct |
4 |
Correct |
536 ms |
17028 KB |
Output is correct |
5 |
Correct |
455 ms |
17040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
279 ms |
17044 KB |
Output is correct |
2 |
Correct |
313 ms |
17044 KB |
Output is correct |
3 |
Correct |
245 ms |
17028 KB |
Output is correct |
4 |
Correct |
554 ms |
17276 KB |
Output is correct |
5 |
Correct |
473 ms |
17032 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
353 ms |
21144 KB |
Output is correct |
2 |
Correct |
328 ms |
21120 KB |
Output is correct |
3 |
Correct |
344 ms |
21152 KB |
Output is correct |
4 |
Correct |
672 ms |
21148 KB |
Output is correct |
5 |
Correct |
589 ms |
21152 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
336 ms |
21128 KB |
Output is correct |
2 |
Correct |
359 ms |
21148 KB |
Output is correct |
3 |
Correct |
307 ms |
21072 KB |
Output is correct |
4 |
Correct |
649 ms |
21148 KB |
Output is correct |
5 |
Correct |
583 ms |
21384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
376 ms |
23172 KB |
Output is correct |
2 |
Correct |
374 ms |
23200 KB |
Output is correct |
3 |
Correct |
376 ms |
23172 KB |
Output is correct |
4 |
Correct |
748 ms |
23196 KB |
Output is correct |
5 |
Correct |
615 ms |
23204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
416 ms |
23188 KB |
Output is correct |
2 |
Correct |
417 ms |
23376 KB |
Output is correct |
3 |
Correct |
350 ms |
23204 KB |
Output is correct |
4 |
Correct |
773 ms |
23200 KB |
Output is correct |
5 |
Correct |
685 ms |
23204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
420 ms |
27272 KB |
Output is correct |
2 |
Correct |
455 ms |
27300 KB |
Output is correct |
3 |
Correct |
432 ms |
27216 KB |
Output is correct |
4 |
Correct |
879 ms |
27304 KB |
Output is correct |
5 |
Correct |
749 ms |
38288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
441 ms |
27308 KB |
Output is correct |
2 |
Correct |
463 ms |
27272 KB |
Output is correct |
3 |
Correct |
408 ms |
27220 KB |
Output is correct |
4 |
Correct |
874 ms |
27308 KB |
Output is correct |
5 |
Correct |
780 ms |
38904 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
532 ms |
31756 KB |
Output is correct |
2 |
Correct |
578 ms |
31760 KB |
Output is correct |
3 |
Correct |
557 ms |
31656 KB |
Output is correct |
4 |
Execution timed out |
1060 ms |
31656 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
535 ms |
31616 KB |
Output is correct |
2 |
Correct |
595 ms |
31624 KB |
Output is correct |
3 |
Correct |
516 ms |
31652 KB |
Output is correct |
4 |
Execution timed out |
1063 ms |
31644 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |