Task: | Subarray Sums II |
Sender: | Nallue |
Submission time: | 2024-11-23 14:53:36 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | TIME LIMIT EXCEEDED | -- | details |
#6 | TIME LIMIT EXCEEDED | -- | details |
#7 | TIME LIMIT EXCEEDED | -- | details |
#8 | TIME LIMIT EXCEEDED | -- | details |
#9 | TIME LIMIT EXCEEDED | -- | details |
#10 | TIME LIMIT EXCEEDED | -- | details |
#11 | TIME LIMIT EXCEEDED | -- | details |
#12 | TIME LIMIT EXCEEDED | -- | details |
#13 | TIME LIMIT EXCEEDED | -- | details |
#14 | TIME LIMIT EXCEEDED | -- | details |
#15 | TIME LIMIT EXCEEDED | -- | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | WRONG ANSWER | 0.00 s | details |
#18 | TIME LIMIT EXCEEDED | -- | details |
#19 | TIME LIMIT EXCEEDED | -- | details |
#20 | TIME LIMIT EXCEEDED | -- | details |
#21 | TIME LIMIT EXCEEDED | -- | details |
#22 | TIME LIMIT EXCEEDED | -- | details |
#23 | TIME LIMIT EXCEEDED | -- | details |
#24 | ACCEPTED | 0.01 s | details |
#25 | TIME LIMIT EXCEEDED | -- | details |
#26 | TIME LIMIT EXCEEDED | -- | details |
#27 | TIME LIMIT EXCEEDED | -- | details |
#28 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <iostream> #include <vector> using namespace std; int main(){ int a, obj; cin >> a >> obj; vector<int> sum(a); cin >> sum[0]; for(int i=1;i<a; i++){ int temp; cin >> temp; sum[i] = sum[i-1] + temp; } int cont = 0; for(int i=0;i<a; i++){ for(int l=i; l<a; l++){ if(i!=0){ if((sum[l]-sum[i-1])==obj)++cont; } else{ if(sum[l]==obj)++cont; } } } cout << cont << endl; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
100 50 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
correct output |
---|
51 |
user output |
---|
51 |
Test 2
Verdict: ACCEPTED
input |
---|
100 1000000000 1000000000 1000000000 10000000... |
correct output |
---|
100 |
user output |
---|
100 |
Test 3
Verdict: ACCEPTED
input |
---|
100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
correct output |
---|
5050 |
user output |
---|
5050 |
Test 4
Verdict: ACCEPTED
input |
---|
100 4 2 1 -3 2 -7 7 -2 6 9 -4 10 -6 ... |
correct output |
---|
53 |
user output |
---|
53 |
Test 5
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
correct output |
---|
100001 |
user output |
---|
(empty) |
Test 6
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 1000000000 1000000000 1000000000 10000000... |
correct output |
---|
200000 |
user output |
---|
(empty) |
Test 7
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
correct output |
---|
20000100000 |
user output |
---|
(empty) |
Test 8
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 39 44 -62 -3 23 11 -68 42 69 -22 ... |
correct output |
---|
903601 |
user output |
---|
(empty) |
Test 9
Verdict: TIME LIMIT EXCEEDED
input |
---|
131072 199999 199999 199999 199999 199999 19... |
correct output |
---|
131072 |
user output |
---|
(empty) |
Test 10
Verdict: TIME LIMIT EXCEEDED
input |
---|
131072 107897 107897 107897 107897 107897 10... |
correct output |
---|
131072 |
user output |
---|
(empty) |
Test 11
Verdict: TIME LIMIT EXCEEDED
input |
---|
131072 126271 126271 126271 126271 126271 12... |
correct output |
---|
131072 |
user output |
---|
(empty) |
Test 12
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 107897 107897 107897 107897 107897 10... |
correct output |
---|
199999 |
user output |
---|
(empty) |
Test 13
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 100000 1056323 1056323 1056323 105632... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 14
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 100000 2144977 2144977 2144977 214497... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 15
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 100000 65536 65536 65536 65536 65536 ... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 16
Verdict: ACCEPTED
input |
---|
5 0 0 0 0 0 0 |
correct output |
---|
15 |
user output |
---|
15 |
Test 17
Verdict: WRONG ANSWER
input |
---|
20 536870912 268435456 268435456 268435456 ... |
correct output |
---|
19 |
user output |
---|
22 |
Test 18
Verdict: TIME LIMIT EXCEEDED
input |
---|
131072 136607 136607 136607 136607 136607 13... |
correct output |
---|
131072 |
user output |
---|
(empty) |
Test 19
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 562841 562841 562841 562841 562841 56... |
correct output |
---|
200000 |
user output |
---|
(empty) |
Test 20
Verdict: TIME LIMIT EXCEEDED
input |
---|
107897 107897 107897 107897 107897 107897 10... |
correct output |
---|
107897 |
user output |
---|
(empty) |
Test 21
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 202409 101204 101205 101204 101205 10... |
correct output |
---|
199998 |
user output |
---|
(empty) |
Test 22
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 202409 138630 138631 138630 138631 13... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 23
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 10273 410857 410857 410857 410857 41... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 24
Verdict: ACCEPTED
input |
---|
5 2 1 -1 1 -1 2 |
correct output |
---|
3 |
user output |
---|
3 |
Test 25
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 1 1048577 -1048570 29 145 725 36... |
correct output |
---|
104671 |
user output |
---|
(empty) |
Test 26
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 1 1048577 -1048571 25 125 625 31... |
correct output |
---|
104859 |
user output |
---|
(empty) |
Test 27
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 0 5334500 -3502392 3421268 -2064... |
correct output |
---|
6341575890 |
user output |
---|
(empty) |
Test 28
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 0 172933 172933 172933 172933 17... |
correct output |
---|
0 |
user output |
---|
(empty) |