#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef unsigned long long ull;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string role;
ull n_max;
int t;
if (!(cin >> role >> n_max >> t)) return 0;
if (role == "Algosia") {
while (t--) {
ull ni;
cin >> ni;
vector<string> M(10, string(10, '0'));
for (int i = 0; i < 10; i++) {
for (int j = 0; j < i; j++) M[i][j] = '1';
}
ull temp = ni;
for (int i = 0; i < 10; i++) {
for (int j = i + 1; j < 10; j++) {
if (temp & 1) M[i][j] = '1';
temp >>= 1;
}
}
for (int i = 0; i < 10; i++) {
cout << M[i] << "\n";
}
cout << flush;
}
} else {
while (t--) {
vector<string> M(10);
for (int i = 0; i < 10; i++) cin >> M[i];
vector<int> p(10);
for(int i=0; i<10; i++) p[i] = i;
ull result = 0;
}
}
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 | #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; typedef unsigned long long ull; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string role; ull n_max; int t; if (!(cin >> role >> n_max >> t)) return 0; if (role == "Algosia") { while (t--) { ull ni; cin >> ni; vector<string> M(10, string(10, '0')); for (int i = 0; i < 10; i++) { for (int j = 0; j < i; j++) M[i][j] = '1'; } ull temp = ni; for (int i = 0; i < 10; i++) { for (int j = i + 1; j < 10; j++) { if (temp & 1) M[i][j] = '1'; temp >>= 1; } } for (int i = 0; i < 10; i++) { cout << M[i] << "\n"; } cout << flush; } } else { while (t--) { vector<string> M(10); for (int i = 0; i < 10; i++) cin >> M[i]; vector<int> p(10); for(int i=0; i<10; i++) p[i] = i; ull result = 0; } } return 0; } |
English