結果

問題 No.71 そろばん
ユーザー Tsukasa_Type
提出日時 2018-02-17 22:23:44
言語 Java
(openjdk 23)
結果
AC  
実行時間 156 ms / 5,000 ms
コード長 337 bytes
コンパイル時間 2,774 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 41,884 KB
最終ジャッジ日時 2024-06-24 12:22:10
合計ジャッジ時間 7,343 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		long max = -1;
		for (int i=0; i<=n; i++) {
			long top = i;
			long bottom = n-i;
			long num = bottom*(top+1)+top;
			if (max < num) {max =num ;}
		}
		System.out.println(max);
	}
}
0