結果

問題 No.112 ややこしい鶴亀算
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-27 22:39:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 600 bytes
コンパイル時間 2,205 ms
コンパイル使用メモリ 78,212 KB
実行使用メモリ 53,004 KB
最終ジャッジ日時 2023-10-11 16:12:21
合計ジャッジ時間 5,155 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
51,276 KB
testcase_01 AC 74 ms
50,924 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 79 ms
53,004 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 77 ms
50,908 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 78 ms
51,272 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) throws IOException {
        BufferedReader reader =new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(reader.readLine());
        String[] inputs = reader.readLine().split(" ");
        int turtle = 0;
        for (int i = 0; i < N; i++) {
            if(Integer.parseInt(inputs[i]) == 2) {
                turtle += 1;
            }
        }
        System.out.println((N-turtle) + " " + turtle);
    }
}
0