結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2016-11-07 23:28:21 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 531 bytes |
コンパイル時間 | 4,346 ms |
コンパイル使用メモリ | 74,368 KB |
実行使用メモリ | 61,352 KB |
最終ジャッジ日時 | 2024-11-25 04:31:43 |
合計ジャッジ時間 | 18,862 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 25 |
ソースコード
import java.util.*; import java.math.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { int n = sc.nextInt(); int[] ary = new int[n]; for (int i = 0;i < n;i++) { ary[i] = sc.nextInt(); } int ret = 0; int max = ary[0]; for (int i = 1;i < n;i++) { if (ary[i]<max) ret++; max = Math.max(max,ary[i]); } System.out.println(ret); } }