結果
問題 |
No.1183 コイン遊び
|
ユーザー |
![]() |
提出日時 | 2021-03-16 16:27:08 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 956 bytes |
コンパイル時間 | 3,585 ms |
コンパイル使用メモリ | 74,756 KB |
実行使用メモリ | 76,428 KB |
最終ジャッジ日時 | 2024-11-08 02:05:23 |
合計ジャッジ時間 | 21,648 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 2 WA * 7 TLE * 10 -- * 13 |
ソースコード
import java.util.Scanner; public class HelloWorld { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] ai = new int[n]; int[] bi = new int[n]; for (int i = 0; i < n; i++) { ai[i] = sc.nextInt(); } for (int i =0; i < n; i++) { bi[i]=sc.nextInt(); } sc.close(); int count = 0; for (int i = 0; i < n; i ++) { if (ai[i] != bi[i]) { for (int j = i; j < n; j ++) { if (ai[j] == bi[j]) { count ++; i = j; break; } if (j == n-1) { count ++; break; } } } System.out.println(count); } }}