結果

問題 No.71 そろばん
ユーザー GrenacheGrenache
提出日時 2015-11-03 20:54:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 4,584 ms
コンパイル使用メモリ 72,424 KB
実行使用メモリ 56,508 KB
最終ジャッジ日時 2023-10-11 13:31:07
合計ジャッジ時間 7,503 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,576 KB
testcase_01 AC 122 ms
55,888 KB
testcase_02 AC 135 ms
56,508 KB
testcase_03 AC 134 ms
55,920 KB
testcase_04 AC 135 ms
55,800 KB
testcase_05 AC 135 ms
55,724 KB
testcase_06 AC 136 ms
55,540 KB
testcase_07 AC 135 ms
55,740 KB
testcase_08 AC 136 ms
55,824 KB
testcase_09 AC 137 ms
55,944 KB
testcase_10 AC 137 ms
56,048 KB
testcase_11 AC 131 ms
56,240 KB
testcase_12 AC 136 ms
55,968 KB
testcase_13 AC 137 ms
56,228 KB
testcase_14 AC 136 ms
55,780 KB
testcase_15 AC 136 ms
55,804 KB
testcase_16 AC 132 ms
56,096 KB
testcase_17 AC 135 ms
55,812 KB
testcase_18 AC 135 ms
55,992 KB
testcase_19 AC 135 ms
56,020 KB
testcase_20 AC 135 ms
55,704 KB
testcase_21 AC 136 ms
55,904 KB
testcase_22 AC 136 ms
56,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder71 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        long max = 0;
        for (int i = 1; i < n; i++) {
        	max = Math.max(max, (long)(i + 1) * (n - i + 1) - 1);
        }

		System.out.println(max);
        
        sc.close();
    }
}
0