//#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi pair<int,int> #define pd pair<ld,ld> #define ft first #define sd second #define st first #define nd second #define mp make_pair #define pb push_back #define eb emplace_back #define FOR(i,a,b) for(int i=(a); i<=(b);i++) #define F(i,a,b) FOR(i,(a),(b)-1) #define REV(i,a,b) for(int i=(a); i>=(b);i--) #define VI vector<int> #define VPI vector<pi> #define VPD vector<pd> #define PI 3.14159265 #define all(x) (x).begin(), (x).end() #define sz(a) (int)((a).size()) #define int long long template<class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";} template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) { while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<","; _dbg(sdbg+1, a...); } #define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__) const long long inf = 1000*1000*1000+7; const long long INF = LLONG_MAX; const long long MOD = inf; const long long P = 997; const long long N = 1e6+10, base=1<<19; int tab[N]; void solve(){ int n; cin>>n; F(i,0,n) cin>>tab[i]; sort(tab,tab+n); if(tab[0] == 1 && tab[1] == 1) cout<<"0\n2\n1 2\n"; else if(tab[0] == 1) cout<<"1\n2\n1 2\n"; else cout<<"2\n2\n1 2\n"; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cerr.tie(0); cout<<setprecision(9)<<fixed; cerr<<setprecision(6)<<fixed; int test = 1; // cin>>test; while(test--){ solve(); } } /* 2 1 5 0 5 2 11 */
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 65 66 67 68 69 70 71 72 | //#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi pair<int,int> #define pd pair<ld,ld> #define ft first #define sd second #define st first #define nd second #define mp make_pair #define pb push_back #define eb emplace_back #define FOR(i,a,b) for(int i=(a); i<=(b);i++) #define F(i,a,b) FOR(i,(a),(b)-1) #define REV(i,a,b) for(int i=(a); i>=(b);i--) #define VI vector<int> #define VPI vector<pi> #define VPD vector<pd> #define PI 3.14159265 #define all(x) (x).begin(), (x).end() #define sz(a) (int)((a).size()) #define int long long template<class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";} template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) { while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<","; _dbg(sdbg+1, a...); } #define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__) const long long inf = 1000*1000*1000+7; const long long INF = LLONG_MAX; const long long MOD = inf; const long long P = 997; const long long N = 1e6+10, base=1<<19; int tab[N]; void solve(){ int n; cin>>n; F(i,0,n) cin>>tab[i]; sort(tab,tab+n); if(tab[0] == 1 && tab[1] == 1) cout<<"0\n2\n1 2\n"; else if(tab[0] == 1) cout<<"1\n2\n1 2\n"; else cout<<"2\n2\n1 2\n"; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cerr.tie(0); cout<<setprecision(9)<<fixed; cerr<<setprecision(6)<<fixed; int test = 1; // cin>>test; while(test--){ solve(); } } /* 2 1 5 0 5 2 11 */ |