結果

問題 No.71 そろばん
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-04-19 18:53:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 818 bytes
コンパイル時間 3,237 ms
コンパイル使用メモリ 72,728 KB
実行使用メモリ 56,272 KB
最終ジャッジ日時 2023-09-18 00:55:07
合計ジャッジ時間 7,524 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,452 KB
testcase_01 AC 124 ms
55,580 KB
testcase_02 AC 132 ms
56,084 KB
testcase_03 AC 130 ms
55,996 KB
testcase_04 AC 132 ms
55,452 KB
testcase_05 AC 130 ms
55,768 KB
testcase_06 AC 133 ms
55,776 KB
testcase_07 AC 132 ms
55,756 KB
testcase_08 AC 130 ms
56,136 KB
testcase_09 AC 132 ms
56,232 KB
testcase_10 AC 132 ms
55,696 KB
testcase_11 AC 128 ms
55,904 KB
testcase_12 AC 132 ms
55,972 KB
testcase_13 AC 132 ms
56,116 KB
testcase_14 AC 132 ms
56,004 KB
testcase_15 AC 131 ms
56,100 KB
testcase_16 AC 130 ms
56,052 KB
testcase_17 AC 133 ms
55,440 KB
testcase_18 AC 133 ms
55,816 KB
testcase_19 AC 133 ms
55,756 KB
testcase_20 AC 133 ms
56,208 KB
testcase_21 AC 132 ms
55,916 KB
testcase_22 AC 131 ms
56,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.71 そろばん

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No0071 {
    
    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        int n = in.nextInt();
        long max = 0;
        for (long i=0; i<=n; i++) {
            max = max(max,i+(i+1)*(n-i));
        }
        out.println(max);
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0