This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << "Line(" << __LINE__ << ") -> " << #x << " is " << x << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;
const int INF = 1e9 + 7;
signed main()
{
IO_OP;
ll k;
cin >> k;
if(k <= 19) {
k -= 2;
string a[5] = {
"Xrrrd",
"dXXXd",
"dXX.d",
"dX..d",
"rrrr."
};
if(k >= 16) {
k -= 16;
a[0][1] = a[1][0] = 'X';
}
array<pair<pi, char>, 4> b = {
MP(MP(3, 0), 'r'), // 1
MP(MP(0, 3), 'X'), // 2
MP(MP(0, 2), 'X'), // 4
MP(MP(0, 1), 'X') // 8
};
for(int i = 0; i < 4; i++) {
if(k >> i & 1) {
a[b[i].F.F][b[i].F.S] = b[i].S;
}
}
cout << 5 << ' ' << 5 << '\n';
for(int i = 0; i < 5; i++) {
for(int j = 0; j < 5; j++)
cout << a[i][j];
cout <<'\n';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |