結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
suigingin
|
| 提出日時 | 2015-07-07 22:28:39 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 5,000 ms |
| コード長 | 539 bytes |
| コンパイル時間 | 3,522 ms |
| コンパイル使用メモリ | 77,016 KB |
| 実行使用メモリ | 46,708 KB |
| 最終ジャッジ日時 | 2025-10-24 20:53:27 |
| 合計ジャッジ時間 | 7,501 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
import java.util.Arrays;
import java.util.Scanner;
public class No_029 {
Scanner sc = new Scanner(System.in);
void run() {
int N = sc.nextInt();
int res = 0;
int[] cnt = new int[10];
while (N-- > 0) {
cnt[sc.nextInt() - 1]++;
cnt[sc.nextInt() - 1]++;
cnt[sc.nextInt() - 1]++;
}
int sum = 0;
for (int i = 0; i < 10; i++) {
res += cnt[i] / 2;
cnt[i] -= cnt[i] / 2 * 2;
sum += cnt[i];
}
res += sum / 4;
System.out.println(res);
}
public static void main(String[] args) {
new No_029().run();
}
}
suigingin