QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#398987 | #4189. Flappy Bird | crimson231 | AC ✓ | 282ms | 47692kb | C++23 | 3.4kb | 2024-04-25 20:41:21 | 2024-04-25 20:41:25 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cassert>
#include <vector>
#include <deque>
typedef long long ll;
typedef double ld;
const ll INF = 1e17;
const int LEN = 1e6 + 1;
const ld TOL = 1e-7;
int N, M, Q, T;
bool zero(const ld& x) { return std::abs(x) < TOL; }
int sign(const ld& x) { return x < -TOL ? -1 : x > TOL; }
int sign(const ll& x) { return x < 0 ? -1 : !!x; }
//#define TEST
//#define ASSERT
struct Pos {
int x, y;
Pos(int X = 0, int Y = 0) : x(X), y(Y) {}
inline bool operator == (const Pos& p) const { return x == p.x && y == p.y; }
inline bool operator != (const Pos& p) const { return x != p.x || y != p.y; }
inline bool operator < (const Pos& p) const { return x == p.x ? y < p.y : x < p.x; }
inline Pos operator + (const Pos& p) const { return { x + p.x, y + p.y }; }
inline Pos operator - (const Pos& p) const { return { x - p.x, y - p.y }; }
inline ll operator * (const Pos& p) const { return { (ll)x * p.x + (ll)y * p.y }; }
inline ll operator / (const Pos& p) const { return { (ll)x * p.y - (ll)y * p.x }; }
inline friend std::istream& operator >> (std::istream& is, Pos& p) { is >> p.x >> p.y; return is; }
inline friend std::ostream& operator << (std::ostream& os, const Pos& p) { os << p.x << " " << p.y; return os; }
}; const Pos O = Pos(0, 0);
typedef std::vector<Pos> Polygon;
inline ll cross(const Pos& d1, const Pos& d2, const Pos& d3) { return (d2 - d1) / (d3 - d2); }
inline int ccw(const Pos& d1, const Pos& d2, const Pos& d3) {
ll ret = cross(d1, d2, d3);
return ret < 0 ? -1 : !!ret;
}
void solve() {
std::cin.tie(0)->sync_with_stdio(0);
std::cout.tie(0);
#ifdef TEST
freopen("../../../input_data/flappy/data/secret/31-max-convex.in", "r", stdin);
freopen("../../../input_data/flappy/data/secret/flappy_out.txt", "w", stdout);
#endif
int x, yd, yu;
Pos s, e;
std::cin >> s >> e >> N;
if (!N) { std::cout << s << "\n" << e << "\n"; return; }
std::vector<Pos> U(N), D(N);
for (int i = 0; i < N; i++) {
std::cin >> x >> yd >> yu;
D[i] = Pos(x, yd);
U[i] = Pos(x, yu);
}
#ifdef ASSERT
for (int i = 0; i < N - 1; i++)
assert(D[i] < U[i]), assert(D[i] < D[i + 1]);
if (N > 0) assert(D[N - 1] < U[N - 1]);
#endif
std::deque<Pos> HU, HD;
HU.push_back(s); HU.push_back(U[0]);
U.push_back(e);
HD.push_back(s); HD.push_back(D[0]);
D.push_back(e);
std::vector<Pos> ret;
ret.push_back(s);
for (int i = 1; i <= N; i++) {
while (HU.size() > 1 && ccw(HU[HU.size() - 2], HU.back(), U[i]) <= 0) HU.pop_back();
HU.push_back(U[i]);
while (HD.size() > 1 && ccw(HD[HD.size() - 2], HD.back(), D[i]) >= 0) HD.pop_back();
HD.push_back(D[i]);
if (HU.size() <= 2 && HD.size() <= 2) continue;
else if (HU.size() == 2) {
if (ccw(HU[0], HU[1], HD[1]) <= 0) continue;
while (HD.size() > 1 && ccw(HD[0], HD[1], HU[1]) <= 0) ret.push_back(HD[0]), HD.pop_front();
ret.push_back(HD[0]);
HU[0] = HD[0];
}
else if (HD.size() == 2) {
if (ccw(HD[0], HD[1], HU[1]) >= 0) continue;
while (HU.size() > 1 && ccw(HU[0], HU[1], HD[1]) >= 0) ret.push_back(HU[0]), HU.pop_front();
ret.push_back(HU[0]);
HD[0] = HU[0];
}
}
ret.push_back(e);
//std::sort(ret.begin(), ret.end());
ret.erase(unique(ret.begin(), ret.end()), ret.end());
for (const Pos& p : ret) std::cout << p << "\n";
return;
}
int main() { solve(); return 0; }//GCPC 2021 F Flappy Bird boj25250
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3812kb
input:
0 0 10 0 1 5 -10 10
output:
0 0 10 0
result:
ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
0 0 10 0 4 2 1 3 4 2 3 7 0 2 9 -2 -1
output:
0 0 4 2 9 -1 10 0
result:
ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
0 0 7 -12 3 1 -1 1 2 -3 3 5 -12 -8
output:
0 0 1 -1 7 -12
result:
ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
-1000000000 -1000000000 1000000000 999999999 1 999999999 999999998 999999999
output:
-1000000000 -1000000000 1000000000 999999999
result:
ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
-1000000000 -1000000000 1000000000 999999999 1 999999999 999999997 999999998
output:
-1000000000 -1000000000 999999999 999999998 1000000000 999999999
result:
ok
Test #6:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
1234 5678 9101112 13141516 0
output:
1234 5678 9101112 13141516
result:
ok
Test #7:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
-857527106 863786256 425157257 993242327 5 -540103659 -18381314 504684287 -534644467 -824397442 433097647 -468973840 -156232647 206807928 25352980 -638840741 175494731 160555973 -877366788 -104534723
output:
-857527106 863786256 -468973840 206807928 160555973 -104534723 425157257 993242327
result:
ok
Test #8:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
-999530894 -757521154 969041768 131518007 100 -993873267 -395316477 496470476 -955441406 -145348128 -65154892 -936263085 302331897 462088179 -901599359 -196080231 54045031 -894340331 -879707901 465787751 -837740852 -454844840 246895103 -798701714 -629946079 423822420 -765108745 -897018837 862031989 ...
output:
-999530894 -757521154 -993873267 -395316477 -955441406 -65154892 -936263085 302331897 -901599359 54045031 -756255178 -39420990 -683324079 -149025551 -678262436 571086094 -677021729 260199128 -673276463 -42402276 -603203479 -159823881 -597025771 -201945394 -596292009 -405078554 -586749382 -158540978 ...
result:
ok
Test #9:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
-857527106 863786256 425157257 993242327 5 -540103659 -18381314 504684287 -534644467 -824397442 433097647 -468973840 -156232647 206807928 25352980 -638840741 175494731 160555973 -877366788 -104534723
output:
-857527106 863786256 -468973840 206807928 160555973 -104534723 425157257 993242327
result:
ok
Test #10:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
-999530894 -757521154 969041768 131518007 100 -993873267 -395316477 496470476 -955441406 -145348128 -65154892 -936263085 302331897 462088179 -901599359 -196080231 54045031 -894340331 -879707901 465787751 -837740852 -454844840 246895103 -798701714 -629946079 423822420 -765108745 -897018837 862031989 ...
output:
-999530894 -757521154 -993873267 -395316477 -955441406 -65154892 -936263085 302331897 -901599359 54045031 -756255178 -39420990 -683324079 -149025551 -678262436 571086094 -677021729 260199128 -673276463 -42402276 -603203479 -159823881 -597025771 -201945394 -596292009 -405078554 -586749382 -158540978 ...
result:
ok
Test #11:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
-997105687 -23165947 999100288 482693523 1000 -996318633 -451396714 -106745266 -994859611 -529625136 494035118 -992641307 451152723 688296865 -990760917 -302826740 816229618 -989109087 -639319846 -461313829 -987101013 -598774034 531162712 -986149573 -134717916 119126570 -985777440 -333475306 -100172...
output:
-997105687 -23165947 -996318633 -106745266 -992641307 451152723 -989109087 -461313829 -986149573 -134717916 -984865319 -220514814 -982545651 -8948568 -978610280 -201468902 -975496597 188705399 -975113839 321841035 -972405648 395096191 -971528802 131634875 -970149948 703896856 -968938643 -621739852 -...
result:
ok
Test #12:
score: 0
Accepted
time: 1ms
memory: 3880kb
input:
-997105687 -23165947 999100288 482693523 1000 -996318633 -451396714 -106745266 -994859611 -529625136 494035118 -992641307 451152723 688296865 -990760917 -302826740 816229618 -989109087 -639319846 -461313829 -987101013 -598774034 531162712 -986149573 -134717916 119126570 -985777440 -333475306 -100172...
output:
-997105687 -23165947 -996318633 -106745266 -992641307 451152723 -989109087 -461313829 -986149573 -134717916 -984865319 -220514814 -982545651 -8948568 -978610280 -201468902 -975496597 188705399 -975113839 321841035 -972405648 395096191 -971528802 131634875 -970149948 703896856 -968938643 -621739852 -...
result:
ok
Test #13:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
-997048170 781027699 999502262 958147170 2345 -995226485 -689291585 453583085 -993414892 -894026054 588665624 -993299980 747226 645828694 -992323349 203187701 901545019 -992310034 -554734057 878871635 -992010280 246529583 467589523 -991618138 787107743 991854002 -991475920 -61941084 471732421 -99141...
output:
-997048170 781027699 -995226485 453583085 -992010280 467589523 -991618138 787107743 -991475920 471732421 -989975308 -222073741 -988452799 -221193289 -986282513 152993569 -985660322 -115853353 -985527792 240823735 -980740593 -763027549 -980125587 207538252 -979405915 454782337 -977693186 37199820 -97...
result:
ok
Test #14:
score: 0
Accepted
time: 50ms
memory: 10912kb
input:
-999991076 204373028 999963296 306035731 200000 -999965209 229645785 371236635 -999964630 -263510664 -174349962 -999961753 159119936 730743193 -999957067 -766579781 974219215 -999951489 -478502537 65283882 -999950651 -280993943 838329609 -999950199 -781597647 22152225 -999944590 -412072643 727384924...
output:
-999991076 204373028 -999965209 229645785 -999964630 -174349962 -999961753 159119936 -999921471 -359314163 -999916799 -527112406 -999884038 330178816 -999882496 708625328 -999867472 -429613976 -999847695 -121454346 -999846941 -461110223 -999787298 -350506290 -999768376 -45422680 -999750327 -39216385...
result:
ok
Test #15:
score: 0
Accepted
time: 1ms
memory: 3968kb
input:
-997048170 781027699 999502262 958147170 2345 -995226485 -689291585 453583085 -993414892 -894026054 588665624 -993299980 747226 645828694 -992323349 203187701 901545019 -992310034 -554734057 878871635 -992010280 246529583 467589523 -991618138 787107743 991854002 -991475920 -61941084 471732421 -99141...
output:
-997048170 781027699 -995226485 453583085 -992010280 467589523 -991618138 787107743 -991475920 471732421 -989975308 -222073741 -988452799 -221193289 -986282513 152993569 -985660322 -115853353 -985527792 240823735 -980740593 -763027549 -980125587 207538252 -979405915 454782337 -977693186 37199820 -97...
result:
ok
Test #16:
score: 0
Accepted
time: 57ms
memory: 11340kb
input:
-999991076 204373028 999963296 306035731 200000 -999965209 229645785 371236635 -999964630 -263510664 -174349962 -999961753 159119936 730743193 -999957067 -766579781 974219215 -999951489 -478502537 65283882 -999950651 -280993943 838329609 -999950199 -781597647 22152225 -999944590 -412072643 727384924...
output:
-999991076 204373028 -999965209 229645785 -999964630 -174349962 -999961753 159119936 -999921471 -359314163 -999916799 -527112406 -999884038 330178816 -999882496 708625328 -999867472 -429613976 -999847695 -121454346 -999846941 -461110223 -999787298 -350506290 -999768376 -45422680 -999750327 -39216385...
result:
ok
Test #17:
score: 0
Accepted
time: 8ms
memory: 4476kb
input:
0 0 31622 999950884 31621 1 -1 1 2 -1 4 3 -1 9 4 -1 16 5 -1 25 6 -1 36 7 -1 49 8 -1 64 9 -1 81 10 -1 100 11 -1 121 12 -1 144 13 -1 169 14 -1 196 15 -1 225 16 -1 256 17 -1 289 18 -1 324 19 -1 361 20 -1 400 21 -1 441 22 -1 484 23 -1 529 24 -1 576 25 -1 625 26 -1 676 27 -1 729 28 -1 784 29 -1 841 30 -1...
output:
0 0 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100 11 121 12 144 13 169 14 196 15 225 16 256 17 289 18 324 19 361 20 400 21 441 22 484 23 529 24 576 25 625 26 676 27 729 28 784 29 841 30 900 31 961 32 1024 33 1089 34 1156 35 1225 36 1296 37 1369 38 1444 39 1521 40 1600 41 1681 42 1764 43 1849 44 1...
result:
ok
Test #18:
score: 0
Accepted
time: 256ms
memory: 45928kb
input:
-999995979 -33017511 999993794 -847897008 999877 -999995413 -679104455 603950449 -999992841 -320446473 -122731180 -999990462 -588371459 393845005 -999987079 -696225406 -334024317 -999986024 -824880857 -790457602 -999983753 -667992306 -10118114 -999982979 -776548041 35941350 -999982888 -956529756 266...
output:
-999995979 -33017511 -999987079 -696225406 -999986024 -790457602 -999980326 61534926 -999971100 251816785 -999969836 -95456694 -999959632 -327024247 -999956103 826245981 -999953008 243399495 -999952336 98430260 -999950821 360168171 -999941844 417189254 -999938914 -249493202 -999938662 370055364 -999...
result:
ok
Test #19:
score: 0
Accepted
time: 282ms
memory: 46980kb
input:
-999999430 -71987394 999994788 -257373827 1000000 -999997750 690429269 987340224 -999993115 -817343528 -86831390 -999991353 -637499205 141330829 -999989476 -955872238 815819919 -999986411 -878409267 83643623 -999986381 -597774190 -283722875 -999985199 -651303974 -350648836 -999975534 -650889016 9947...
output:
-999999430 -71987394 -999997750 690429269 -999993115 -86831390 -999985199 -350648836 -999968199 53987370 -999961886 -455365832 -999957329 602354431 -999957193 47889623 -999955945 26799154 -999950524 227219949 -999943913 -283576810 -999934883 150485305 -999921811 320696737 -999921363 56016360 -999919...
result:
ok
Test #20:
score: 0
Accepted
time: 261ms
memory: 46408kb
input:
-999994636 523026666 999999495 -62672869 999999 -999994156 -792055888 -700410884 -999992113 -409051167 -348393307 -999991060 732575673 847338638 -999981357 74161984 697951723 -999978407 -226953494 303927349 -999977785 327319718 713726154 -999972762 -524909987 -457307270 -999971768 836761477 92160401...
output:
-999994636 523026666 -999994156 -700410884 -999992113 -348393307 -999991060 732575673 -999978407 303927349 -999977785 327319718 -999972762 -457307270 -999971768 836761477 -999968980 273970779 -999966866 527117214 -999962748 308616298 -999957251 -253591300 -999956279 611539872 -999956250 545837887 -9...
result:
ok
Test #21:
score: 0
Accepted
time: 263ms
memory: 47348kb
input:
-999997284 -762551953 999999839 275124718 999998 -999994941 -956133072 134069111 -999993166 341094114 427102967 -999991160 -823597556 -58347809 -999990473 -726126803 -78568313 -999988450 543141477 981232914 -999986001 -201666665 351372700 -999983661 215603402 529250251 -999982333 -800928252 58208931...
output:
-999997284 -762551953 -999993166 341094114 -999991160 -58347809 -999990473 -78568313 -999988450 543141477 -999986001 351372700 -999978922 31386012 -999975758 427458877 -999974006 258021307 -999972721 -103228737 -999969584 240326093 -999963824 131019336 -999961793 374197579 -999961696 156520845 -9999...
result:
ok
Test #22:
score: 0
Accepted
time: 268ms
memory: 47468kb
input:
-999999549 -398514564 999997657 -762118338 999997 -999999352 -152352520 631675470 -999998982 215684679 841340555 -999996071 -136281760 964736560 -999995851 -820615769 -618491091 -999995339 -916158933 910952674 -999993878 -744648420 -205336463 -999993334 -559499006 -459293207 -999988504 -385575441 75...
output:
-999999549 -398514564 -999999352 -152352520 -999998982 215684679 -999996071 -136281760 -999995851 -618491091 -999974357 696232129 -999965942 221345250 -999964672 315041752 -999963869 651427956 -999962819 -218377701 -999961110 -287739071 -999960966 -195708296 -999959463 714223010 -999956155 398049492...
result:
ok
Test #23:
score: 0
Accepted
time: 255ms
memory: 45980kb
input:
-999992537 -544121081 999999726 -994818566 999996 -999987640 -503457521 -496742094 -999986282 -223513951 120711739 -999985422 -276361420 311783307 -999982167 -718358397 29998199 -999982005 -902433047 537018050 -999980386 -749486242 518871943 -999980078 -898310433 -232168916 -999974258 -718023086 706...
output:
-999992537 -544121081 -999987640 -496742094 -999986282 -223513951 -999980078 -232168916 -999974170 218610655 -999971258 81449309 -999967902 -118337622 -999963602 236698763 -999959943 -577892020 -999959451 -202931854 -999958857 -189377780 -999947210 -45211943 -999945860 605368832 -999945144 678367126...
result:
ok
Test #24:
score: 0
Accepted
time: 272ms
memory: 45980kb
input:
-999999593 834943894 999996795 -461550887 999995 -999996833 -843178731 242018180 -999995791 -25708332 961307539 -999993201 -602841113 217550278 -999988895 -452606134 57293307 -999986400 -852451102 40607492 -999981818 -920830328 893003607 -999974690 -488779835 -119063142 -999973903 -355440105 4990997...
output:
-999999593 834943894 -999996833 242018180 -999988895 57293307 -999974690 -119063142 -999971776 -11770831 -999961862 286901963 -999960497 -389444857 -999958220 36410544 -999957354 -376123709 -999949349 -360563725 -999948440 -474440745 -999946951 -395704162 -999941567 293670521 -999938469 -792773732 -...
result:
ok
Test #25:
score: 0
Accepted
time: 268ms
memory: 45144kb
input:
-999999106 -414588648 999999393 864182234 999994 -999991590 -468815242 25132636 -999987894 -538635194 -21406375 -999987781 -434505098 989576893 -999986616 634958190 702628606 -999985635 -464505318 69449197 -999985467 245770375 410535912 -999984561 -990091539 36824057 -999984029 627286723 969543369 -...
output:
-999999106 -414588648 -999987894 -21406375 -999986616 634958190 -999985635 69449197 -999985467 245770375 -999984561 36824057 -999984029 627286723 -999981413 35855119 -999978170 153952015 -999977987 337821665 -999973364 16998968 -999971207 -426434467 -999961559 132083399 -999960192 -23347203 -9999598...
result:
ok
Test #26:
score: 0
Accepted
time: 267ms
memory: 47656kb
input:
-999999555 487524159 999999012 -38682249 999993 -999995145 -727044967 552625141 -999993376 703661691 748416072 -999989499 945580963 981742400 -999986544 -960672776 -924607267 -999981728 -934255621 213006114 -999977588 -799462787 14788386 -999975711 -953426936 -203419417 -999973544 -586958038 3047103...
output:
-999999555 487524159 -999995145 552625141 -999993376 703661691 -999989499 945580963 -999986544 -924607267 -999973544 -586958038 -999972847 -570469237 -999972464 -681336704 -999972046 139079695 -999971008 -403818418 -999970969 -255418718 -999947161 931238400 -999945845 604620929 -999945207 365867753 ...
result:
ok
Test #27:
score: 0
Accepted
time: 265ms
memory: 47036kb
input:
-999997918 185518753 999996317 651131192 999992 -999993877 -476108546 701396713 -999992062 -896360618 -71713686 -999989303 -202367702 148979431 -999988697 -775772434 -156778760 -999988178 -504444366 -288429426 -999984240 -964663407 -805877883 -999981850 -258859282 746544078 -999981049 -932212522 -84...
output:
-999997918 185518753 -999989303 -202367702 -999984240 -805877883 -999981850 -258859282 -999981049 -842602877 -999978432 744029954 -999977202 -260225908 -999974997 -116482786 -999972791 138027765 -999972586 -12986100 -999972059 362959616 -999965720 223879060 -999960685 109339132 -999954598 -83030512 ...
result:
ok
Test #28:
score: 0
Accepted
time: 235ms
memory: 46368kb
input:
-999999879 243504753 999999970 576303721 999991 -999999332 -262931214 215283596 -999992818 -384029460 948213855 -999991944 -772734786 578357031 -999991143 571508340 709092613 -999987542 -666342248 -175912356 -999987196 -399409214 -253149545 -999981701 -290083072 -271324551 -999978745 367609851 80957...
output:
-999999879 243504753 -999999332 215283596 -999991143 571508340 -999987196 -253149545 -999981701 -271324551 -999978745 367609851 -999978509 -92872120 -999973606 -632718801 -999972110 -327569428 -999966965 4004409 -999966278 198356339 -999961203 -265256242 -999960634 -263645494 -999958334 6205949 -999...
result:
ok
Test #29:
score: 0
Accepted
time: 265ms
memory: 47064kb
input:
-999998610 649092777 999997429 -948618109 999990 -999994266 -244735380 938845717 -999993598 110805545 767711774 -999993020 131810053 256594274 -999993014 -697603528 9620485 -999986737 -522827936 901208587 -999986624 -951799094 392302954 -999985385 -901405784 310851287 -999983895 -206193965 344430545...
output:
-999998610 649092777 -999993020 131810053 -999993014 9620485 -999973355 373600657 -999965423 -695171695 -999962740 262944671 -999962341 19776656 -999962269 -279426936 -999959284 -121799825 -999952646 447826324 -999952328 -609681865 -999948671 -456905066 -999943234 -317960855 -999941690 233985197 -99...
result:
ok
Test #30:
score: 0
Accepted
time: 263ms
memory: 45608kb
input:
-999997586 622716343 999988129 85146343 999989 -999996577 -922881432 -447350498 -999995636 -853905459 -719495741 -999992900 668470835 811654909 -999991821 -396463078 481391355 -999988292 -45022897 755482718 -999986921 -440904004 -16092890 -999986399 -712221172 567078914 -999984128 -920707600 -185486...
output:
-999997586 622716343 -999996577 -447350498 -999995636 -719495741 -999992900 668470835 -999991821 481391355 -999986921 -16092890 -999984128 -185486493 -999980256 -29696189 -999973921 -262740451 -999955747 -30948327 -999955130 -22360117 -999950597 437582058 -999949825 84917994 -999946273 453195650 -99...
result:
ok
Test #31:
score: 0
Accepted
time: 282ms
memory: 46920kb
input:
-999997695 725260673 999997823 470217328 999988 -999997412 -637921437 496849887 -999994139 -597587007 -355038477 -999991056 -108547854 -64279924 -999988404 360746873 785012682 -999986106 -96123644 318281654 -999985687 -122006532 157512084 -999985251 -490767507 601880409 -999983662 -972569721 2363370...
output:
-999997695 725260673 -999997412 496849887 -999994139 -355038477 -999991056 -64279924 -999988404 360746873 -999985687 157512084 -999977233 -301737896 -999976074 771686 -999975946 679957991 -999973679 -622170434 -999972689 116005236 -999967893 46711574 -999966827 342105230 -999965769 13159338 -9999616...
result:
ok
Test #32:
score: 0
Accepted
time: 259ms
memory: 46928kb
input:
-999998455 -41329908 999999311 -667941575 999987 -999997276 -557422079 770102466 -999996592 897118618 916681093 -999995922 60432021 731861306 -999994055 -599412994 -516173078 -999991645 353650152 554676634 -999991219 -395688603 39501236 -999989103 149216171 661970803 -999988950 -657446345 -217448996...
output:
-999998455 -41329908 -999996592 897118618 -999994055 -516173078 -999991645 353650152 -999991219 39501236 -999989103 149216171 -999988950 -217448996 -999986116 -44799893 -999985961 567251710 -999976034 -105751003 -999965114 86214605 -999960793 367891452 -999958953 -206767391 -999956646 589741426 -999...
result:
ok
Test #33:
score: 0
Accepted
time: 265ms
memory: 47016kb
input:
-999999837 475468362 999995518 978511331 999986 -999997747 -158887961 99462982 -999997436 -498212823 945305497 -999991104 -979007717 -873889120 -999989887 -738320945 -552737587 -999988025 -816187943 -243880759 -999986147 -599557537 -287947899 -999983446 -814929324 -22540318 -999978276 -481658650 476...
output:
-999999837 475468362 -999997747 99462982 -999991104 -873889120 -999989887 -738320945 -999986147 -599557537 -999975953 -379708340 -999975580 710781891 -999971247 564919230 -999968437 -642776134 -999965577 -92091014 -999961193 351377199 -999959812 736958695 -999955701 -56255361 -999952668 407344150 -9...
result:
ok
Test #34:
score: 0
Accepted
time: 253ms
memory: 47692kb
input:
-999996311 45879736 999999928 832937678 999985 -999993219 -797643537 325904192 -999990146 -93600075 800046754 -999988350 -777159393 -722007286 -999986203 -590189546 -313043416 -999985155 -63036772 712959282 -999983213 -262630943 152030069 -999982111 -538560346 899115320 -999977130 -657948985 1562045...
output:
-999996311 45879736 -999990146 -93600075 -999988350 -722007286 -999986203 -313043416 -999985155 -63036772 -999971512 57875834 -999970001 551410488 -999964492 -722572662 -999954937 791654104 -999952720 -35143827 -999940134 -208793444 -999937076 -505023375 -999936745 956267537 -999936706 332582052 -99...
result:
ok
Test #35:
score: 0
Accepted
time: 260ms
memory: 45060kb
input:
-999997881 297875383 999993264 829625515 999984 -999996378 -612729236 30031892 -999995329 -491232339 438266408 -999992369 -767375060 288226629 -999991759 -129289727 349001347 -999988928 -827128207 -166174102 -999982130 -652919427 698220357 -999981343 -417178984 -305980761 -999980473 -798921473 76445...
output:
-999997881 297875383 -999996378 30031892 -999978018 -482274397 -999977735 224192394 -999974252 465961205 -999971212 274484685 -999970778 186522013 -999967358 539533862 -999966939 782418921 -999965307 62541213 -999963969 134814149 -999963286 -357291008 -999961933 -85087429 -999957550 -105133874 -9999...
result:
ok
Test #36:
score: 0
Accepted
time: 264ms
memory: 46772kb
input:
-999999645 -374821429 999999736 -144654356 999983 -999997728 -219155021 195477830 -999996464 -718435171 -353642185 -999995813 -818539136 20366179 -999995428 -753913638 911233898 -999994149 -647331200 -167084861 -999993244 105027186 760956054 -999992023 -300250518 450846569 -999986282 186976068 22818...
output:
-999999645 -374821429 -999997728 -219155021 -999996464 -353642185 -999994149 -167084861 -999993244 105027186 -999986282 186976068 -999978758 -921821570 -999974015 -221008156 -999969652 -141471834 -999963483 -695469007 -999959892 864289866 -999956268 -854421375 -999948502 -156844398 -999947237 301980...
result:
ok
Test #37:
score: 0
Accepted
time: 265ms
memory: 46044kb
input:
-999999744 -800896390 999999362 18451712 999982 -999998772 -302162614 -281349881 -999992316 -843279618 219414701 -999990531 394239581 696666805 -999989141 -16220909 43073229 -999987588 -483883360 -8040760 -999982734 -88429379 464100922 -999981997 -33807966 744975455 -999979716 6611055 730911635 -999...
output:
-999999744 -800896390 -999998772 -302162614 -999992316 219414701 -999990531 394239581 -999989141 43073229 -999987588 -8040760 -999972703 373212465 -999966925 -367235099 -999962461 -369880970 -999962355 -600123940 -999960594 -255409953 -999956163 383256800 -999955200 255294442 -999951162 79111208 -99...
result:
ok
Test #38:
score: 0
Accepted
time: 269ms
memory: 45996kb
input:
-999999059 860562546 999997891 -392581706 999981 -999996349 -295252274 456203326 -999993208 -338428540 432520736 -999992380 269299022 944762610 -999990303 -744327572 -285049923 -999983972 -842242068 129348354 -999983091 652536743 765165232 -999971359 -791428577 -714004481 -999970732 419258275 640480...
output:
-999999059 860562546 -999996349 456203326 -999992380 269299022 -999990303 -285049923 -999983972 129348354 -999983091 652536743 -999971359 -714004481 -999970732 419258275 -999969574 -395620423 -999958569 32012927 -999947881 -387338012 -999946850 802307034 -999945115 566541539 -999933830 -510214867 -9...
result:
ok
Test #39:
score: 0
Accepted
time: 174ms
memory: 28564kb
input:
0 0 1000001 986280964 1000000 1 -1000000000 1 2 -1000000000 2 3 -1000000000 5 4 -1000000000 7 5 -1000000000 11 6 -1000000000 14 7 -1000000000 18 8 -1000000000 22 9 -1000000000 26 10 -1000000000 31 11 -1000000000 36 12 -1000000000 41 13 -1000000000 46 14 -1000000000 52 15 -1000000000 57 16 -100000000...
output:
0 0 2 2 4 7 6 14 9 26 13 46 15 57 17 69 21 95 23 109 27 139 30 163 33 188 39 242 43 280 47 320 51 362 58 439 60 462 63 497 66 533 69 570 71 595 74 633 78 685 81 725 83 752 86 793 90 849 93 892 97 950 105 1070 111 1163 119 1291 125 1390 135 1560 139 1630 142 1683 150 1827 156 1938 159 1994 166 2127 1...
result:
ok
Test #40:
score: 0
Accepted
time: 155ms
memory: 27812kb
input:
-1000000000 0 1000000000 0 999962 -999998000 10 1000000000 -999996000 10 1000000000 -999994000 10 1000000000 -999992000 10 1000000000 -999990000 10 1000000000 -999988000 10 1000000000 -999986000 10 1000000000 -999984000 10 1000000000 -999982000 10 1000000000 -999980000 10 1000000000 -999978000 10 10...
output:
-1000000000 0 -999998000 10 999997999 10 1000000000 0
result:
ok
Test #41:
score: 0
Accepted
time: 228ms
memory: 45288kb
input:
0 0 999908 0 999907 1 499952 499953 2 -999906 -999905 3 499951 499952 4 -999904 -999903 5 499950 499951 6 -999902 -999901 7 499949 499950 8 -999900 -999899 9 499948 499949 10 -999898 -999897 11 499947 499948 12 -999896 -999895 13 499946 499947 14 -999894 -999893 15 499945 499946 16 -999892 -999891 1...
output:
0 0 1 499952 2 -999905 3 499951 4 -999903 5 499950 6 -999901 7 499949 8 -999899 9 499948 10 -999897 11 499947 12 -999895 13 499946 14 -999893 15 499945 16 -999891 17 499944 18 -999889 19 499943 20 -999887 21 499942 22 -999885 23 499941 24 -999883 25 499940 26 -999881 27 499939 28 -999879 29 499938 3...
result:
ok
Test #42:
score: 0
Accepted
time: 277ms
memory: 46324kb
input:
-1000000000 -1000000000 1000000000 1000000000 1000000 -968379 999999999 1000000000 -968378 -999999999 -999999998 -968377 999999997 999999998 -968376 -999999997 -999999996 -968375 999999995 999999996 -968374 -999999995 -999999994 -968373 999999993 999999994 -968372 -999999993 -999999992 -968371 99999...
output:
-1000000000 -1000000000 -968379 999999999 -968378 -999999998 -968377 999999997 -968376 -999999996 -968375 999999995 -968374 -999999994 -968373 999999993 -968372 -999999992 -968371 999999991 -968370 -999999990 -968369 999999989 -968368 -999999988 -968367 999999987 -968366 -999999986 -968365 999999985...
result:
ok