結果

問題 No.112 ややこしい鶴亀算
ユーザー tsunabittsunabit
提出日時 2019-05-06 10:14:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 3,323 ms
コンパイル使用メモリ 73,840 KB
実行使用メモリ 61,424 KB
最終ジャッジ日時 2023-09-09 11:32:12
合計ジャッジ時間 8,406 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
56,772 KB
testcase_01 AC 145 ms
56,932 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 147 ms
56,832 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 152 ms
56,644 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 150 ms
56,528 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No112 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int temp = 0;
        int t = 0 , k = 0;
        for(int i = 0 ; i < n ; i++) {
        	temp = sc.nextInt();
        	if(temp == 2) {
        		t++;
        	}else {
        		k++;
        	}
        }
        System.out.println(k + " " + t);
    }
}
0