結果
| 問題 | No.1183 コイン遊び |
| コンテスト | |
| ユーザー |
Apass
|
| 提出日時 | 2020-08-22 13:24:01 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 525 ms / 2,000 ms |
| コード長 | 1,045 bytes |
| 記録 | |
| コンパイル時間 | 4,428 ms |
| コンパイル使用メモリ | 82,228 KB |
| 実行使用メモリ | 68,880 KB |
| 最終ジャッジ日時 | 2026-05-03 23:00:08 |
| 合計ジャッジ時間 | 12,791 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
import java.io.*;
import java.util.*;
public class B_CoinPlay {
private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static StringTokenizer st;
private static int readInt() throws IOException {
while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
return Integer.parseInt(st.nextToken());
}
private static int[] readIntArray(final int n) throws IOException {
int[] a = new int[n];
for (int i = 0; i < n; i++) a[i]= readInt();
return a;
}
public static void main(String[] args) throws IOException {
int N = readInt();
int[] A = readIntArray(N);
int[] B = readIntArray(N);
int count = 0;
boolean theSame = true;
for (int i = 0; i < N; i++) {
if (A[i] == B[i]) theSame = true;
else {
if (theSame) count ++;
theSame = false;
}
}
System.out.println(count);
}
}
Apass