結果
問題 | No.2432 Flip and Move |
ユーザー | 👑 potato167 |
提出日時 | 2023-08-15 22:46:37 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 197 ms / 2,000 ms |
コード長 | 458 bytes |
コンパイル時間 | 3,123 ms |
コンパイル使用メモリ | 206,328 KB |
実行使用メモリ | 73,472 KB |
最終ジャッジ日時 | 2024-11-28 04:19:21 |
合計ジャッジ時間 | 6,409 ms |
ジャッジサーバーID (参考情報) |
judge4 / 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"; } }