#include <cstdio> // Marcin Regdos | Potyczki Algorytmiczne 2018 | Runda 1A POD Podrzewo using namespace std; int main(){ int leafs = 0, result = 0, n = 0 ; scanf ("%d", &n); for (int i = 0; i< n && leafs < 2;++i) { int a; scanf("%d", &a); if (a == 1) ++leafs; } result = 2 - leafs; printf ("%d\n2\n", result); printf ("1 2\n"); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <cstdio> // Marcin Regdos | Potyczki Algorytmiczne 2018 | Runda 1A POD Podrzewo using namespace std; int main(){ int leafs = 0, result = 0, n = 0 ; scanf ("%d", &n); for (int i = 0; i< n && leafs < 2;++i) { int a; scanf("%d", &a); if (a == 1) ++leafs; } result = 2 - leafs; printf ("%d\n2\n", result); printf ("1 2\n"); return 0; } |