結果

問題 No.1114 足し算盆に返らず
ユーザー ks2mks2m
提出日時 2020-07-17 21:29:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 1,968 ms
コンパイル使用メモリ 74,568 KB
実行使用メモリ 54,584 KB
最終ジャッジ日時 2024-05-07 07:01:01
合計ジャッジ時間 21,500 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
54,512 KB
testcase_01 AC 168 ms
54,344 KB
testcase_02 AC 165 ms
54,096 KB
testcase_03 AC 154 ms
54,432 KB
testcase_04 AC 163 ms
54,428 KB
testcase_05 AC 149 ms
53,656 KB
testcase_06 AC 158 ms
53,632 KB
testcase_07 AC 156 ms
53,428 KB
testcase_08 AC 157 ms
54,264 KB
testcase_09 AC 149 ms
54,412 KB
testcase_10 AC 152 ms
53,884 KB
testcase_11 AC 123 ms
54,004 KB
testcase_12 AC 155 ms
53,980 KB
testcase_13 AC 159 ms
54,356 KB
testcase_14 AC 146 ms
54,280 KB
testcase_15 AC 146 ms
53,720 KB
testcase_16 AC 150 ms
53,648 KB
testcase_17 AC 158 ms
54,052 KB
testcase_18 AC 143 ms
53,920 KB
testcase_19 AC 147 ms
53,996 KB
testcase_20 AC 164 ms
54,104 KB
testcase_21 AC 146 ms
54,244 KB
testcase_22 AC 107 ms
52,816 KB
testcase_23 AC 111 ms
54,020 KB
testcase_24 AC 118 ms
53,848 KB
testcase_25 AC 119 ms
54,584 KB
testcase_26 AC 126 ms
54,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		StringBuilder sb = new StringBuilder();
		for (int i = 1; i <= n; i+=2) {
			sb.append(i).append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		System.out.println(sb.toString());
	}
}
0