結果

問題 No.1114 足し算盆に返らず
ユーザー ks2mks2m
提出日時 2020-07-17 21:29:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 2,715 ms
コンパイル使用メモリ 71,664 KB
実行使用メモリ 57,036 KB
最終ジャッジ日時 2023-08-19 23:46:28
合計ジャッジ時間 11,956 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
56,208 KB
testcase_01 AC 170 ms
56,224 KB
testcase_02 AC 172 ms
56,028 KB
testcase_03 AC 167 ms
56,636 KB
testcase_04 AC 170 ms
56,396 KB
testcase_05 AC 163 ms
56,180 KB
testcase_06 AC 172 ms
56,764 KB
testcase_07 AC 172 ms
56,556 KB
testcase_08 AC 161 ms
56,772 KB
testcase_09 AC 160 ms
56,384 KB
testcase_10 AC 163 ms
56,280 KB
testcase_11 AC 126 ms
55,932 KB
testcase_12 AC 156 ms
56,408 KB
testcase_13 AC 170 ms
57,036 KB
testcase_14 AC 150 ms
56,304 KB
testcase_15 AC 149 ms
56,116 KB
testcase_16 AC 163 ms
55,832 KB
testcase_17 AC 167 ms
56,188 KB
testcase_18 AC 148 ms
56,060 KB
testcase_19 AC 151 ms
56,484 KB
testcase_20 AC 170 ms
54,800 KB
testcase_21 AC 148 ms
56,272 KB
testcase_22 AC 121 ms
55,732 KB
testcase_23 AC 122 ms
55,612 KB
testcase_24 AC 121 ms
55,948 KB
testcase_25 AC 121 ms
55,668 KB
testcase_26 AC 122 ms
55,892 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