#include<bits/stdc++.h> using namespace std; int main(){ int count1s=0; int N; scanf("%d",&N); for(int i=0;i<N;i++){ int a; scanf("%d",&a); if(a==1) count1s++; } printf("%d\n2\n1 2\n",max(0,2-count1s)); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include<bits/stdc++.h> using namespace std; int main(){ int count1s=0; int N; scanf("%d",&N); for(int i=0;i<N;i++){ int a; scanf("%d",&a); if(a==1) count1s++; } printf("%d\n2\n1 2\n",max(0,2-count1s)); } |