結果
問題 | No.71 そろばん |
ユーザー |
|
提出日時 | 2014-11-18 23:51:06 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 74 ms / 5,000 ms |
コード長 | 463 bytes |
コンパイル時間 | 3,275 ms |
コンパイル使用メモリ | 76,032 KB |
実行使用メモリ | 51,976 KB |
最終ジャッジ日時 | 2025-01-02 19:02:00 |
合計ジャッジ時間 | 5,576 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Yukicoder70 {public static void main(String[] args) throws IOException {BufferedReader br = new BufferedReader(new InputStreamReader(System.in));long n = Integer.parseInt(br.readLine());long max = -1;for (int i = 1; i < n; i++) {max = Math.max(max, i * (n - i + 1) + n - i);}System.out.println(max);}}