#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <stdio.h>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;++i)
#define FORB(i,b,n) for(int i=b;i<n;++i)
#define REV(i,n) for(int i=n;i>=0;--i)
#define FOREACH(T, it, v) for(T::iterator it = v.begin(); it !=v.end(); ++it)
typedef unsigned int u32;
typedef unsigned int uint;
const int INF = (0u - 11) / 2;
typedef long long ll;
typedef unsigned long long ull;
typedef set<int> SI;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef set<long long> SL;
typedef map<int, int> MII;
int DEBUG = 1;
#define print(STRING,INT) printf("%s = %d\n", STRING, INT)
//#define scanf scanf_s
#define scan(INT) scanf("%d", &INT)
void log(char* S, int a)
{
if (DEBUG)
{
print(S, a);
}
}
void zadanieA()
{
int n, tmp, jedynki = 0;
scan(n);
FOR(i, n)
{
scan(tmp);
if (tmp == 1) { jedynki++; }
}
printf("%d\n2\n1 2\n", jedynki > 1 ? 0 : 2 - jedynki);
}
int main()
{
int t = 1;
//scan(t);
FOR(i, t)
{
zadanieA();
}
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 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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <list> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <stdio.h> #include <cmath> #include <cstdlib> #include <ctime> #include <fstream> using namespace std; #define FOR(i,n) for(int i=0;i<n;++i) #define FORB(i,b,n) for(int i=b;i<n;++i) #define REV(i,n) for(int i=n;i>=0;--i) #define FOREACH(T, it, v) for(T::iterator it = v.begin(); it !=v.end(); ++it) typedef unsigned int u32; typedef unsigned int uint; const int INF = (0u - 11) / 2; typedef long long ll; typedef unsigned long long ull; typedef set<int> SI; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<long long> VL; typedef set<long long> SL; typedef map<int, int> MII; int DEBUG = 1; #define print(STRING,INT) printf("%s = %d\n", STRING, INT) //#define scanf scanf_s #define scan(INT) scanf("%d", &INT) void log(char* S, int a) { if (DEBUG) { print(S, a); } } void zadanieA() { int n, tmp, jedynki = 0; scan(n); FOR(i, n) { scan(tmp); if (tmp == 1) { jedynki++; } } printf("%d\n2\n1 2\n", jedynki > 1 ? 0 : 2 - jedynki); } int main() { int t = 1; //scan(t); FOR(i, t) { zadanieA(); } return 0; } |
English