結果

問題 No.71 そろばん
ユーザー hhgfhn1hhgfhn1
提出日時 2018-11-18 17:01:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 5,000 ms
コード長 366 bytes
コンパイル時間 2,226 ms
コンパイル使用メモリ 71,116 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2023-08-26 01:54:50
合計ジャッジ時間 6,485 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
55,644 KB
testcase_01 AC 106 ms
55,824 KB
testcase_02 AC 113 ms
56,044 KB
testcase_03 AC 114 ms
55,468 KB
testcase_04 AC 112 ms
55,424 KB
testcase_05 AC 113 ms
55,964 KB
testcase_06 AC 114 ms
55,892 KB
testcase_07 AC 112 ms
55,460 KB
testcase_08 AC 111 ms
56,260 KB
testcase_09 AC 111 ms
55,912 KB
testcase_10 AC 113 ms
55,648 KB
testcase_11 AC 114 ms
56,076 KB
testcase_12 AC 113 ms
55,780 KB
testcase_13 AC 118 ms
55,744 KB
testcase_14 AC 112 ms
56,068 KB
testcase_15 AC 112 ms
56,064 KB
testcase_16 AC 107 ms
56,044 KB
testcase_17 AC 110 ms
56,032 KB
testcase_18 AC 111 ms
55,884 KB
testcase_19 AC 116 ms
56,328 KB
testcase_20 AC 115 ms
55,948 KB
testcase_21 AC 118 ms
55,980 KB
testcase_22 AC 111 ms
55,988 KB
権限があれば一括ダウンロードができます

ソースコード

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