Task: | Gas tank |
Sender: | AleksandrPolitov |
Submission time: | 2024-11-13 16:41:57 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | WRONG ANSWER | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
#18 | ACCEPTED | 0.00 s | details |
#19 | ACCEPTED | 0.00 s | details |
#20 | ACCEPTED | 0.00 s | details |
#21 | ACCEPTED | 0.00 s | details |
#22 | ACCEPTED | 0.00 s | details |
#23 | ACCEPTED | 0.00 s | details |
#24 | ACCEPTED | 0.00 s | details |
#25 | ACCEPTED | 0.00 s | details |
#26 | WRONG ANSWER | 0.00 s | details |
#27 | ACCEPTED | 0.00 s | details |
#28 | ACCEPTED | 0.00 s | details |
#29 | ACCEPTED | 0.00 s | details |
#30 | ACCEPTED | 0.00 s | details |
#31 | WRONG ANSWER | 0.00 s | details |
#32 | WRONG ANSWER | 0.00 s | details |
#33 | WRONG ANSWER | 0.00 s | details |
#34 | WRONG ANSWER | 0.00 s | details |
#35 | WRONG ANSWER | 0.00 s | details |
#36 | WRONG ANSWER | 0.00 s | details |
#37 | WRONG ANSWER | 0.00 s | details |
#38 | ACCEPTED | 0.00 s | details |
#39 | WRONG ANSWER | 0.00 s | details |
#40 | ACCEPTED | 0.00 s | details |
#41 | ACCEPTED | 0.00 s | details |
#42 | ACCEPTED | 0.00 s | details |
#43 | WRONG ANSWER | 0.00 s | details |
#44 | WRONG ANSWER | 0.00 s | details |
#45 | WRONG ANSWER | 0.00 s | details |
#46 | WRONG ANSWER | 0.00 s | details |
#47 | ACCEPTED | 0.00 s | details |
#48 | WRONG ANSWER | 0.00 s | details |
#49 | WRONG ANSWER | 0.00 s | details |
#50 | WRONG ANSWER | 0.00 s | details |
#51 | WRONG ANSWER | 0.00 s | details |
#52 | WRONG ANSWER | 0.00 s | details |
#53 | WRONG ANSWER | 0.00 s | details |
#54 | WRONG ANSWER | 0.00 s | details |
#55 | WRONG ANSWER | 0.00 s | details |
#56 | WRONG ANSWER | 0.00 s | details |
#57 | WRONG ANSWER | 0.00 s | details |
#58 | WRONG ANSWER | 0.00 s | details |
#59 | WRONG ANSWER | 0.00 s | details |
#60 | WRONG ANSWER | 0.00 s | details |
#61 | WRONG ANSWER | 0.00 s | details |
#62 | WRONG ANSWER | 0.00 s | details |
#63 | WRONG ANSWER | 0.00 s | details |
#64 | WRONG ANSWER | 0.00 s | details |
#65 | WRONG ANSWER | 0.00 s | details |
#66 | WRONG ANSWER | 0.00 s | details |
#67 | WRONG ANSWER | 0.00 s | details |
#68 | WRONG ANSWER | 0.00 s | details |
#69 | WRONG ANSWER | 0.00 s | details |
#70 | WRONG ANSWER | 0.00 s | details |
#71 | WRONG ANSWER | 0.00 s | details |
#72 | WRONG ANSWER | 0.00 s | details |
#73 | WRONG ANSWER | 0.00 s | details |
#74 | WRONG ANSWER | 0.00 s | details |
#75 | WRONG ANSWER | 0.00 s | details |
#76 | WRONG ANSWER | 0.00 s | details |
#77 | WRONG ANSWER | 0.00 s | details |
#78 | WRONG ANSWER | 0.00 s | details |
#79 | WRONG ANSWER | 0.00 s | details |
#80 | WRONG ANSWER | 0.00 s | details |
Code
#ifdef ONPC #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #define char unsigned char #define rep(i, a, b) for(int i=a; i< (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define eb emplace_back #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define LSOne(S) ((S) & -(S)) using namespace std; // mt19937 rnd(239); mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); template <typename T> int sgn(T x) { return (T(0) < x) - (x < T(0)); } typedef long double T; typedef complex<T> pt; #define X real() #define Y imag() template<class T> istream& operator>> (istream& is, complex<T>& p) { T value; is >> value; p.real(value); is >> value; p.imag(value); return is; } typedef long long ll; typedef long double ld; using pi = pair<ll, ll>; using vi = vector<ll>; template <class T> using pq = priority_queue<T>; template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>; int popcnt(int x) { return __builtin_popcount(x); } int popcnt(ll x) { return __builtin_popcountll(x); } #define MIN(v) *min_element(all(v)) #define MAX(v) *max_element(all(v)) #define LB(c, x) distance((c).begin(), lower_bound(all(c), (x))) #define UB(c, x) distance((c).begin(), upper_bound(all(c), (x))) void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;} void __print(float x) {cerr << x;} void __print(double x) {cerr << x;} void __print(long double x) {cerr << x;} void __print(char x) {cerr << '\'' << x << '\'';} void __print(const char *x) {cerr << '\"' << x << '\"';} void __print(const string &x) {cerr << '\"' << x << '\"';} void __print(bool x) {cerr << (x ? "true" : "false");} template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ", "; __print(x.second); cerr << '}';} template<typename T> void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";} template <typename T, typename... V> void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);} #ifdef DEBUG #define dbg(x...) cerr << "\e[91m"<<__func__<<":"<<__LINE__<<" [" << #x << "] = ["; _print(x); cerr << "\e[39m" << endl; #else #define dbg(x...) #endif template<typename S, typename T = S> void chmin(S &s, T t) {s = s < t ? s : t;} template<typename S, typename T = S> void chmax(S &s, T t) {s = s > t ? s : t;} const int INF = 1e9; // 10^9 = 1B is < 2^31-1 const ll LLINF = 4e18; // 4*10^18 is < 2^63-1 const double EPS = 1e-9; const ll MOD = 1e9+7; ll calc(ll a, ll b) { return a*a*b+b*b*a; } bool check(ll a, ll b, ll n) { return calc(a,b)<=n; } int solve() { ll n; std::cin >> n; pair<ll, ll> res={0,0}; ll a=1; while(true) { ll lo=1, hi=1e8; ll best=-1; while(lo<=hi) { ll b=(lo+hi)/2; ll V=calc(a, b); if(V<=n) { if(V>calc(res.fi, res.se)) { res={a, b}; } best=lo; lo=b+1; } else { hi=b-1; } } if(a==4) break; if(best==-1) { break; } a++; } //std::cout << calc(499998, 4) << std::endl; //std::cout << calc(res.fi, res.se) << std::endl; std::cout << res.fi << " " << res.se << std::endl; return 0; } int32_t main() { ios::sync_with_stdio(0); cin.tie(0); int TET = 1; //cin >> TET; for (int i = 1; i <= TET; i++) { #ifdef ONPC cout << "TEST CASE#" << i << endl; #endif if (solve()) { break; } #ifdef ONPC cout << "__________________________" << endl; #endif } #ifdef ONPC cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl; #endif }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
8 |
correct output |
---|
2 1 |
user output |
---|
1 2 |
Test 2
Verdict: ACCEPTED
input |
---|
7 |
correct output |
---|
2 1 |
user output |
---|
1 2 |
Test 3
Verdict: ACCEPTED
input |
---|
46 |
correct output |
---|
6 1 |
user output |
---|
1 6 |
Test 4
Verdict: ACCEPTED
input |
---|
28 |
correct output |
---|
4 1 |
user output |
---|
1 4 |
Test 5
Verdict: ACCEPTED
input |
---|
40 |
correct output |
---|
5 1 |
user output |
---|
1 5 |
Test 6
Verdict: ACCEPTED
input |
---|
34 |
correct output |
---|
5 1 |
user output |
---|
1 5 |
Test 7
Verdict: ACCEPTED
input |
---|
39 |
correct output |
---|
5 1 |
user output |
---|
1 5 |
Test 8
Verdict: ACCEPTED
input |
---|
38 |
correct output |
---|
5 1 |
user output |
---|
1 5 |
Test 9
Verdict: ACCEPTED
input |
---|
25 |
correct output |
---|
4 1 |
user output |
---|
1 4 |
Test 10
Verdict: ACCEPTED
input |
---|
26 |
correct output |
---|
4 1 |
user output |
---|
1 4 |
Test 11
Verdict: WRONG ANSWER
input |
---|
549 |
correct output |
---|
7 6 |
user output |
---|
3 12 |
Test 12
Verdict: ACCEPTED
input |
---|
418 |
correct output |
---|
13 2 |
user output |
---|
2 13 |
Test 13
Verdict: WRONG ANSWER
input |
---|
436 |
correct output |
---|
6 6 |
user output |
---|
1 20 |
Test 14
Verdict: WRONG ANSWER
input |
---|
551 |
correct output |
---|
7 6 |
user output |
---|
3 12 |
Test 15
Verdict: ACCEPTED
input |
---|
968 |
correct output |
---|
21 2 |
user output |
---|
2 21 |
Test 16
Verdict: ACCEPTED
input |
---|
222 |
correct output |
---|
14 1 |
user output |
---|
1 14 |
Test 17
Verdict: ACCEPTED
input |
---|
893 |
correct output |
---|
13 4 |
user output |
---|
4 13 |
Test 18
Verdict: ACCEPTED
input |
---|
77 |
correct output |
---|
8 1 |
user output |
---|
1 8 |
Test 19
Verdict: ACCEPTED
input |
---|
874 |
correct output |
---|
29 1 |
user output |
---|
1 29 |
Test 20
Verdict: ACCEPTED
input |
---|
11 |
correct output |
---|
2 1 |
user output |
---|
1 2 |
Test 21
Verdict: ACCEPTED
input |
---|
772 |
correct output |
---|
12 4 |
user output |
---|
4 12 |
Test 22
Verdict: ACCEPTED
input |
---|
181 |
correct output |
---|
5 4 |
user output |
---|
4 5 |
Test 23
Verdict: ACCEPTED
input |
---|
155 |
correct output |
---|
11 1 |
user output |
---|
1 11 |
Test 24
Verdict: ACCEPTED
input |
---|
778 |
correct output |
---|
12 4 |
user output |
---|
4 12 |
Test 25
Verdict: ACCEPTED
input |
---|
514 |
correct output |
---|
15 2 |
user output |
---|
2 15 |
Test 26
Verdict: WRONG ANSWER
input |
---|
849 |
correct output |
---|
8 7 |
user output |
---|
1 28 |
Test 27
Verdict: ACCEPTED
input |
---|
224 |
correct output |
---|
14 1 |
user output |
---|
1 14 |
Test 28
Verdict: ACCEPTED
input |
---|
295 |
correct output |
---|
11 2 |
user output |
---|
2 11 |
Test 29
Verdict: ACCEPTED
input |
---|
651 |
correct output |
---|
25 1 |
user output |
---|
1 25 |
Test 30
Verdict: ACCEPTED
input |
---|
98 |
correct output |
---|
6 2 |
user output |
---|
2 6 |
Test 31
Verdict: WRONG ANSWER
input |
---|
588264 |
correct output |
---|
172 18 |
user output |
---|
2 541 |
Test 32
Verdict: WRONG ANSWER
input |
---|
48736 |
correct output |
---|
80 7 |
user output |
---|
2 155 |
Test 33
Verdict: WRONG ANSWER
input |
---|
208508 |
correct output |
---|
99 18 |
user output |
---|
1 456 |
Test 34
Verdict: WRONG ANSWER
input |
---|
517415 |
correct output |
---|
172 16 |
user output |
---|
1 718 |
Test 35
Verdict: WRONG ANSWER
input |
---|
960234 |
correct output |
---|
290 11 |
user output |
---|
1 979 |
Test 36
Verdict: WRONG ANSWER
input |
---|
870321 |
correct output |
---|
111 49 |
user output |
---|
3 537 |
Test 37
Verdict: WRONG ANSWER
input |
---|
308005 |
correct output |
---|
70 40 |
user output |
---|
1 554 |
Test 38
Verdict: ACCEPTED
input |
---|
425818 |
correct output |
---|
652 1 |
user output |
---|
1 652 |
Test 39
Verdict: WRONG ANSWER
input |
---|
729178 |
correct output |
---|
83 61 |
user output |
---|
1 853 |
Test 40
Verdict: ACCEPTED
input |
---|
863955 |
correct output |
---|
535 3 |
user output |
---|
3 535 |
Test 41
Verdict: ACCEPTED
input |
---|
116086 |
correct output |
---|
340 1 |
user output |
---|
1 340 |
Test 42
Verdict: ACCEPTED
input |
---|
612309 |
correct output |
---|
782 1 |
user output |
---|
1 782 |
Test 43
Verdict: WRONG ANSWER
input |
---|
375142 |
correct output |
---|
228 7 |
user output |
---|
2 432 |
Test 44
Verdict: WRONG ANSWER
input |
---|
852178 |
correct output |
---|
161 28 |
user output |
---|
1 922 |
Test 45
Verdict: WRONG ANSWER
input |
---|
151667 |
correct output |
---|
156 6 |
user output |
---|
2 274 |
Test 46
Verdict: WRONG ANSWER
input |
---|
196137 |
correct output |
---|
103 16 |
user output |
---|
2 312 |
Test 47
Verdict: ACCEPTED
input |
---|
375254 |
correct output |
---|
612 1 |
user output |
---|
1 612 |
Test 48
Verdict: WRONG ANSWER
input |
---|
451513 |
correct output |
---|
298 5 |
user output |
---|
2 474 |
Test 49
Verdict: WRONG ANSWER
input |
---|
942864 |
correct output |
---|
122 46 |
user output |
---|
3 559 |
Test 50
Verdict: WRONG ANSWER
input |
---|
848035 |
correct output |
---|
215 17 |
user output |
---|
2 650 |
Test 51
Verdict: WRONG ANSWER
input |
---|
727949226 |
correct output |
---|
1876 188 |
user output |
---|
1 26980 |
Test 52
Verdict: WRONG ANSWER
input |
---|
119540561 |
correct output |
---|
395 387 |
user output |
---|
2 7730 |
Test 53
Verdict: WRONG ANSWER
input |
---|
168568700 |
correct output |
---|
447 430 |
user output |
---|
3 7494 |
Test 54
Verdict: WRONG ANSWER
input |
---|
747828096 |
correct output |
---|
2098 158 |
user output |
---|
4 13671 |
Test 55
Verdict: WRONG ANSWER
input |
---|
113886324 |
correct output |
---|
949 113 |
user output |
---|
2 7545 |
Test 56
Verdict: WRONG ANSWER
input |
---|
544092912 |
correct output |
---|
2620 77 |
user output |
---|
1 23325 |
Test 57
Verdict: WRONG ANSWER
input |
---|
112927706 |
correct output |
---|
532 266 |
user output |
---|
1 10626 |
Test 58
Verdict: WRONG ANSWER
input |
---|
562461747 |
correct output |
---|
1803 159 |
user output |
---|
3 13691 |
Test 59
Verdict: WRONG ANSWER
input |
---|
930544437 |
correct output |
---|
7390 17 |
user output |
---|
2 21569 |
Test 60
Verdict: WRONG ANSWER
input |
---|
612603672 |
correct output |
---|
1128 364 |
user output |
---|
1 24750 |
Test 61
Verdict: WRONG ANSWER
input |
---|
575864416073 |
correct output |
---|
7427 5843 |
user output |
---|
2 536592 |
Test 62
Verdict: WRONG ANSWER
input |
---|
942935707814 |
correct output |
---|
63092 236 |
user output |
---|
2 686634 |
Test 63
Verdict: WRONG ANSWER
input |
---|
171264013251 |
correct output |
---|
14433 780 |
user output |
---|
1 413840 |
Test 64
Verdict: WRONG ANSWER
input |
---|
76712165827 |
correct output |
---|
8381 978 |
user output |
---|
1 276969 |
Test 65
Verdict: WRONG ANSWER
input |
---|
161612205399 |
correct output |
---|
7527 2206 |
user output |
---|
2 284263 |
Test 66
Verdict: WRONG ANSWER
input |
---|
641183113758 |
correct output |
---|
50116 254 |
user output |
---|
2 566207 |
Test 67
Verdict: WRONG ANSWER
input |
---|
87822361843 |
correct output |
---|
24538 145 |
user output |
---|
4 148172 |
Test 68
Verdict: WRONG ANSWER
input |
---|
550401843854 |
correct output |
---|
14093 2372 |
user output |
---|
1 741890 |
Test 69
Verdict: WRONG ANSWER
input |
---|
56603972680 |
correct output |
---|
10404 499 |
user output |
---|
1 237915 |
Test 70
Verdict: WRONG ANSWER
input |
---|
991404337870 |
correct output |
---|
109250 83 |
user output |
---|
3 574862 |
Test 71
Verdict: WRONG ANSWER
input |
---|
534149659344 |
correct output |
---|
53496 186 |
user output |
---|
3 421958 |
Test 72
Verdict: WRONG ANSWER
input |
---|
336010906011 |
correct output |
---|
183301 10 |
user output |
---|
4 289830 |
Test 73
Verdict: WRONG ANSWER
input |
---|
871714540470 |
correct output |
---|
214186 19 |
user output |
---|
1 933656 |
Test 74
Verdict: WRONG ANSWER
input |
---|
254659717917 |
correct output |
---|
17240 818 |
user output |
---|
2 356832 |
Test 75
Verdict: WRONG ANSWER
input |
---|
40507166127 |
correct output |
---|
3335 2196 |
user output |
---|
2 142314 |
Test 76
Verdict: WRONG ANSWER
input |
---|
445628406612 |
correct output |
---|
23039 811 |
user output |
---|
3 385411 |
Test 77
Verdict: WRONG ANSWER
input |
---|
822717753419 |
correct output |
---|
39363 524 |
user output |
---|
3 523677 |
Test 78
Verdict: WRONG ANSWER
input |
---|
40410210216 |
correct output |
---|
10096 382 |
user output |
---|
3 116059 |
Test 79
Verdict: WRONG ANSWER
input |
---|
366117794932 |
correct output |
---|
49165 151 |
user output |
---|
1 605076 |
Test 80
Verdict: WRONG ANSWER
input |
---|
657992849714 |
correct output |
---|
11698 3662 |
user output |
---|
1 811167 |