結果

問題 No.501 穴と文字列
ユーザー Mcpu3Mcpu3
提出日時 2018-09-29 19:01:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 387 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 1,921 ms
コンパイル使用メモリ 76,920 KB
実行使用メモリ 50,720 KB
最終ジャッジ日時 2024-04-20 12:55:50
合計ジャッジ時間 6,919 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 353 ms
50,720 KB
testcase_01 AC 351 ms
49,464 KB
testcase_02 AC 109 ms
41,068 KB
testcase_03 AC 115 ms
41,112 KB
testcase_04 AC 113 ms
41,000 KB
testcase_05 AC 95 ms
39,836 KB
testcase_06 AC 113 ms
41,160 KB
testcase_07 AC 114 ms
41,544 KB
testcase_08 AC 103 ms
40,032 KB
testcase_09 AC 116 ms
41,112 KB
testcase_10 AC 112 ms
40,796 KB
testcase_11 AC 110 ms
41,184 KB
testcase_12 AC 116 ms
41,136 KB
testcase_13 AC 114 ms
40,900 KB
testcase_14 AC 127 ms
41,388 KB
testcase_15 AC 110 ms
40,044 KB
testcase_16 AC 117 ms
41,276 KB
testcase_17 AC 121 ms
41,180 KB
testcase_18 AC 371 ms
49,660 KB
testcase_19 AC 387 ms
50,160 KB
testcase_20 AC 370 ms
49,924 KB
testcase_21 AC 350 ms
49,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(), D = sc.nextInt();
        sc.close();
        if (N > D) {
            for (int i = 0; i < D; ++i) System.out.print("A");
            for (int i = 0; i < N - D; ++i) System.out.print("C");
        }
        else {
            for (int i = 0; i < 2 * N - D; ++i) System.out.print("A");
            for (int i = 0; i < D - N; ++i) System.out.print("B");
        }
    }
}
0