답안 #341983

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
341983 2020-12-31T22:19:19 Z cheissmart Costinland (info1cup19_costinland) C++14
20 / 100
1 ms 320 KB
#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';
		}
	}
	
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Correct! Your size: 5
2 Correct 1 ms 312 KB Correct! Your size: 5
3 Correct 1 ms 204 KB Correct! Your size: 5
4 Correct 1 ms 204 KB Correct! Your size: 5
5 Correct 1 ms 204 KB Correct! Your size: 5
6 Correct 1 ms 320 KB Correct! Your size: 5
7 Correct 1 ms 316 KB Correct! Your size: 5
8 Correct 1 ms 316 KB Correct! Your size: 5
9 Correct 1 ms 204 KB Correct! Your size: 5
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -