結果

問題 No.71 そろばん
ユーザー kohaku_kohaku
提出日時 2016-12-03 21:32:04
言語 Java
(openjdk 23)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 328 bytes
コンパイル時間 1,836 ms
コンパイル使用メモリ 73,472 KB
実行使用メモリ 41,276 KB
最終ジャッジ日時 2024-11-27 14:36:04
合計ジャッジ時間 5,463 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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