#include <bits/stdc++.h> #include <random> #include <ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; using namespace std; #define ff first #define dd second #define mp make_pair #define lld long long #define pb emplace_back #define sz size() #define For(i,s,a) for(int i=(int)s;i<(int)a;++i) #define pii pair<int,int> #define pll pair<lld,lld> #define rpt(S,it) for(auto it=S.begin();it!=S.end();++it) #define mod (lld)(1e9+7) #define scanf(...) scanf(__VA_ARGS__)?:0 #define P first #define S second #ifdef __WIN32__ #define gcx getchar #elif __linux__ #define gcx getchar_unlocked #endif #define piii pair<pii,pii> //template<typename T> #define T int inline void scan(T *i) { register T t=0; register char z='a'; register bool neg=0; while(z<'0' || z>'9'){if(z=='-')neg^=1; z=gcx();} while(z>='0' && z<='9') { t=(t<<3ll)+(t<<1ll)+z-'0'; z=gcx(); } if(neg)t=~(t-1); *i=t; } int c[1000001]; int main() { int a; scanf("%d", &a); For(i,0,a) scanf("%d", &c[i]); sort(c,c+a); if(c[0]==1 && c[1]==1) { puts("0\n2\n1 2"); } else if(c[0]==1) { puts("1\n2\n1 2"); } else puts("2\n2\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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #include <bits/stdc++.h> #include <random> #include <ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; using namespace std; #define ff first #define dd second #define mp make_pair #define lld long long #define pb emplace_back #define sz size() #define For(i,s,a) for(int i=(int)s;i<(int)a;++i) #define pii pair<int,int> #define pll pair<lld,lld> #define rpt(S,it) for(auto it=S.begin();it!=S.end();++it) #define mod (lld)(1e9+7) #define scanf(...) scanf(__VA_ARGS__)?:0 #define P first #define S second #ifdef __WIN32__ #define gcx getchar #elif __linux__ #define gcx getchar_unlocked #endif #define piii pair<pii,pii> //template<typename T> #define T int inline void scan(T *i) { register T t=0; register char z='a'; register bool neg=0; while(z<'0' || z>'9'){if(z=='-')neg^=1; z=gcx();} while(z>='0' && z<='9') { t=(t<<3ll)+(t<<1ll)+z-'0'; z=gcx(); } if(neg)t=~(t-1); *i=t; } int c[1000001]; int main() { int a; scanf("%d", &a); For(i,0,a) scanf("%d", &c[i]); sort(c,c+a); if(c[0]==1 && c[1]==1) { puts("0\n2\n1 2"); } else if(c[0]==1) { puts("1\n2\n1 2"); } else puts("2\n2\n1 2"); } |