結果

問題 No.112 ややこしい鶴亀算
ユーザー marumaru
提出日時 2016-03-22 20:39:24
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 7,330 ms
コンパイル使用メモリ 76,280 KB
実行使用メモリ 58,744 KB
最終ジャッジ日時 2024-04-08 22:12:58
合計ジャッジ時間 10,073 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
58,736 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 160 ms
58,716 KB
testcase_05 AC 163 ms
58,744 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 159 ms
58,740 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 160 ms
58,592 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 168 ms
58,728 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 164 ms
58,728 KB
権限があれば一括ダウンロードができます

ソースコード

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++;
			} else {
				kame++;
			}
		}
		
		System.out.println(turu + " " + kame);
	}
}
0