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 88 89 90 91 92 93 94 #include #include #include long long pot2(long long p) { if (p == 0) return 1; if (p == 1) return 2; if (p%2==1) return pot2((p-1)/2)*pot2((p-1)/2)*2; else return pot2(p/2)*pot2(p/2); //return 2 << ((long long)p-1); } int countSetBits(long long n) { int count = 0; while (n) { count += n & 1; n >>= 1; } return count; } int main() { short n; // Liczba zestawow long long n_2; short a[40]; short z[40][40]; short pary0 = 0; short pary1 = 0; long long zgrzyt[40*40]; short c_zgrzyt = 0; short xx[40*40]; scanf("%hd",&n); n_2 = 2 << (n-1); //printf("n=%hd n^2=%lld\n",n,n_2); for (int i = 0; i 1) { if (pary0 > 0) printf("0 %hd\n",pary0); else printf("1 %hd\n",pary1); } for (int k = 2; k%lld x=%hd\n",i,x); } } //for (int s = 0; s<30; s++) printf("%hd ",xx[s]); //printf("\n"); short s = 0; while (s<40*40 && xx[s] == 0) s++; printf("%hd %hd\n",s,xx[s]); } return 0; }