結果

問題 No.71 そろばん
ユーザー kano_townkano_town
提出日時 2014-11-18 23:51:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 463 bytes
コンパイル時間 3,138 ms
コンパイル使用メモリ 71,920 KB
実行使用メモリ 49,868 KB
最終ジャッジ日時 2023-08-30 21:43:22
合計ジャッジ時間 5,324 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
49,244 KB
testcase_01 AC 38 ms
49,284 KB
testcase_02 AC 53 ms
49,516 KB
testcase_03 AC 50 ms
49,568 KB
testcase_04 AC 49 ms
49,588 KB
testcase_05 AC 53 ms
49,520 KB
testcase_06 AC 53 ms
49,548 KB
testcase_07 AC 52 ms
49,556 KB
testcase_08 AC 50 ms
49,700 KB
testcase_09 AC 53 ms
49,660 KB
testcase_10 AC 50 ms
49,508 KB
testcase_11 AC 48 ms
49,292 KB
testcase_12 AC 50 ms
49,752 KB
testcase_13 AC 54 ms
49,716 KB
testcase_14 AC 50 ms
49,684 KB
testcase_15 AC 53 ms
49,588 KB
testcase_16 AC 46 ms
49,140 KB
testcase_17 AC 50 ms
49,564 KB
testcase_18 AC 54 ms
49,564 KB
testcase_19 AC 53 ms
49,736 KB
testcase_20 AC 54 ms
49,712 KB
testcase_21 AC 51 ms
49,868 KB
testcase_22 AC 54 ms
49,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Yukicoder70 {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		long n = Integer.parseInt(br.readLine());
		long max = -1;
		
		for (int i = 1; i < n; i++) {
			max = Math.max(max, i * (n - i + 1) + n - i);
		}
		System.out.println(max);

	}

}
0