結果

問題 No.112 ややこしい鶴亀算
ユーザー koukonkokoukonko
提出日時 2015-12-11 18:21:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 728 bytes
コンパイル時間 2,158 ms
コンパイル使用メモリ 73,140 KB
実行使用メモリ 53,916 KB
最終ジャッジ日時 2023-10-13 11:13:51
合計ジャッジ時間 5,517 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
52,248 KB
testcase_01 AC 77 ms
52,784 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 75 ms
50,536 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 78 ms
52,588 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 77 ms
53,384 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = Integer.parseInt(buff.readLine());

			String[] box = buff.readLine().split(" ");
			int total = 0;

			int crane = 0, turtle = 0;

			for(int i = 0; i < count; ++i){
				if(Integer.parseInt(box[i]) == 2){
					crane++;
				}else{
					turtle++;
				}
			}

			System.out.println(turtle + " " + crane);

		} catch (NumberFormatException e) {
			e.getStackTrace();
		} catch (IOException e) {
			e.getStackTrace();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0