// DLA JULII.
#include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
int j = 0;
for (int i = 0; i < n; i++) {
int t = 0;
scanf("%d", &t);
if (t == 1)
j += 1;
}
if (j >= 2)
puts("0");
else if (j == 1)
puts("1");
else
puts("2");
puts("2\n1 2");
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | // DLA JULII. #include <bits/stdc++.h> int main() { int n; scanf("%d", &n); int j = 0; for (int i = 0; i < n; i++) { int t = 0; scanf("%d", &t); if (t == 1) j += 1; } if (j >= 2) puts("0"); else if (j == 1) puts("1"); else puts("2"); puts("2\n1 2"); } |
English