結果

問題 No.71 そろばん
ユーザー hhgfhn1
提出日時 2018-11-18 17:01:26
言語 Java
(openjdk 23)
結果
AC  
実行時間 165 ms / 5,000 ms
コード長 366 bytes
コンパイル時間 3,395 ms
コンパイル使用メモリ 74,484 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-12-24 14:54:50
合計ジャッジ時間 8,360 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n=scanner.nextInt();
		long max=Integer.MIN_VALUE;
		for(int i=0;i<=n;i++) {
			int j=n-i;
			int ut=i+1;
			long tmp=i+(long)j*ut;
			max=Math.max(max, tmp);
		}
		System.out.println(max);
	}
}
0