# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
988280 | 2024-05-24T12:02:33 Z | hegoplay | Balloons (CEOI11_bal) | C++14 | 57 ms | 65536 KB |
/* - += @@@@@% +@@@@@@+ %@@@@@#% @@@@@@@@=: +****************** =@@@@@@@@@% =***********#*******+ %@@@@@@@@@@@@@@@@@@@@= @@@@@@@@@@% #@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@+ +@@#@@@@@@@@% @@@@@@@@@@@@@@@@@@@@@@@= +@@@@% *@@%@@@@@@@@@= %@@@% @@@@@# *@@@@@@@@@@@@# #@@@@@ %@@@@% +@@@@@@@@@@@@% @@@@@@@@@@@@@@@@@@@@% #@@@@@ =#+@@@@@@@@#@% =@@@@@@@@@@@@@@@@@@@@* +@@@@@+ #@@@@@@% =@@@@@= =@@@@@* #@@@@@@# @@@@@* #@@@@@@@@@@@@@@@@@@@@@ +@@@@@@# *@@@@@@@@@@@@@@@@@@@@@@# +@@@@@@@@@@@@@@@@@@@@= %@@@@@% +@@@@@@@@@@@@@@@@@@@@@@+ +*#************##* =@@@@@#+ ###**##**#*******##*+ =@@@@@@% +** =+= Michael Jackson peeks "Nothing is hard to understand, you just didn't get it." @author: MahK17 */ #include <bits/stdc++.h> #include <set> #include <vector> #include <algorithm> #include <map> #include <queue> #include <stack> #include <cmath> #include <unordered_map> #include <unordered_set> #include <string> #include <sstream> #include <numeric> #include <cstdio> #include <cstring> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define inf 0x3f3f3f3f3f3f3f3f #define all(x) (x).begin(), (x).end() #define yes cout << "YES\n"; #define no cout << "NO\n"; #define sz(x) (int)(x).size() #define el "\n" typedef long long ll; typedef long double ld; #define int long long using namespace __gnu_pbds; using namespace std; #define indexed_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> void setIO(string name = "") { if (sz(name)) { freopen((name + ".in").c_str(), "r", stdin); // see /general/input-output freopen((name + ".out").c_str(), "w", stdout); } } ld find(ld lb, ld x1, ld x2) { // binary search 4*lb*x = (x1-x2)**2 return (x1 - x2) * (x1 - x2) / (4 * lb); } void solve() { int n; cin >> n; vector<pair<int, int>> a(n); for (int i = 0; i < n; i++) { cin >> a[i].first >> a[i].second; } stack<pair<ld, ld>> s; for (int i = 0; i < n; i++) { ld curSize = a[i].second; while (!s.empty()) { ld x1 = s.top().first; ld x2 = a[i].first; ld lb = s.top().second; ld x = find(lb, x1, x2); if (x < curSize) { s.pop(); curSize = x; } else break; } s.push({a[i].first, curSize}); printf("%.3Lf\n", curSize); } } signed main() { #ifndef ONLINE_JUDGE std::freopen("input.txt", "r", stdin); std::freopen("out.txt", "w", stdout); // setIO("snakes"); #endif ios ::sync_with_stdio(false); std::cin.tie(nullptr); ll t = 1; // cin >> t; while (t--) solve(); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 34 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 28 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 26 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 57 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 28 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 57 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 28 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 27 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 28 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 28 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |