結果

問題 No.1764 Square
ユーザー horoyoisawahoroyoisawa
提出日時 2022-01-14 20:10:20
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 30,848 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-30 10:46:30
合計ジャッジ時間 727 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
    int k;
    scanf("%d", &k);
    char queue[4][3] = {
        "AE", "B", "C", "D"
    };

    for(int i=0;i<k;i++) {
        int j = i % 4;
        char ch = queue[j][0];
        queue[j][0] = queue[j][1];
        queue[j][1] = '\0';
        int l = (j + 1) % 4;
        queue[l][1] = ch;
    };

    for(int i=0;i<4;i++) {
        printf("%s\n", queue[i]);
    }

    return 0;
}
0