結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2016-04-29 22:27:08 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 644 bytes |
コンパイル時間 | 2,380 ms |
コンパイル使用メモリ | 74,192 KB |
実行使用メモリ | 61,392 KB |
最終ジャッジ日時 | 2024-10-04 18:07:17 |
合計ジャッジ時間 | 15,809 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 32 |
ソースコード
import java.io.BufferedInputStream; import java.util.Scanner; public class Main { static final long C = 1000000007; static final int CY = 1000000000; StringBuilder sb; public void calc() { sb = new StringBuilder(); BufferedInputStream bs = new BufferedInputStream(System.in); Scanner sc = new Scanner(bs); int n = sc.nextInt(); int[] a = new int[n]; for (int i=0; i < n; i++) { a[i] = sc.nextInt(); } long ans = 0; for (int i=1; i < n; i++) { if (a[i-1] > a[i]) { ans++; } } System.out.println(ans); } public static void main(String[] args) { Main main = new Main(); main.calc(); } }