QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#641911 | #6227. 区间和 | Elegia | 100 ✓ | 244ms | 35356kb | C++14 | 6.1kb | 2024-10-15 03:16:17 | 2024-10-15 03:16:19 |
Judging History
answer
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <numeric>
#define LOG(FMT...) fprintf(stderr, FMT)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>
istream &operator>>(istream &is, vector<T> &v) {
for (T &x : v)
is >> x;
return is;
}
template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
if (!v.empty()) {
os << v.front();
for (int i = 1; i < v.size(); ++i)
os << ' ' << v[i];
}
return os;
}
const int N = 100010;
const int INF = numeric_limits<int>::max();
namespace KTT$BEATS {
struct DP {
ll sum, pre, suf, tot;
DP(ll sum, ll pre, ll suf, ll tot) : sum(sum), pre(pre), suf(suf), tot(tot) {}
DP operator+(const DP &rhs) const {
return DP(sum + rhs.sum, max(pre, sum + rhs.pre), max(suf + rhs.sum, rhs.suf),
max({tot, rhs.tot, suf + rhs.pre}));
}
};
struct Line {
int k;
ll b;
Line(int k = 0, ll b = 0) : k(k), b(b) {}
Line operator+(const Line &rhs) const { return Line(k + rhs.k, b + rhs.b); }
void inc(int x) {
b += k * (ll) x;
}
int defeat(const Line &rhs) const {
//assert(b >= rhs.b);
if (k >= rhs.k) return INF;
return (rhs.b - b) / (k - rhs.k) + 1;
}
};
int select(Line &mx, const Line &a, const Line &b) {
if (a.b >= b.b)
return (mx = a).defeat(b);
return (mx = b).defeat(a);
}
int select3(Line &mx, const Line &a, const Line &b, const Line &c) {
if (a.b >= b.b) {
if (a.b >= c.b) mx = a;
else mx = c;
} else {
if (b.b >= c.b) mx = b;
else mx = c;
}
return min({mx.defeat(a), mx.defeat(b), mx.defeat(c)});
}
struct Node {
int min, secmin, t, lazy;
Line sum, pre, suf, tot;
} P[N << 2];
void upd(int o) {
static Node ls, rs;
ls = P[o << 1];
rs = P[o << 1 | 1];
if (ls.min < rs.min) {
P[o].min = ls.min;
P[o].secmin = min(ls.secmin, rs.min);
rs.sum.k = rs.pre.k = rs.suf.k = rs.tot.k = 0;
} else if (ls.min > rs.min) {
P[o].min = rs.min;
P[o].secmin = min(ls.min, rs.secmin);
ls.sum.k = ls.pre.k = ls.suf.k = ls.tot.k = 0;
} else {
P[o].min = ls.min;
P[o].secmin = min(ls.secmin, rs.secmin);
}
P[o].sum = ls.sum + rs.sum;
P[o].t = min({ls.t, rs.t, select(P[o].pre, ls.pre, rs.pre + ls.sum),
select(P[o].suf, rs.suf, ls.suf + rs.sum),
select3(P[o].tot, ls.tot, rs.tot, ls.suf + rs.pre)});
}
void apply(int o, int x) {
P[o].t -= x;
P[o].min += x;
P[o].lazy += x;
P[o].sum.inc(x);
P[o].pre.inc(x);
P[o].suf.inc(x);
P[o].tot.inc(x);
}
void pd(int o) {
if (P[o].lazy) {
for (int i = 0; i < 2; ++i)
if (P[o].min - P[o].lazy == P[o << 1 | i].min)
apply(o << 1 | i, P[o].lazy);
P[o].lazy = 0;
}
}
void build(int o, int l, int r, int *a) {
if (l == r) {
P[o].sum = Line(1, a[l]);
if (a[l] >= 0)
P[o].pre = P[o].suf = P[o].tot = Line(1, a[l]);
else
P[o].pre = P[o].suf = P[o].tot = Line(0, 0);
P[o].min = a[l];
P[o].secmin = INF;
if (a[l] >= 0)
P[o].t = INF;
else
P[o].t = -a[l];
return;
}
int mid = (l + r) >> 1;
build(o << 1, l, mid, a);
build(o << 1 | 1, mid + 1, r, a);
upd(o);
}
DP query(int o, int l, int r, int ql, int qr) {
if (ql == l && qr == r)
return DP(P[o].sum.b, P[o].pre.b, P[o].suf.b, P[o].tot.b);
pd(o);
int mid = (l + r) >> 1;
if (qr <= mid) return query(o << 1, l, mid, ql, qr);
if (ql > mid) return query(o << 1 | 1, mid + 1, r, ql, qr);
return query(o << 1, l, mid, ql, mid) + query(o << 1 | 1, mid + 1, r, mid + 1, qr);
}
void inc(int o, int l, int r, int x) {
if (x < P[o].t) {
apply(o, x);
return;
}
if (l == r) {
P[o].min += x;
P[o].sum.inc(x);
if (P[o].min >= 0) {
P[o].pre = P[o].suf = P[o].tot = Line(1, P[o].min);
P[o].t = INF;
} else
P[o].t -= x;
return;
}
pd(o);
int mid = (l + r) >> 1;
if (P[o].min == P[o << 1].min)
inc(o << 1, l, mid, x);
if (P[o].min == P[o << 1 | 1].min)
inc(o << 1 | 1, mid + 1, r, x);
upd(o);
}
void lift(int o, int l, int r, int x) {
if (P[o].min >= x) return;
if (P[o].secmin > x)
return inc(o, l, r, x - P[o].min);
pd(o);
int mid = (l + r) >> 1;
lift(o << 1, l, mid, x);
lift(o << 1 | 1, mid + 1, r, x);
upd(o);
}
void lift(int o, int l, int r, int ql, int qr, int x) {
if (ql == l && qr == r) return lift(o, l, r, x);
pd(o);
int mid = (l + r) >> 1;
if (qr <= mid) lift(o << 1, l, mid, ql, qr, x);
else if (ql > mid) lift(o << 1 | 1, mid + 1, r, ql, qr, x);
else {
lift(o << 1, l, mid, ql, mid, x);
lift(o << 1 | 1, mid + 1, r, mid + 1, qr, x);
}
upd(o);
}
}
int a[N];
int main() {
#ifdef ELEGIA
freopen("test.in", "r", stdin);
int nol_cl = clock();
#endif
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, q;
cin >> n >> q;
for (int i = 1; i <= n; ++i) cin >> a[i];
KTT$BEATS::build(1, 1, n, a);
while (q--) {
int opt, l, r, x;
cin >> opt >> l >> r;
if (opt == 0) {
cin >> x;
//cerr << "op " << l << ' ' << r << ' ' << x << '\n';
KTT$BEATS::lift(1, 1, n, l, r, x);
} else {
cout << KTT$BEATS::query(1, 1, n, l, r).tot << '\n';
}
}
#ifdef ELEGIA
LOG("Time: %dms\n", int ((clock()
-nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
return 0;
}
详细
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 8ms
memory: 34980kb
input:
182 187 20634704 -703314946 -948946252 144678123 5498424 341678302 -583114991 -196836433 43951489 -525692929 12701289 476729334 473931783 221423816 187493596 355488624 -39527016 -914505949 161713515 -227399136 -318205061 226437730 -601354045 -755181154 -241221294 256834551 44488096 -422708891 -79709...
output:
270081855 539758298 1110244863 539758298 933165833 933165833 415646256 1727768442 933165833 539758298 1727768442 1110244863 1110244863 933165833 933165833 1727768442 1110244863 1110244863 478904667 1110244863 1110244863 8394442494 6275824497 51650758 1727768442 3992159989 1727768442 4930450100 87815...
result:
ok 86 lines
Subtask #2:
score: 5
Accepted
Test #2:
score: 5
Accepted
time: 3ms
memory: 35028kb
input:
195 195 248663111 -522337032 -47794804 -955243356 418601542 493840666 478655582 -269027492 -801169819 -410940079 -766532109 -547019833 -158802702 -193483181 -125250985 35351136 -47755604 -781346033 -613952400 -155863697 5685369 -620132917 222562003 -563874770 65617262 356362550 -311762774 86801383 -...
output:
1190435898 1190435898 639530621 639530621 639530621 639530621 1391097790 1190435898 639530621 579188534 630930122 639530621 639530621 350877205 518835809 639530621 639530621 972496248 639530621 611410143 1190435898 579188534 1190435898 518835809 518835809 611410143 929409019 330633442 39062849 63953...
result:
ok 99 lines
Test #3:
score: 5
Accepted
time: 0ms
memory: 34904kb
input:
200 200 -475917207 134447910 168101624 -924436776 292537664 -639718549 362404538 -477799486 -51877303 -808982390 -649509525 -264491133 -910258698 354725946 -700765858 -347777065 -320717924 -840673711 -543439050 -211488853 -123605600 38516390 -346182523 393623377 -61538082 -40175721 59169104 -8397460...
output:
446344765 166798859 166798859 773752826 773752826 773752826 0 130016383 553327407 605588305 773752826 605588305 493432265 773752826 553327407 773752826 773752826 773752826 220598952 446344765 553327407 605588305 446344765 446344765 199829454 161268094 773752826 773752826 605588305 605588305 39362337...
result:
ok 106 lines
Subtask #3:
score: 5
Accepted
Test #4:
score: 5
Accepted
time: 3ms
memory: 34976kb
input:
1834 1935 -32669453 -670047955 -534537788 80759807 -678610903 -5993655 476471070 90341342 -187206225 -710992660 -837284426 -844649722 -846473433 123470247 177108533 -821700607 97488160 171075677 -146656769 -775261735 -464781034 -518041912 -668027329 -286982559 -108624782 483720318 -632815034 -881243...
output:
1137782164 774147943 1279874032 1267995234 1689668080 1279874032 893115370 1689668080 1279874032 1294914714 697506760 998636635 712660432 1689668080 1137805811 786895412 1137805811 1294914714 1137805811 1294914714 1137782164 1279874032 1137782164 10445269872 10445269872 10445269872 10445269872 10445...
result:
ok 932 lines
Subtask #4:
score: 5
Accepted
Test #5:
score: 5
Accepted
time: 0ms
memory: 35092kb
input:
1893 1857 -575490410 -790871182 -488011488 -321041425 238235943 262471772 -469848975 -105728328 62479104 19449896 54374656 91107269 125781673 251316981 -264727698 -933332817 315892884 -117300817 -826569250 -156322407 -109499160 202312868 264008468 -814436982 -431822419 -791224962 -67966257 407973223...
output:
936342527 1833261811 1833261811 1833261811 1073428714 1833261811 1073428714 1833261811 1833261811 1833261811 1833261811 1833261811 1762929123 1073428714 1833261811 1833261811 12232324898 61547147263 45295265069 61547147263 444826397143 58754678356 622444335 84132616330 176061031774 399168235633 5761...
result:
ok 883 lines
Test #6:
score: 5
Accepted
time: 0ms
memory: 35140kb
input:
2000 2000 -107215566 300946241 -154302920 -565707207 -772379360 277307762 -152027936 137372230 -564948848 -70081215 -390261424 440753040 469350452 -122625739 -482919665 -731090555 -245030097 -160557041 -564132588 -30059302 -551607706 -998841156 -753020850 -662301883 -44139337 363573453 -334532581 48...
output:
1520264374 844229994 1520264374 1239119950 1416549012 1043060867 612390650 1520264374 1043060867 1520264374 1712145486 794722617 1712145486 1520264374 1416549012 1520264374 681525263 1712145486 1416549012 493335922 1712145486 1520264374 1712145486 844229994 991434419 1520264374 1520264374 1712145486...
result:
ok 1024 lines
Subtask #5:
score: 5
Accepted
Test #7:
score: 5
Accepted
time: 76ms
memory: 35284kb
input:
97140 97922 75593863 -269004770 -675918045 472330615 -528175962 -580254086 -951270301 -544120385 -525052964 83784128 -226029062 -845875377 34756691 -952920941 -135400084 -20027657 -106558944 -855126948 46245866 -27672459 57802322 -834704313 -625678818 477028623 -9764793 -562713509 477554293 -7238437...
output:
1901808402 2589864136 2615472062 1901808402 2703782432 2703782432 2615472062 2615472062 2615472062 2067055974 2703782432 2615472062 2615472062 2615472062 2615472062 421081808 2615472062 1883490541 1883490541 2441176212 2067055974 2020462870 2615472062 2703782432 2441176212 2703782432 2299923583 2441...
result:
ok 48670 lines
Subtask #6:
score: 5
Accepted
Test #8:
score: 5
Accepted
time: 137ms
memory: 35296kb
input:
97981 186115 -226252189 -571234361 62844820 434180550 269963453 329910638 -847454849 112774660 -178914951 71306715 -859266500 -339120598 -962299988 -157196500 125308122 -668295657 -761232762 165342869 134196398 -767235541 -384052757 -305824813 199376354 226477587 -678798649 -885355596 -979742822 -84...
output:
1819183608 2495542993 2495542993 2084102650 2495542993 2220231814 2495542993 2220231814 2293866611 1927092471 1739879062 2495542993 2495542993 1923181637 2220231814 1494640322 2220231814 2495542993 1927092471 2495542993 1881136236 2495542993 2495542993 2495542993 2112346048 2495542993 2495542993 222...
result:
ok 92966 lines
Subtask #7:
score: 5
Accepted
Test #9:
score: 5
Accepted
time: 146ms
memory: 35348kb
input:
100000 200000 -372870627 -42874740 -537215664 -906588913 -835034566 -406645490 -54474616 -38917607 467210345 -993351739 450345098 12085867 -344729277 -480989044 388326288 -297525580 -259462382 -224591683 -948514660 -494880819 -13589765 -249884145 -387021275 471618602 291976233 358261225 -268906305 1...
output:
1841236083 2463913756 3170394596 3170394596 2463913756 2747069068 3170394596 3170394596 2747069068 3170394596 3170394596 3170394596 1875295477 2747069068 3170394596 3170394596 1868323991 2514664161 3170394596 2514664161 3170394596 3170394596 3170394596 3170394596 3170394596 1914135908 2747069068 317...
result:
ok 99715 lines
Subtask #8:
score: 5
Accepted
Test #10:
score: 5
Accepted
time: 141ms
memory: 35352kb
input:
100000 200000 144608435 -87274600 -974677350 -100352489 -649030362 -39453096 289447879 -537852584 -94574777 337360089 -199669378 -850160928 -298263608 -591161493 231532575 -573617469 -439297426 260642811 425094445 300764130 -476717856 -965323290 102381102 113958066 -683059518 -390842776 -444568945 -...
output:
1949383025 2089788051 2217473154 2317971860 2217473154 2217473154 2109029972 1313420784 2317971860 2217473154 2317971860 2109029972 2317971860 2317971860 2080688479 2317971860 1572475396 2317971860 2109029972 2217473154 2089788051 2317971860 2109029972 1947887794 2109029972 1969937655 2317971860 210...
result:
ok 100024 lines
Subtask #9:
score: 5
Accepted
Test #11:
score: 5
Accepted
time: 155ms
memory: 35356kb
input:
100000 200000 21871390 -860420857 -462213415 -669025807 -260713612 225198084 387180573 31901468 -79466646 -251439643 -593680453 -56298015 -436840232 -277416623 -606833369 311445607 -468196483 -819533304 417838981 -448959219 -517533939 -295117724 -255342449 -218817100 264166786 258541865 7382813 -268...
output:
1689797409 2687069651 2019825451 1806609143 2019825451 3385030765 3385030765 2687069651 3385030765 2758502704 3385030765 3385030765 3385030765 2019825451 2758502704 3385030765 3385030765 2758502704 3385030765 2185444656 2758502704 3385030765 2687069651 3385030765 3385030765 3385030765 3385030765 338...
result:
ok 100081 lines
Test #12:
score: 5
Accepted
time: 144ms
memory: 35272kb
input:
100000 200000 -401401250 -885857116 410723463 -244305377 -25591488 407803305 219938653 -783240987 -225715768 218449074 -899907600 -151354935 -308711466 -10853978 -65937459 86760080 -451157162 -268769676 -510520098 -776019619 -571358783 -152612168 56347434 -532914379 -128957552 -514831396 282407029 4...
output:
2186441814 2362563927 1717698691 2362563927 2362563927 2187267852 2464889211 2325212535 2187267852 2362563927 1561958126 2362563927 1830826681 2362563927 2362563927 2186441814 1999929173 2325212535 1904167572 2325212535 2464889211 2325212535 2362563927 1906990190 2362563927 2362563927 2378323268 236...
result:
ok 100332 lines
Subtask #10:
score: 5
Accepted
Test #13:
score: 5
Accepted
time: 178ms
memory: 35288kb
input:
95517 191795 -725239261 -299498656 71286270 -594521669 192006852 271302895 182213759 -447983665 496646313 364428830 141890698 -582020559 102214817 -223415363 -502837969 -762043847 -607694704 -229708001 6321315 240383244 -776743439 193648400 -974528015 44096904 -785689867 -185689539 -492379003 289140...
output:
2554548427 2554548427 2554548427 2554548427 2571377320 2571377320 2571377320 2571377320 2571377320 2571377320 2571377320 2571377320 2571377320 2571377320 2571377320 70139131164484 70139131164484 70139131164484 70139131164484 70139131164484 70139131164484 70139131164484 70139131164484 70139131164484 ...
result:
ok 95972 lines
Subtask #11:
score: 5
Accepted
Test #14:
score: 5
Accepted
time: 185ms
memory: 35228kb
input:
100000 200000 135797954 -138947496 -406182714 438477901 -267057521 -232444211 130630377 -317348655 37833748 -981372450 246923545 -803068401 216077120 233292050 -267523089 -630927369 -922280156 302142108 -175654796 -464364140 -534375053 -118878135 445980692 -371294038 -797139239 -631637350 418273018 ...
output:
3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 3220264508 322...
result:
ok 100235 lines
Subtask #12:
score: 5
Accepted
Test #15:
score: 5
Accepted
time: 182ms
memory: 35224kb
input:
100000 200000 -924767382 -769781514 144232383 -995460305 274241911 -591199999 -462371403 -736028436 -723144279 204535592 -76117810 136712480 197266266 301370706 -157194236 -533948187 439155758 458743159 -856515801 -189489725 -57278555 -20198384 445455871 272093273 -231072195 212372946 245905921 7066...
output:
2749251676 2749251676 2749251676 2749251676 2749251676 2749251676 2749251676 2749251676 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 5462609335899 54...
result:
ok 99883 lines
Subtask #13:
score: 5
Accepted
Test #16:
score: 5
Accepted
time: 188ms
memory: 35228kb
input:
100000 200000 388142692 -345061796 393830628 210472351 75607734 -959422668 -800026188 -960077632 -668437004 -754515329 -307441856 192254236 -451503349 -536240240 376753194 131296191 -966349165 -144012934 -795609529 -4772916 -149566306 -97856138 -913369907 -924695033 20622624 -474639442 283572561 -95...
output:
3110564098 3110564098 3110564098 3110564098 3110564098 3110564098 3110564098 3110564098 3110564098 3110564098 3110564098 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608 19251662950608...
result:
ok 99618 lines
Test #17:
score: 5
Accepted
time: 173ms
memory: 35352kb
input:
100000 200000 -226095303 -952741918 -658897502 -568895057 -858597368 128602327 -373866273 -197757804 -820327437 314535547 -892018056 -675059687 46069697 -497437388 -633749338 -165254025 -360451391 -518076008 -607291127 -506112345 -359933636 -340176069 87578501 -311947047 -350967065 -196373663 -49017...
output:
3424012007 3424012007 3424012007 3424012007 3424012007 3424012007 3424012007 3424012007 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 3432522299 343...
result:
ok 99620 lines
Subtask #14:
score: 5
Accepted
Test #18:
score: 5
Accepted
time: 107ms
memory: 35284kb
input:
93028 91818 -295735337 -564744068 -902605531 62391852 -365321307 -603557247 -717081598 162329592 -971363607 247538774 -216804827 -289183462 -770010287 -248152826 -606594806 -23136252 -879560984 -602010879 93750090 -229236489 -647166389 -320819399 -527809250 -999279828 -143001985 -227646820 -49727247...
output:
1903996022 2730626954 2730626954 2730626954 2730626954 2730626954 2730626954 2514281855 2435627856 1675159444 2730626954 2136750003 2488717432 2730626954 2514281855 283119864 2730626954 2730626954 1903996022 2435627856 2488717432 2488717432 6681582669844 2043020481 2488717432 2221716936 584477738820...
result:
ok 45798 lines
Subtask #15:
score: 5
Accepted
Test #19:
score: 5
Accepted
time: 118ms
memory: 35332kb
input:
91507 95839 -23664684 -962845837 -26368215 326675641 -724479 499137961 -879329828 -484112881 -891925211 -24962093 291998659 -444033146 -469035647 215328625 78544430 235825511 -873452291 367590693 -588338012 -64562533 243308218 -90161552 107801329 -540773420 -957858728 -963156371 456254393 -455576987...
output:
1784552270 3394268345 2175108698 3394268345 2087565982 2020894702 2087565982 2175108698 2175108698 2175108698 2020894702 2175108698 2044820932 2087565982 2012110730 2175108698 2175108698 2175108698 3394268345 2175108698 2175108698 2175108698 1941396248 2175108698 2044820932 2087565982 1650947749 206...
result:
ok 48301 lines
Subtask #16:
score: 5
Accepted
Test #20:
score: 5
Accepted
time: 207ms
memory: 35288kb
input:
94402 181505 -575507596 154582735 -580773807 -76942222 -218416229 -420520457 -603882856 -579269638 -968806749 -330938819 -594039411 -853624581 12356239 -335972976 -715519332 -115758740 -139424484 145442017 -586731895 -524655417 62044280 447562515 112543550 286412994 -755863775 -964258126 258612618 -...
output:
2156322198 1515475393 1897346487 1515475393 2277939806 1515475393 2717536602 2717536602 2717536602 27614635955903 2717536602 18645356485580 8990685919569 1595703981 9155350913769 21686718928454 25817801676867 7206079338506 27614635955903 27614635955903 6101177227424 685555259186 4372404479324 110325...
result:
ok 90787 lines
Subtask #17:
score: 5
Accepted
Test #21:
score: 5
Accepted
time: 214ms
memory: 35260kb
input:
97097 197748 -39532660 72924140 -860212972 266724148 -102927196 -536320064 -542895316 -6951259 -451165977 -563012023 -878017150 234956088 -821084308 70082632 103670556 -550194976 5890742 -374521897 -291211030 -189582599 -532780350 153646292 481408375 -522692696 4914802 144236997 -554911116 209552098...
output:
2374171709 2152295655 2773590811 2773590811 2509505436 2509505436 2509505436 1539073381 2152295655 2255388437 2773590811 2773590811 2773590811 2773590811 2773590811 2773590811 2773590811 2136488417 2070174613 2152295655 2255388437 1182752799071 392767604868 2145508281 2255388437 1849117227563 307380...
result:
ok 98140 lines
Subtask #18:
score: 5
Accepted
Test #22:
score: 5
Accepted
time: 218ms
memory: 35352kb
input:
100000 200000 124057764 -95019391 -978000572 221124832 352671144 -189215640 -621389420 -576096799 -860592121 282165011 443560050 4236897 -184072665 -157472860 451941374 -94913773 -40873747 6340470 -178064909 7793037 -811205774 260938388 129013318 -867099913 -258095930 110791678 139837296 -88254587 -...
output:
2850239691 1721346319 2152894836 2850239691 2679459632 2679459632 1721346319 2850239691 2679459632 2275028400 2679459632 2275028400 2679459632 2850239691 2399788064 1119450722729 2165504287219 836809904944 1452245368471 2165504287219 933050792807 1122750661341 42372866911 2051516615745 360355907408 ...
result:
ok 100482 lines
Subtask #19:
score: 5
Accepted
Test #23:
score: 5
Accepted
time: 230ms
memory: 35292kb
input:
100000 200000 -613945542 -776631594 -426750433 204865476 -956716144 289199620 -415317595 -88687071 -31304858 341801980 -657704863 -153593964 -334118199 -544077510 -801376065 -371865322 -829707245 -144589260 -231246860 -393207796 -260603663 195684150 118550317 -165300622 -770784867 -315971863 -518967...
output:
3010106070 1721382511 2080111992 1721780219697 245647561802 3010106070 3010106070 126566174835 765746312629 724672088 1402429579739 307173232334 3010106070 1524458421267 3010106070 3010106070 232412828201 1079459975758 1318583080962 2080111992 1245016746743 1919654476 651456321680 1721780219697 7488...
result:
ok 99875 lines
Subtask #20:
score: 5
Accepted
Test #24:
score: 5
Accepted
time: 244ms
memory: 35308kb
input:
100000 200000 -839752687 193465364 -320699181 364320507 491503148 58174453 -204127703 -818328812 -374166865 -186497314 -99589760 355057503 107437758 101726988 341975032 -881462802 272573187 -493611511 27393952 60635930 94215380 64708383 -472618291 -712265364 -520878214 -426679966 347269993 52124326 ...
output:
1982457074 2200495086 2149209979 2290312575 2290312575 2678047382 131719771584 1969960056 240555150294 250748916508 417971507767 1247489149 2678047382 2380156438 7075091015 134765482317 427720682169 2237836949 233166989242 72785108220 2080852682638 98932564975 4842595205434 4162051605566 28891704480...
result:
ok 99958 lines
Test #25:
score: 5
Accepted
time: 217ms
memory: 35236kb
input:
100000 200000 134871238 -415283527 -358589665 -806499349 -69725353 -35814483 -536665100 -561976452 -572249224 -457765505 -96499544 -756960909 -20492358 -106103513 -455845606 41378394 232236940 -735228211 -565972967 -532124056 -765950616 -842935690 -650854096 -425329837 -496960306 276082248 -58300019...
output:
1786241371 1941580703 2142485427 4423722324 4396407325 3226794156784 29286695703796 4423722324 4029824508 4423722324 4029824508 1916839166773 4423722324 11002010871688 16461022002877 29286695703796 29286695703796 2933226271 29286695703796 25139747743641 29286695703796 4029824508 29286695703796 12895...
result:
ok 99731 lines
Extra Test:
score: 0
Extra Test Passed