結果

問題 No.2432 Flip and Move
ユーザー noya2noya2
提出日時 2023-08-11 21:54:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 561 bytes
コンパイル時間 2,385 ms
コンパイル使用メモリ 204,776 KB
実行使用メモリ 57,856 KB
最終ジャッジ日時 2024-05-06 02:08:57
合計ジャッジ時間 7,599 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 75 ms
11,136 KB
testcase_03 AC 199 ms
57,856 KB
testcase_04 AC 115 ms
7,424 KB
testcase_05 AC 8 ms
7,424 KB
testcase_06 AC 90 ms
6,400 KB
testcase_07 AC 162 ms
38,656 KB
testcase_08 AC 98 ms
41,796 KB
testcase_09 AC 146 ms
55,920 KB
testcase_10 AC 47 ms
8,192 KB
testcase_11 AC 97 ms
8,832 KB
testcase_12 AC 45 ms
7,424 KB
testcase_13 AC 19 ms
7,552 KB
testcase_14 AC 65 ms
15,468 KB
testcase_15 AC 108 ms
48,232 KB
testcase_16 AC 57 ms
5,376 KB
testcase_17 AC 150 ms
7,040 KB
testcase_18 AC 36 ms
5,376 KB
testcase_19 AC 54 ms
6,272 KB
testcase_20 AC 142 ms
7,296 KB
testcase_21 AC 102 ms
6,016 KB
testcase_22 AC 121 ms
6,272 KB
testcase_23 AC 27 ms
5,376 KB
testcase_24 AC 146 ms
6,784 KB
testcase_25 AC 103 ms
6,144 KB
testcase_26 AC 69 ms
6,656 KB
testcase_27 AC 9 ms
5,376 KB
testcase_28 AC 5 ms
5,376 KB
testcase_29 AC 101 ms
6,016 KB
testcase_30 AC 28 ms
7,168 KB
testcase_31 AC 120 ms
6,144 KB
testcase_32 AC 13 ms
5,376 KB
testcase_33 AC 39 ms
6,912 KB
testcase_34 AC 56 ms
5,376 KB
testcase_35 AC 46 ms
6,016 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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';
    }
}
0