結果

問題 No.1434 Make Maze
ユーザー KKT89KKT89
提出日時 2021-03-22 22:34:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,104 bytes
コンパイル時間 2,040 ms
コンパイル使用メモリ 206,312 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-05-03 11:49:03
合計ジャッジ時間 6,228 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 26 ms
5,376 KB
testcase_03 AC 25 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 8 ms
5,376 KB
testcase_16 AC 4 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 4 ms
5,376 KB
testcase_19 AC 14 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 3 ms
5,376 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 10 ms
5,376 KB
testcase_25 AC 17 ms
5,376 KB
testcase_26 AC 3 ms
5,376 KB
testcase_27 AC 10 ms
5,376 KB
testcase_28 AC 3 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 4 ms
5,376 KB
testcase_31 AC 5 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}


int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int h,w,x; cin >> h >> w >> x;
	vector<vector<char>> c(h,vector<char>(w));
	for(int _=0;_<2;_++){
		if(_){
			swap(h,w);
			vector<vector<char>> cc(h,vector<char>(w));
			swap(c,cc);
		}
		int add=(x-(h-1+w-1));
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				if(i%2==0)c[i][j]='.';
				else c[i][j]='#';
			}
			c[i][0]='.';
		}
		for(int i=0;i+4<h;i+=4){
			for(int j=0;j+2<w;j+=2){
				if(add>=4){
					add-=4;
					c[i+1][j]='#';
					c[i+1][j+2]='.';
				}
			}
		}
		if(add==0){
			if(_){
				swap(h,w);
				vector<vector<char>> cc(h,vector<char>(w));
				for(int i=0;i<h;i++){
					for(int j=0;j<w;j++){
						cc[i][j]=c[j][i];
					}
				}
				swap(c,cc);
			}
			for(int i=0;i<h;i++){
				for(int j=0;j<w;j++){
					printf("%c",c[i][j]);
				}
				printf("\n");
			}
			return 0;
		}
	}
	printf("-1\n");
}
0