#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int l_jed = 0; int x; for(int i = 0; i < n; i++){ cin >> x; if(x==1) l_jed++; } cout << max(0, 2-l_jed) << "\n"; cout << "2\n1 2\n"; return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int l_jed = 0; int x; for(int i = 0; i < n; i++){ cin >> x; if(x==1) l_jed++; } cout << max(0, 2-l_jed) << "\n"; cout << "2\n1 2\n"; return 0; } |