# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
746570 |
2023-05-22T19:43:56 Z |
pascal |
Addk (eJOI21_addk) |
C++14 |
|
27 ms |
468 KB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
for (int i = 0; i < T; i++)
{
int N;
cin >> N;
int A[N];
for (int i = 0; i < N; i++)
{
cin >> A[i];
}
int out[N] = {0};
for (int deb = 0; deb < N; deb++)
{
bitset<50000> S;
S[0] = true;
int somme = 0;
for (int fin = deb; fin < N; fin++)
{
somme += A[fin];
S = S | (S << A[fin]);
if (somme % 2 == 1 || !S[somme / 2])
out[fin - deb] = 1;
}
}
int nb = 0;
for (int i = 0; i < N; i++)
if (out[i] == 0)
nb++;
cout << nb;
for (int i = 0; i < N; i++)
if (out[i] == 0)
cout << " " << i + 1;
cout << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
27 ms |
316 KB |
Execution killed with signal 7 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |