#include <cstdio> #include <algorithm> using namespace std; int main() { int n, a, q = 0;; scanf("%d", &n); while (n--) { scanf("%d", &a); if (a == 1) ++q; } q = min(2, q); printf("%d\n2\n1 2\n", 2 - q); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <cstdio> #include <algorithm> using namespace std; int main() { int n, a, q = 0;; scanf("%d", &n); while (n--) { scanf("%d", &a); if (a == 1) ++q; } q = min(2, q); printf("%d\n2\n1 2\n", 2 - q); return 0; } |