結果
問題 |
No.71 そろばん
|
ユーザー |
![]() |
提出日時 | 2018-02-17 22:22:11 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 384 bytes |
コンパイル時間 | 2,458 ms |
コンパイル使用メモリ | 76,732 KB |
実行使用メモリ | 65,460 KB |
最終ジャッジ日時 | 2024-06-24 12:22:02 |
合計ジャッジ時間 | 41,606 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 OLE * 1 |
other | WA * 12 OLE * 8 |
ソースコード
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(top+":"+bottom+":"+max); } System.out.println(max); } }