QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#681951 | #6227. 区间和 | freematt_matt | 5 | 2326ms | 5112kb | C++14 | 604b | 2024-10-27 13:08:15 | 2024-10-27 13:08:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll N = 1e5+10;
ll n,q,a[N];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> q;
for(ll i = 1; i <= n; i++) cin>>a[i];
while(q--) {
ll x; cin >> x;
if(x==0) {
ll l, r, x; cin >> l >> r >> x;
for(ll i = l; i <= r; i++) {
a[i]=max(a[i], x);
}
} else {
ll l, r; cin >> l >> r;
ll ans=-1;
ll f[N]={};
f[r]=a[r];
for(ll i=r-1;i>=l;i--) {
f[i]=max(a[i], a[i]+f[i+1]);
ans=max(ans,f[i]);
}
cout<<ans<<"\n";
}
}
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 4388kb
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 426781850 1110244863 1110244863 8394442494 6275824497 -1 1727768442 3992159989 1727768442 4930450100 8781574729 ...
result:
wrong answer 19th lines differ - expected: '478904667', found: '426781850'
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 2ms
memory: 4360kb
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:
wrong answer 43rd lines differ - expected: '471770901', found: '159170703'
Subtask #3:
score: 5
Accepted
Test #4:
score: 5
Accepted
time: 13ms
memory: 4448kb
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: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 12ms
memory: 4400kb
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:
wrong answer 113th lines differ - expected: '309852041', found: '-1'
Subtask #5:
score: 0
Wrong Answer
Test #7:
score: 0
Wrong Answer
time: 2326ms
memory: 5112kb
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:
wrong answer 5926th lines differ - expected: '450834067', found: '245695573'
Subtask #6:
score: 0
Time Limit Exceeded
Test #8:
score: 0
Time Limit Exceeded
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:
Subtask #7:
score: 0
Time Limit Exceeded
Test #9:
score: 0
Time Limit Exceeded
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:
Subtask #8:
score: 0
Time Limit Exceeded
Test #10:
score: 0
Time Limit Exceeded
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:
Subtask #9:
score: 0
Time Limit Exceeded
Test #11:
score: 0
Time Limit Exceeded
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:
Subtask #10:
score: 0
Time Limit Exceeded
Test #13:
score: 0
Time Limit Exceeded
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:
Subtask #11:
score: 0
Time Limit Exceeded
Test #14:
score: 0
Time Limit Exceeded
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:
Subtask #12:
score: 0
Time Limit Exceeded
Test #15:
score: 0
Time Limit Exceeded
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:
Subtask #13:
score: 0
Time Limit Exceeded
Test #16:
score: 0
Time Limit Exceeded
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:
Subtask #14:
score: 0
Time Limit Exceeded
Test #18:
score: 0
Time Limit Exceeded
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:
Subtask #15:
score: 0
Time Limit Exceeded
Test #19:
score: 0
Time Limit Exceeded
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:
Subtask #16:
score: 0
Time Limit Exceeded
Test #20:
score: 0
Time Limit Exceeded
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:
Subtask #17:
score: 0
Time Limit Exceeded
Test #21:
score: 0
Time Limit Exceeded
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:
Subtask #18:
score: 0
Time Limit Exceeded
Test #22:
score: 0
Time Limit Exceeded
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:
Subtask #19:
score: 0
Time Limit Exceeded
Test #23:
score: 0
Time Limit Exceeded
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:
Subtask #20:
score: 0
Time Limit Exceeded
Test #24:
score: 0
Time Limit Exceeded
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...