結果

問題 No.2432 Flip and Move
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-08-24 14:07:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,422 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 2,344 ms
コンパイル使用メモリ 202,416 KB
実行使用メモリ 57,680 KB
最終ジャッジ日時 2023-08-24 14:07:26
合計ジャッジ時間 14,612 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 28 ms
14,788 KB
testcase_03 AC 1,422 ms
57,680 KB
testcase_04 AC 29 ms
7,244 KB
testcase_05 AC 17 ms
7,412 KB
testcase_06 AC 20 ms
6,944 KB
testcase_07 AC 924 ms
38,640 KB
testcase_08 AC 981 ms
41,684 KB
testcase_09 AC 1,348 ms
55,688 KB
testcase_10 AC 20 ms
10,412 KB
testcase_11 AC 26 ms
11,404 KB
testcase_12 AC 16 ms
9,312 KB
testcase_13 AC 16 ms
8,588 KB
testcase_14 AC 315 ms
15,316 KB
testcase_15 AC 1,125 ms
48,104 KB
testcase_16 AC 15 ms
4,664 KB
testcase_17 AC 40 ms
6,884 KB
testcase_18 AC 18 ms
4,416 KB
testcase_19 AC 27 ms
6,084 KB
testcase_20 AC 54 ms
7,192 KB
testcase_21 AC 26 ms
5,948 KB
testcase_22 AC 29 ms
5,984 KB
testcase_23 AC 21 ms
4,384 KB
testcase_24 AC 34 ms
6,600 KB
testcase_25 AC 30 ms
5,896 KB
testcase_26 AC 37 ms
6,408 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 4 ms
4,384 KB
testcase_29 AC 25 ms
5,360 KB
testcase_30 AC 26 ms
7,072 KB
testcase_31 AC 30 ms
6,124 KB
testcase_32 AC 4 ms
4,380 KB
testcase_33 AC 21 ms
7,028 KB
testcase_34 AC 16 ms
4,888 KB
testcase_35 AC 19 ms
5,852 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,384 KB
testcase_38 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){

    ll H, W, K, x=1, y=1, h=1, w=1;
    cin >> H >> W >> K;
    K %= (H*W*8);
    vector<vector<int>> S(H+1, vector<int>(W+1));

    for (int i=0; i<K; i++){
        S[h][w] ^= 1;
        if (1 <= h+x && h+x <= H) h = h+x;
        else x *= -1;
        if (1 <= w+y && w+y <= W) w = w+y;
        else y *= -1;
    }

    for (int i=1; i<=H; i++){
        for (int j=1; j<=W; j++) cout << (S[i][j] ? '#' : '.');
        cout << endl;
    }

    return 0;
}
0