結果

問題 No.112 ややこしい鶴亀算
ユーザー maru
提出日時 2016-03-22 20:42:29
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 464 bytes
コンパイル時間 3,688 ms
コンパイル使用メモリ 76,240 KB
実行使用メモリ 56,864 KB
最終ジャッジ日時 2024-10-01 13:07:58
合計ジャッジ時間 8,851 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 2 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class yukicoder_112 {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int[] a = new int[n];
		
		for (int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		int turu = 0;
		int kame = 0;
		
		for (int i = 0; i < a.length; i++) {
			if (a[i] == 2) {
				turu++;
			}
			
			if (a[i] == 4) {
				kame++;
			}
		}
		
		System.out.println(turu + " " + kame);
	}
}
0