Task: | Kyselyt |
Sender: | qalle |
Submission time: | 2020-10-18 22:23:46 +0300 |
Language: | Python3 (CPython3) |
Status: | READY |
Result: | 12 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 12 |
#2 | TIME LIMIT EXCEEDED | 0 |
#3 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.03 s | 1, 2, 3 | details |
#2 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#3 | RUNTIME ERROR | 0.04 s | 3 | details |
#4 | RUNTIME ERROR | 0.04 s | 3 | details |
#5 | RUNTIME ERROR | 0.04 s | 3 | details |
Code
import sys (arrayLen, queryCnt) = sys.stdin.readline().rstrip().split(" ") arrayLen = int(arrayLen, 10) queryCnt = int(queryCnt, 10) array = bytes(int(n, 10) for n in sys.stdin.readline().rstrip().split(" ")) for i in range(queryCnt): (rangeStart, rangeEnd) = sys.stdin.readline().rstrip().split(" ") rangeStart = int(rangeStart, 10) rangeEnd = int(rangeEnd, 10) subArray = array[rangeStart-1:rangeEnd] maxValue = subArray[0] operationCnt = 0 for value in subArray[1:]: operationCnt += max(0, maxValue - value) maxValue = max(maxValue, value) print(operationCnt)
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 100 70 8 72 88 42 78 85 41 23 36 6... |
correct output |
---|
99 0 922 2579 1892 ... |
user output |
---|
99 0 922 2579 1892 ... Truncated |
Test 2
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 200000 98 99 29 92 29 81 100 52 89 80... |
correct output |
---|
1497732 2810356 9532632 6655773 5403513 ... |
user output |
---|
(empty) |
Test 3
Group: 3
Verdict: RUNTIME ERROR
input |
---|
200000 200000 818377786 934884634 816080381 ... |
correct output |
---|
86877225712611 94684086875470 92703793485296 38149694892093 61948503092286 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 7, in <module> array =...
Test 4
Group: 3
Verdict: RUNTIME ERROR
input |
---|
200000 200000 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
correct output |
---|
0 0 0 0 0 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 7, in <module> array =...
Test 5
Group: 3
Verdict: RUNTIME ERROR
input |
---|
200000 200000 200000 199999 199998 199997 19... |
correct output |
---|
15920862903 3193483321 18874982071 4846348926 3970697055 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 7, in <module> array =...