結果
問題 | No.29 パワーアップ |
ユーザー | aikon_marimo |
提出日時 | 2018-05-07 21:58:27 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 656 bytes |
コンパイル時間 | 1,983 ms |
コンパイル使用メモリ | 71,640 KB |
実行使用メモリ | 58,224 KB |
最終ジャッジ日時 | 2023-09-10 10:57:47 |
合計ジャッジ時間 | 6,258 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 124 ms
55,776 KB |
testcase_01 | AC | 127 ms
55,844 KB |
testcase_02 | WA | - |
testcase_03 | AC | 125 ms
56,044 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 125 ms
56,196 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 127 ms
55,892 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 128 ms
55,924 KB |
testcase_21 | WA | - |
ソースコード
import java.util.Arrays; import java.util.Iterator; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int num[] = new int[10]; Arrays.fill(num, 0); for (int i = 0; i < N; i++) { int a,b,c; a = in.nextInt(); b = in.nextInt(); c = in.nextInt(); num[a-1]++; num[b-1]++; num[c-1]++; } int ans = 0; for (int i = 0; i < 10; i++) { ans += num[i]/2; num[i] = num[i]/2; } int amari = 0; for (int i = 0; i < 10; i++) { if (num[i] != 0) { amari++; } } ans += amari/4; System.out.println(ans); } }