結果

問題 No.501 穴と文字列
ユーザー fal_rndfal_rnd
提出日時 2017-04-07 22:29:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 2,176 ms
コンパイル使用メモリ 74,472 KB
実行使用メモリ 54,428 KB
最終ジャッジ日時 2024-05-08 12:25:33
合計ジャッジ時間 6,123 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
54,064 KB
testcase_01 AC 147 ms
54,428 KB
testcase_02 AC 133 ms
54,068 KB
testcase_03 AC 131 ms
54,072 KB
testcase_04 AC 134 ms
53,996 KB
testcase_05 AC 133 ms
53,924 KB
testcase_06 AC 135 ms
53,912 KB
testcase_07 AC 134 ms
54,192 KB
testcase_08 AC 131 ms
53,948 KB
testcase_09 AC 133 ms
53,928 KB
testcase_10 AC 131 ms
53,948 KB
testcase_11 AC 132 ms
54,232 KB
testcase_12 AC 132 ms
54,032 KB
testcase_13 AC 131 ms
53,796 KB
testcase_14 AC 133 ms
54,016 KB
testcase_15 AC 135 ms
54,168 KB
testcase_16 AC 134 ms
53,776 KB
testcase_17 AC 136 ms
54,272 KB
testcase_18 AC 152 ms
54,344 KB
testcase_19 AC 146 ms
54,348 KB
testcase_20 AC 156 ms
54,344 KB
testcase_21 AC 144 ms
54,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	
	static final Scanner s=new Scanner(System.in);
	
	public static void main(String[] __){
		int n=s.nextInt(),d=s.nextInt();
		
		StringBuilder sb=new StringBuilder();
		for(int i=n;i>0;i--)
			sb.append('A');
		
		
		sb.delete(0,Math.abs(n-d));
		if(n<d)
			for(int i=d-n;i>0;i--)
				sb.append('B');
		else
			for(int i=n-d;i>0;i--)
				sb.append('C');
		System.out.println(sb.toString());
	}
}
0