結果

問題 No.112 ややこしい鶴亀算
ユーザー Lo_OTLo_OT
提出日時 2018-04-10 23:50:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 960 bytes
コンパイル時間 2,521 ms
コンパイル使用メモリ 74,304 KB
実行使用メモリ 59,136 KB
最終ジャッジ日時 2023-09-09 03:59:42
合計ジャッジ時間 7,402 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
56,596 KB
testcase_01 AC 149 ms
56,632 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 153 ms
57,060 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 155 ms
58,956 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 153 ms
56,968 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Yukicoder solver = new Yukicoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class Yukicoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int loop = in.nextInt();
            int vine = 0, turtle = 0;

            for (int i = 0; i < loop; i++) {
                if (in.nextInt() == 2) vine++;
                else turtle++;
            }

            out.println(turtle + " " + vine);
        }
    }
}
0