結果
問題 | No.2432 Flip and Move |
ユーザー |
![]() |
提出日時 | 2023-08-11 21:54:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 197 ms / 2,000 ms |
コード長 | 561 bytes |
コンパイル時間 | 2,073 ms |
コンパイル使用メモリ | 197,632 KB |
最終ジャッジ日時 | 2025-02-16 01:19:21 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll h, w, k; cin >> h >> w >> k; k %= 8*h*w; vector<vector<int>> a(h,vector<int>(w,0)); for (ll i = 0; i < k; i++){ ll ix = i % (2*h); ll iy = i % (2*w); ll x = (ix < h ? ix : 2*h-1-ix); ll y = (iy < w ? iy : 2*w-1-iy); a[x][y] ^= 1; } for (ll i = 0; i < h; i++){ string ans = ""; for (ll j = 0; j < w; j++){ ans += (a[i][j] == 0 ? '.' : '#'); } cout << ans << '\n'; } }