結果

問題 No.71 そろばん
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-03 21:32:04
言語 Java19
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 328 bytes
コンパイル時間 2,294 ms
コンパイル使用メモリ 71,396 KB
実行使用メモリ 57,640 KB
最終ジャッジ日時 2023-08-18 10:26:26
合計ジャッジ時間 6,660 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,652 KB
testcase_01 AC 127 ms
55,624 KB
testcase_02 AC 136 ms
53,652 KB
testcase_03 AC 136 ms
55,832 KB
testcase_04 AC 136 ms
55,748 KB
testcase_05 AC 137 ms
55,700 KB
testcase_06 AC 137 ms
55,772 KB
testcase_07 AC 138 ms
55,592 KB
testcase_08 AC 139 ms
55,652 KB
testcase_09 AC 136 ms
55,612 KB
testcase_10 AC 138 ms
55,880 KB
testcase_11 AC 134 ms
55,652 KB
testcase_12 AC 136 ms
55,724 KB
testcase_13 AC 137 ms
57,640 KB
testcase_14 AC 136 ms
55,564 KB
testcase_15 AC 137 ms
55,704 KB
testcase_16 AC 133 ms
55,864 KB
testcase_17 AC 136 ms
55,588 KB
testcase_18 AC 136 ms
55,620 KB
testcase_19 AC 133 ms
55,660 KB
testcase_20 AC 141 ms
55,616 KB
testcase_21 AC 135 ms
55,672 KB
testcase_22 AC 136 ms
55,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long max=0;
        for(long i=0; i<=N; i++){
            long t=N*i-i*i+N;
            max=Math.max(max,t);
        }
        System.out.println(max);
    }
}
0