結果
問題 |
No.1017 Reiwa Sequence
|
ユーザー |
![]() |
提出日時 | 2020-04-03 22:19:38 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 800 bytes |
コンパイル時間 | 2,791 ms |
コンパイル使用メモリ | 75,228 KB |
実行使用メモリ | 60,880 KB |
最終ジャッジ日時 | 2024-07-03 03:55:13 |
合計ジャッジ時間 | 39,435 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 50 |
ソースコード
import java.util.*; class Main{ public static void main(String[] args) { try(Scanner sc = new Scanner(System.in)){ int n = Integer.valueOf(sc.next()); ArrayList<Integer> line = new ArrayList<Integer>(); for(int i = 0; i < n; i++){ int value = Integer.valueOf(sc.next()); if(i != 0){ for(int j = 0; j < line.size(); j++){ if(line.get(j) > value){ line.add(j - 1, value); break; } } } } System.out.println(line); }catch(Exception e){ e.printStackTrace(); } } }