結果

問題 No.71 そろばん
ユーザー Grenache
提出日時 2015-11-03 20:54:35
言語 Java
(openjdk 23)
結果
AC  
実行時間 145 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 3,687 ms
コンパイル使用メモリ 74,068 KB
実行使用メモリ 54,332 KB
最終ジャッジ日時 2024-09-13 12:14:58
合計ジャッジ時間 7,937 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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