CSES - KILO 2017 5/5 - Results
Submission details
Task:Mega Inversions
Sender:Qianyun Guo
Submission time:2017-10-03 16:41:28 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#10.21 sdetails
#20.19 sdetails
#30.24 sdetails
#40.19 sdetails
#50.22 sdetails
#60.23 sdetails
#70.18 sdetails
#80.22 sdetails
#90.20 sdetails
#100.17 sdetails
#110.19 sdetails
#120.23 sdetails
#130.19 sdetails
#140.19 sdetails
#150.18 sdetails
#160.18 sdetails
#170.20 sdetails
#180.18 sdetails

Code

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

int a[10010];
int n, q;

int main() {
    cin >> n >> q;
    for (int i = 1; i <= n; i++) {
        int x;
        cin >> x;
        a[i] = a[i-1] + x; 
    }
    while (q--) {
        int x, y;
        cin >> x >> y;
        cout << a[y] - a[x-1] << endl;
    }
    
    return 0;
}

Test details

Test 1

Verdict:

input
500000
289384 430887 192778 136916 24...

correct output
3462273770285851

user output
(empty)

Test 2

Verdict:

input
500000
382213 21639 220700 75692 3046...

correct output
3485180959426295

user output
(empty)

Test 3

Verdict:

input
500000
126690 371364 446885 348594 13...

correct output
3477492420887556

user output
(empty)

Test 4

Verdict:

input
500000
42662 481114 312377 69861 7962...

correct output
3475393752560785

user output
(empty)

Test 5

Verdict:

input
500000
87517 398064 349297 387923 451...

correct output
3471906656975056

user output
(empty)

Test 6

Verdict:

input
500000
32451 250738 273961 357671 137...

correct output
3460754378741711

user output
(empty)

Test 7

Verdict:

input
500000
90672 310026 72922 224011 3703...

correct output
3476018102026120

user output
(empty)

Test 8

Verdict:

input
500000
425377 326433 228759 266715 81...

correct output
3465242936420874

user output
(empty)

Test 9

Verdict:

input
500000
23470 483991 430548 458582 278...

correct output
3470073617672348

user output
(empty)

Test 10

Verdict:

input
500000
369724 122728 326689 334480 34...

correct output
3474985893406401

user output
(empty)

Test 11

Verdict:

input
10000
605 9123 24 8124 4758 1782 975...

correct output
27409866438

user output
(empty)

Test 12

Verdict:

input
100000
42 18468 6335 26501 19170 1572...

correct output
27944091731907

user output
(empty)

Test 13

Verdict:

input
100000
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
0

user output
(empty)

Test 14

Verdict:

input
99999
99999 99998 99997 99996 99995 ...

correct output
166656666849999

user output
(empty)

Test 15

Verdict:

input
99998
2 1 4 3 6 5 8 7 10 9 12 11 14 ...

correct output
49997

user output
(empty)

Test 16

Verdict:

input
99997
1 99995 99996 99993 99994 9999...

correct output
166636668399968

user output
(empty)

Test 17

Verdict:

input
100000
32769 32763 32774 32764 32761 ...

correct output
5672756782663

user output
(empty)

Test 18

Verdict:

input
10
10 10 10 10 10 10 10 10 10 9

correct output
0

user output
(empty)