제출 #746575

#제출 시각아이디문제언어결과실행 시간메모리
746575pascalKpart (eJOI21_kpart)C++14
10 / 100
48 ms312 KiB
#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<2048> 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...