結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
Tsukasa_Type
|
| 提出日時 | 2018-02-09 15:12:02 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 610 bytes |
| コンパイル時間 | 2,376 ms |
| コンパイル使用メモリ | 76,420 KB |
| 実行使用メモリ | 46,780 KB |
| 最終ジャッジ日時 | 2025-10-24 21:05:07 |
| 合計ジャッジ時間 | 5,048 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 17 |
ソースコード
import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int[] ar = new int[11];
int times = 0;
int n = sc.nextInt();
for (int i=0; i<n; i++) {
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
ar[a]++;
ar[b]++;
ar[c]++;
if (ar[a]==2) {
times++;
ar[a] = 0;
}
if (ar[b]==2) {
times++;
ar[b] = 0;
}
if (ar[c]==2) {
times++;
ar[c] = 0;
}
}
int sum = 0;
for (int i=0; i<ar.length; i++) {
sum += ar[i];
}
System.out.println(times+(sum/4));
}
}
Tsukasa_Type