結果

問題 No.1183 コイン遊び
ユーザー xRS43BofaUEZ5gc
提出日時 2021-03-16 16:18:14
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 849 bytes
コンパイル時間 3,814 ms
コンパイル使用メモリ 74,272 KB
実行使用メモリ 71,148 KB
最終ジャッジ日時 2024-11-08 01:59:37
合計ジャッジ時間 29,307 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 19 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

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 ++;
	            				break;
	            			}
	            		}
	            	}
	            	}
	            System.out.println(count -1);
	            }
}
0