QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#493056#6162. 卡牌游戏pavement100 ✓6ms3700kbC++17455b2024-07-26 19:04:172024-07-26 19:04:19

Judging History

你现在查看的是最新测评结果

  • [2024-07-26 19:04:19]
  • 评测
  • 测评结果:100
  • 用时:6ms
  • 内存:3700kb
  • [2024-07-26 19:04:17]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ii = pair<int, int>;
using iii = tuple<int, int, int>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple

int n;
ll ans, p;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	for (int i = 1, a; i <= n; i++) {
		cin >> a;
		p += a;
		if (i > 1 && p > 0) {
			ans += p;
		}
	}
	cout << ans << '\n';
}

详细


Pretests


Final Tests

Test #1:

score: 5
Accepted
time: 0ms
memory: 3632kb

input:

16
50 -66 9 -64 21 -5 -51 41 -9 -22 86 31 -80 11 39 44

output:

56

result:

ok 1 number(s): "56"

Test #2:

score: 5
Accepted
time: 0ms
memory: 3624kb

input:

16
52 0 51 59 -52 -7 52 89 50 -13 -30 16 -5 -26 82 -96

output:

3060

result:

ok 1 number(s): "3060"

Test #3:

score: 5
Accepted
time: 0ms
memory: 3548kb

input:

16
-71 80 -7 -70 91 -2 -72 -10 -54 -11 -31 -30 -33 22 28 82

output:

55

result:

ok 1 number(s): "55"

Test #4:

score: 5
Accepted
time: 0ms
memory: 3700kb

input:

16
17 37 -78 -82 -5 -69 -94 -94 -43 -87 -97 -76 -36 91 63 59

output:

54

result:

ok 1 number(s): "54"

Test #5:

score: 5
Accepted
time: 0ms
memory: 3676kb

input:

16
77 6 90 75 -37 -5 -41 53 -100 -49 -32 -90 44 -8 0 -28

output:

1528

result:

ok 1 number(s): "1528"

Test #6:

score: 5
Accepted
time: 0ms
memory: 3572kb

input:

16
-38 21 100 94 23 -29 -52 -41 -76 63 72 -58 61 -88 -20 -86

output:

1335

result:

ok 1 number(s): "1335"

Test #7:

score: 5
Accepted
time: 0ms
memory: 3616kb

input:

1000
95 24 -19 45 65 -87 -71 11 60 -88 -85 -100 -43 -19 78 -70 -12 67 38 -78 78 67 38 -56 -2 -55 80 -53 -23 16 -81 -59 -24 -89 63 20 46 71 14 77 -90 92 -13 25 86 15 85 19 16 39 80 4 -23 69 -58 75 -27 -69 3 40 -44 -81 -43 -57 -54 34 -42 36 18 16 4 -42 -26 -99 14 93 -19 66 -78 -99 84 87 85 37 26 66 -4...

output:

518179

result:

ok 1 number(s): "518179"

Test #8:

score: 5
Accepted
time: 0ms
memory: 3616kb

input:

1000
69 -39 35 -65 54 -41 93 -78 -97 84 57 -21 -25 99 94 12 -40 22 100 -70 -59 -83 -55 -45 14 84 -1 96 16 -29 3 -77 68 32 75 -23 68 -57 -35 49 -7 78 8 14 -6 15 -13 74 -70 72 93 52 -45 28 -18 42 40 65 33 -54 -15 29 1 35 0 7 -19 -94 40 50 24 83 81 100 -18 -40 -17 -76 38 -48 -16 78 -86 -69 -77 7 -4 19 ...

output:

733293

result:

ok 1 number(s): "733293"

Test #9:

score: 5
Accepted
time: 0ms
memory: 3616kb

input:

1000
11 44 0 -66 -54 16 16 -45 47 -75 -50 -68 -77 -75 59 -47 -31 -87 89 94 51 -1 -39 -47 90 -12 35 20 23 59 70 -52 -85 62 -67 -48 -31 -71 -49 -67 -84 -9 -2 37 -29 6 -93 39 46 -68 -8 -3 15 50 50 97 -4 100 40 -88 97 -72 39 63 72 -36 -89 21 -22 67 -26 83 -47 -16 89 28 -69 34 68 79 99 46 24 91 -81 -91 -...

output:

64083

result:

ok 1 number(s): "64083"

Test #10:

score: 5
Accepted
time: 0ms
memory: 3568kb

input:

1000
60 32 6 -40 -72 92 -97 83 79 9 15 26 -75 -81 84 34 65 -25 -69 49 20 50 65 49 -77 42 -76 80 72 36 -67 11 28 67 30 54 21 -30 36 32 41 -91 -77 -12 37 82 37 62 21 12 -40 41 -30 -17 -11 -71 -87 -38 -74 34 22 63 -47 91 -62 42 -35 -97 -1 -76 90 10 -59 47 -20 41 73 17 28 23 -62 26 5 16 -12 56 -21 -86 -...

output:

1451629

result:

ok 1 number(s): "1451629"

Test #11:

score: 5
Accepted
time: 0ms
memory: 3632kb

input:

1000
77 1 14 -87 -39 58 -14 -75 -51 44 11 58 32 4 74 15 -99 -62 16 -62 87 -21 -88 50 12 -16 -51 17 81 -65 100 83 -39 -56 7 92 -20 12 -88 -16 40 -29 -38 23 28 -40 38 -59 38 -24 67 -71 44 -16 -95 -84 -21 21 18 -1 88 89 65 30 -1 17 36 27 70 61 64 -90 -84 47 -32 -34 61 63 -47 -34 4 -56 -48 63 -41 96 89 ...

