結果

問題 No.1764 Square
ユーザー ripityripity
提出日時 2021-12-12 20:32:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 515 bytes
コンパイル時間 4,426 ms
コンパイル使用メモリ 72,844 KB
実行使用メモリ 56,216 KB
最終ジャッジ日時 2023-09-28 13:45:06
合計ジャッジ時間 4,921 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,668 KB
testcase_01 AC 127 ms
55,652 KB
testcase_02 AC 127 ms
56,000 KB
testcase_03 AC 124 ms
55,948 KB
testcase_04 AC 126 ms
55,416 KB
testcase_05 AC 124 ms
54,044 KB
testcase_06 AC 127 ms
56,216 KB
testcase_07 AC 124 ms
55,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        String[] q = {"AE","B","C","D"};
        for( int i = 0; i < K; i++ ) {
            String h = q[i%4].substring(0,1);
            String t = q[i%4].substring(1,2);
            q[i%4] = t;
            q[(i+1)%4] += h;
        }
        
        for( String s : q ) {
            System.out.println(s);
        }
        
    }
    
}
0