#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5+69; int c1, n; int main() { scanf("%d", &n); while (n--) { int tmp; scanf("%d", &tmp); if (tmp == 1) c1++; } printf("%d\n2\n1 2\n", 2-min(c1,2)); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <bits/stdc++.h> using namespace std; const int MAXN = 2e5+69; int c1, n; int main() { scanf("%d", &n); while (n--) { int tmp; scanf("%d", &tmp); if (tmp == 1) c1++; } printf("%d\n2\n1 2\n", 2-min(c1,2)); } |