output:

1170814

result:

ok 1 number(s): "1170814"

Test #12:

score: 5
Accepted
time: 0ms
memory: 3548kb

input:

1000
19 -80 43 23 83 91 32 24 -12 -81 -53 79 68 -84 -60 43 42 -30 -94 35 43 73 -41 -37 66 90 -67 61 -4 24 66 -16 -73 -9 51 -100 15 58 55 37 71 -40 -80 65 -63 64 66 -80 74 77 23 32 -69 39 90 -14 49 -35 -11 90 40 -65 -92 -59 37 87 33 17 -62 -35 -52 26 -3 -7 -3 -72 -37 -99 -27 37 29 -84 -52 54 -36 -1 -...

output:

97277

result:

ok 1 number(s): "97277"

Test #13:

score: 5
Accepted
time: 5ms
memory: 3544kb

input:

100000
97673 -1502 -56822 -27179 -99317 19237 -9789 4796 -48830 5050 -19341 19970 98905 -4028 880 -99275 -94787 -88874 -84542 -98785 68150 7354 -9670 14870 35470 -79356 92204 75708 3747 -2463 -14724 49614 33985 -40736 -84054 90576 36864 -81645 74718 -63039 6446 -97380 -2202 -8268 33955 -16204 14605 ...

output:

838641295049

result:

ok 1 number(s): "838641295049"

Test #14:

score: 5
Accepted
time: 5ms
memory: 3628kb

input:

100000
65784 -2708 -68514 23103 -24072 -64176 13849 91539 -82719 -19888 -96360 -47674 -28115 8839 91163 62311 89064 24195 -44813 -72175 -16253 -46132 96275 -65753 -73838 57772 25066 -56529 -74599 -84421 57089 -77553 41211 -83669 -85096 51485 -15351 49041 45116 69792 22256 21291 5541 51120 45920 -476...

output:

224853483172

result:

ok 1 number(s): "224853483172"

Test #15:

score: 5
Accepted
time: 2ms
memory: 3612kb

input:

100000
1584 24081 1585 3585 -72578 -60359 36270 77835 22943 82209 94341 4453 15075 7934 -71227 60691 -91174 66051 59788 -81838 -7989 88545 82706 13552 89555 5778 41849 26620 96483 -36085 -48483 -90418 90332 95441 -91914 -46884 93226 62231 78056 43790 49361 45345 -43394 83811 441 85070 -41466 -27212 ...

output:

343446638187

result:

ok 1 number(s): "343446638187"

Test #16:

score: 5
Accepted
time: 5ms
memory: 3628kb

input:

100000
45858 -6699 61375 -13379 -67566 79925 -68656 -84767 67061 -30378 -14280 60549 -4971 12044 -73313 -25500 -93345 16181 -81059 1096 48069 87508 -82360 -60224 -88063 -19627 819 -89530 25151 14799 -8362 -60782 -97010 -89746 42143 -45248 -97124 41417 -38170 -46653 -97309 89706 -434 78198 74102 -601...

output:

66046792513

result:

ok 1 number(s): "66046792513"

Test #17:

score: 5
Accepted
time: 5ms
memory: 3640kb

input:

100000
-54066 80784 82454 -82089 -78665 63709 94388 -27748 -75082 41723 -32566 -77368 -7885 28184 87261 31389 53813 41560 -86552 -1960 37504 -41810 28246 -15032 -25475 8961 24202 -56282 4255 -26907 54465 -6098 41535 59280 13088 -23470 74035 36372 48330 -49597 53712 -19280 20509 81312 -75080 57280 87...

output:

461462702992

result:

ok 1 number(s): "461462702992"

Test #18:

score: 5
Accepted
time: 6ms
memory: 3644kb

input:

100000
-72970 -2613 1003 79611 82288 -92815 23941 5073 -71547 -36969 81536 -60741 44391 -72589 23201 -31484 78542 3149 12097 76410 71221 82890 5598 21118 99999 47692 3265 77365 -36533 -51647 -64581 -12345 -76766 -44430 -79669 53993 12794 85366 -60221 87788 44604 -6503 -391 74129 1666 -55166 71234 -1...

output:

19444464286

result:

ok 1 number(s): "19444464286"

Test #19:

score: 5
Accepted
time: 5ms
memory: 3556kb

input:

100000
26550 -9037 -72600 38946 -23441 -56175 74206 47720 18274 87296 -34216 19256 55460 6730 -358 -44738 -39717 -24690 -92987 90137 -34990 -19444 -19820 4445 85317 56191 37817 -88366 -84541 -87673 74906 98509 -73058 72363 -62020 -79090 44976 46155 -41007 -70742 67355 68137 -45531 -45172 5246 -40834...

output:

54578542292

result:

ok 1 number(s): "54578542292"

Test #20:

score: 5
Accepted
time: 6ms
memory: 3612kb

input:

100000
77687 -3478 -9572 -14553 -11387 5100 99801 85437 89528 60355 51932 -9581 58112 -33906 -93820 -83351 -86472 -40607 -33584 -98602 -39873 -12256 4130 -21403 66509 -75193 4183 33883 62416 -75220 79796 -90985 -34812 -55264 11004 7341 -92021 3041 64093 -65034 87029 22797 -60634 93745 -22462 -61205 ...

output:

2033105331

result:

ok 1 number(s): "2033105331"

Extra Test:

score: 0
Extra Test Passed