#include <bits/stdc++.h> using namespace std; #define mp make_pair #define ff first #define ss second #define eb emplace_back typedef long long int ll; inline void readUI(int *i) { register int t=0; register char z=getchar_unlocked(); while (z<'0' && '9'<z) { z=getchar_unlocked(); } while ('0'<=z && z<='9') { t=(t<<3)+(t<<1)+z-'0'; z=getchar_unlocked(); } *i=t; } #define debug if(1) int n, a, ile; int main() { readUI(&n); for (int i=1; i<=n; ++i) { readUI(&a); if (a==1) { ++ile; } } ile=min(ile, 2); printf ("%d\n2\n1 2", 2-ile); return 0; }
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #include <bits/stdc++.h> using namespace std; #define mp make_pair #define ff first #define ss second #define eb emplace_back typedef long long int ll; inline void readUI(int *i) { register int t=0; register char z=getchar_unlocked(); while (z<'0' && '9'<z) { z=getchar_unlocked(); } while ('0'<=z && z<='9') { t=(t<<3)+(t<<1)+z-'0'; z=getchar_unlocked(); } *i=t; } #define debug if(1) int n, a, ile; int main() { readUI(&n); for (int i=1; i<=n; ++i) { readUI(&a); if (a==1) { ++ile; } } ile=min(ile, 2); printf ("%d\n2\n1 2", 2-ile); return 0; } |