#include <cstdio> #include <algorithm> int main() { int n, tmp; scanf("%d", &n); int ones = 0; for(int i = 0; i < n; ++i) scanf("%d", &tmp), ones += (tmp == 1); printf("%d\n", std::max(2-ones, 0)); printf("2\n"); printf("1 2\n"); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <cstdio> #include <algorithm> int main() { int n, tmp; scanf("%d", &n); int ones = 0; for(int i = 0; i < n; ++i) scanf("%d", &tmp), ones += (tmp == 1); printf("%d\n", std::max(2-ones, 0)); printf("2\n"); printf("1 2\n"); return 0; } |