結果

問題 No.1114 足し算盆に返らず
ユーザー RISE70226821RISE70226821
提出日時 2020-08-04 09:57:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 520 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 2,904 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 67,280 KB
最終ジャッジ日時 2023-10-12 08:37:04
合計ジャッジ時間 22,206 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 499 ms
67,212 KB
testcase_01 AC 510 ms
67,280 KB
testcase_02 AC 498 ms
66,980 KB
testcase_03 AC 429 ms
65,876 KB
testcase_04 AC 477 ms
65,588 KB
testcase_05 AC 369 ms
64,880 KB
testcase_06 AC 500 ms
66,928 KB
testcase_07 AC 488 ms
67,072 KB
testcase_08 AC 382 ms
65,064 KB
testcase_09 AC 367 ms
65,072 KB
testcase_10 AC 379 ms
65,236 KB
testcase_11 AC 203 ms
56,588 KB
testcase_12 AC 402 ms
65,636 KB
testcase_13 AC 501 ms
67,056 KB
testcase_14 AC 276 ms
60,824 KB
testcase_15 AC 350 ms
65,228 KB
testcase_16 AC 373 ms
65,100 KB
testcase_17 AC 430 ms
65,840 KB
testcase_18 AC 320 ms
65,164 KB
testcase_19 AC 349 ms
65,080 KB
testcase_20 AC 520 ms
67,208 KB
testcase_21 AC 340 ms
65,040 KB
testcase_22 AC 135 ms
55,948 KB
testcase_23 AC 134 ms
56,028 KB
testcase_24 AC 135 ms
56,216 KB
testcase_25 AC 141 ms
56,388 KB
testcase_26 AC 136 ms
55,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		// 入力
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		// 算出
		int start = 0;
		int end = 0;
		if(N % 2 == 0){
			start = N / 2;
			end = N - 1; 
		}else{
			start = N / 2 + 1;
			end = N;
		}
		
		// 出力
		for(int i = start; i <= end; i++){
			System.out.print(i + " ");
		}
		System.out.println("");
	}
}
0