Submission #1170718

#TimeUsernameProblemLanguageResultExecution timeMemory
1170718browntoadCostinland (info1cup19_costinland)C++20
20 / 100
0 ms328 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n+1)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define RREP1(i, n) for (int i = (n); i >= 1; i--)
#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)((x).size())

#ifdef TOAD
#define IOS()
#else
#define IOS() ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#endif

const ll maxn = 505;
const ll mod = 1e9+7;
const ll inf = 1ll<<60;

int K;
char arr[maxn][maxn];
signed main(){
	IOS();
	cin>>K;
	if (K <= 19){
		K--;
		REP(i, 6) REP(j, 6) arr[i][j] = '.';
		REP1(i, 4) {
			arr[5][i] = 'r';
			arr[i][5] = 'd';
		}

		RREP1(i, 4){
			for (int j = 5; j >= 2; j--){
				if (j == 5) j = 1;
				if (K > 0){
					arr[i][j] = 'X';
					if (j > 1 && i < 4) arr[i][j] = 'd';
					K--;
				}
				if (j == 1) j = 5;

			}
		}
		if (arr[1][1] == '.'){
			arr[1][1] = 'd';
		}
		if (K >= 1){
			arr[1][2] = 'X';
			arr[1][3] = 'r';
			arr[1][4] = (K==1?'r':'d');
		}

		cout<<5<<' '<<5<<endl;
		REP1(i, 5){
			REP1(j, 5){
				cout<<arr[i][j];
			}
			cout<<endl;

		}
	}

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...