結果

問題 No.71 そろばん
ユーザー k_kadorak_kadora
提出日時 2015-06-19 22:14:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 327 bytes
コンパイル時間 5,966 ms
コンパイル使用メモリ 71,604 KB
実行使用メモリ 56,504 KB
最終ジャッジ日時 2023-09-21 09:51:49
合計ジャッジ時間 7,376 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,908 KB
testcase_01 AC 116 ms
55,788 KB
testcase_02 AC 114 ms
56,320 KB
testcase_03 AC 115 ms
56,300 KB
testcase_04 AC 115 ms
56,504 KB
testcase_05 AC 114 ms
56,184 KB
testcase_06 AC 112 ms
55,984 KB
testcase_07 AC 111 ms
55,948 KB
testcase_08 AC 111 ms
55,780 KB
testcase_09 AC 112 ms
55,840 KB
testcase_10 AC 112 ms
56,332 KB
testcase_11 AC 112 ms
55,940 KB
testcase_12 AC 111 ms
55,688 KB
testcase_13 AC 112 ms
55,980 KB
testcase_14 AC 113 ms
56,152 KB
testcase_15 AC 111 ms
55,816 KB
testcase_16 AC 111 ms
55,784 KB
testcase_17 AC 112 ms
55,868 KB
testcase_18 AC 113 ms
55,668 KB
testcase_19 AC 112 ms
55,572 KB
testcase_20 AC 115 ms
56,088 KB
testcase_21 AC 113 ms
56,088 KB
testcase_22 AC 116 ms
56,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Yuki71{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n;
		long res;
		n = sc.nextInt();
		if(n % 2 == 0){
			res = (long)(n/2)*(long)(n/2+1)+(long)(n/2);
		}else{
			res = (long)(n/2+1)*(long)(n/2+1)+(long)(n/2);
		}
		System.out.println(res);
	}
}
0