結果
| 問題 |
No.2432 Flip and Move
|
| コンテスト | |
| ユーザー |
👑 potato167
|
| 提出日時 | 2023-08-15 22:46:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 167 ms / 2,000 ms |
| コード長 | 458 bytes |
| コンパイル時間 | 1,960 ms |
| コンパイル使用メモリ | 199,136 KB |
| 最終ジャッジ日時 | 2025-02-16 08:32:55 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(p) p.begin(),p.end()
#define rep(i,a,b) for(int i=(int)a;i<(int)b;i++)
int main(){
ll H,W,K;
cin>>H>>W>>K;
K%=(4ll*H*W);
vector S(H,vector<bool>(W));
int x=0,y=0,dx=1,dy=1;
rep(rp,0,K){
S[x][y]=!S[x][y];
if(x+dx==-1||x+dx==H) dx*=-1;
else x+=dx;
if(y+dy==-1||y+dy==W) dy*=-1;
else y+=dy;
}
rep(i,0,H){
rep(j,0,W) cout<<(S[i][j]?"#":".");
cout<<"\n";
}
}
potato167