結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
![]() |
提出日時 | 2017-04-27 22:38:18 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 601 bytes |
コンパイル時間 | 2,281 ms |
コンパイル使用メモリ | 74,564 KB |
実行使用メモリ | 41,808 KB |
最終ジャッジ日時 | 2024-09-13 14:54:48 |
合計ジャッジ時間 | 5,318 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 6 WA * 17 |
ソースコード
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(turtle + " " + (N-turtle)); } }