Submission details
Task:Bank Account
Sender:stem_boys
Submission time:2020-10-03 15:59:28 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#20.08 sdetails
#30.08 sdetails
#40.08 sdetails
#50.08 sdetails
#60.08 sdetails
#70.08 sdetails
#80.08 sdetails
#90.08 sdetails
#100.08 sdetails
#110.08 sdetails
#120.08 sdetails
#130.08 sdetails
#140.08 sdetails
#150.08 sdetails
#160.08 sdetails
#170.08 sdetails
#180.08 sdetails
#190.08 sdetails
#200.08 sdetails

Code


def main() :
    [_,q] = [int(i) for i in input().split(' ')]
    x = [int(i) for i in input().split(' ')]
    for _ in range(q) :
        [a,b] = [int(i) for i in input().split(' ')]
        print(sum(x[a-1:b]))
    pass

if __name__ == "__main__":
    main()

Test details

Test 1

Verdict: ACCEPTED

input
6 10
10 -5 -5 100 50 -100
1 6
1 2
5 6
...

correct output
50
5
-50
50
100
...

user output
50
5
-50
50
100
...

Test 2

Verdict:

input
10000 10000
72 48 15 44 -79 2 -22 -25 -50 ...

correct output
161
-889
2925
4520
6457
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 3

Verdict:

input
10000 10000
26 84 89 52 34 -90 -95 9 -49 -...

correct output
2768
1651
4233
4302
1491
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 4

Verdict:

input
10000 10000
19 16 81 -48 86 -60 11 -73 16 ...

correct output
364
1186
4989
982
-202
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 5

Verdict:

input
10000 10000
89 -77 57 -6 40 76 -24 -53 12 ...

correct output
4912
5454
4111
1103
-909
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 6

Verdict:

input
10000 10000
99 -69 0 68 43 43 19 31 14 -70...

correct output
6277
540
1910
4271
274
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 7

Verdict:

input
10000 10000
33 -12 79 -88 47 94 23 87 66 -...

correct output
548
2133
333
3126
-2552
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 8

Verdict:

input
10000 10000
19 -15 42 -37 9 67 -34 63 9 -8...

correct output
641
1767
701
-110
-29
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 9

Verdict:

input
10000 10000
23 -1 96 68 -31 42 63 64 -70 0...

correct output
2827
2346
-251
1317
623
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 10

Verdict:

input
10000 10000
61 52 -81 -23 22 -18 100 -25 3...

correct output
1808
15485
5431
-679
721
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 11

Verdict:

input
10000 10000
81 -37 53 25 66 2 -98 -71 89 1...

correct output
917
2690
3430
4362
-613
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 12

Verdict:

input
10000 10000
28 -12 -8 66 39 25 75 -61 42 9...

correct output
-109
-1006
2695
1160
2195
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 13

Verdict:

input
10000 10000
67 -29 9 88 -86 -8 9 51 38 71 ...

correct output
445
-586
4211
8573
1794
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 14

Verdict:

input
10000 10000
24 87 93 82 -81 -33 -48 -5 -36...

correct output
541
5077
-213
793
3549
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 15

Verdict:

input
10000 10000
47 94 14 -28 96 86 -5 74 -8 82...

correct output
732
1162
-918
-344
1692
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 16

Verdict:

input
10000 10000
10 77 34 -44 36 5 -43 -75 59 -...

correct output
7052
1043
213
6427
189
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 17

Verdict:

input
10000 10000
46 -26 11 91 49 78 94 56 -16 -...

correct output
-101
342
774
158
1409
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 18

Verdict:

input
10000 10000
82 -57 -1 91 93 -4 -58 88 73 -...

correct output
1653
3419
2765
1722
695
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 19

Verdict:

input
10000 10000
52 47 66 88 1 -64 -25 55 98 -8...

correct output
229
674
492
519
6864
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''

Test 20

Verdict:

input
10000 10000
78 -37 65 -66 -1 15 39 25 2 -3...

correct output
-1669
856
-1335
-507
-103
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 12, in <module>
    main()
  File "input/code.py", line 5, in main
    x = [int(i) for i in input().split(' ')]
  File "input/code.py", line 5, in <listcomp>
    x = [int(i) for i in input().split(' ')]
ValueError: invalid literal for int() with base 10: ''