結果

問題 No.112 ややこしい鶴亀算
ユーザー tsunabit
提出日時 2019-05-06 10:14:32
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 3,410 ms
コンパイル使用メモリ 77,100 KB
実行使用メモリ 42,736 KB
最終ジャッジ日時 2024-06-27 04:38:55
合計ジャッジ時間 8,659 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 WA * 20
権限があれば一括ダウンロードができます

ソースコード

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