結果
問題 |
No.72 そろばん Med
|
ユーザー |
|
提出日時 | 2016-04-14 09:35:55 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 599 bytes |
コンパイル時間 | 2,014 ms |
コンパイル使用メモリ | 74,520 KB |
実行使用メモリ | 67,248 KB |
最終ジャッジ日時 | 2024-10-04 08:32:36 |
合計ジャッジ時間 | 8,221 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 RE * 23 |
ソースコード
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); BigInteger max = BigInteger.ZERO; for (int i = 0; i < N; i++) { BigInteger upper = new BigInteger(String.valueOf(i)); BigInteger lower = new BigInteger(String.valueOf(N - i)); if (max.compareTo(upper.multiply(lower.add(BigInteger.ONE)).add(lower)) < 1) { max = upper.multiply(lower.add(BigInteger.ONE)).add(lower); } } System.out.println(max.mod(new BigInteger("1000007"))); } }