結果
| 問題 |
No.1434 Make Maze
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-22 22:34:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,104 bytes |
| コンパイル時間 | 2,012 ms |
| コンパイル使用メモリ | 200,104 KB |
| 最終ジャッジ日時 | 2025-01-19 21:06:22 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 WA * 1 |
ソースコード
#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");
}