結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
![]() |
提出日時 | 2016-03-22 20:39:24 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 447 bytes |
コンパイル時間 | 3,501 ms |
コンパイル使用メモリ | 86,264 KB |
実行使用メモリ | 42,660 KB |
最終ジャッジ日時 | 2024-10-01 13:07:43 |
合計ジャッジ時間 | 8,216 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 6 WA * 17 |
ソースコード
import java.util.Scanner; public class yukicoder_112 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = stdIn.nextInt(); } int turu = 0; int kame = 0; for (int i = 0; i < a.length; i++) { if (a[i] == 2) { turu++; } else { kame++; } } System.out.println(turu + " " + kame); } }