結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
めうめう🎒
|
| 提出日時 | 2016-05-09 21:50:11 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 839 bytes |
| コンパイル時間 | 2,033 ms |
| コンパイル使用メモリ | 81,880 KB |
| 実行使用メモリ | 46,784 KB |
| 最終ジャッジ日時 | 2025-10-24 20:57:07 |
| 合計ジャッジ時間 | 5,632 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 5 |
ソースコード
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Queue;
import java.util.Scanner;
public class Main {
private int n;
private int[] how;
Main(){
how = new int[11];
}
public void setN(int n){
this.n = n;
}
public void plusHow(int a,int b,int c){
this.how[a]++;
this.how[b]++;
this.how[c]++;
}
public int ans(){
int last = 0;
int ans = 0;
for(int i = 0;i < 10;i++){
ans += how[i] / 2;
last += how[i] % 2;
}
ans += last / 3;
return ans;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Main m = new Main();
int n = sc.nextInt();
m.setN(n);
int a,b,c;
for(int i = 0;i < n;i++){
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
a--;
b--;
c--;
m.plusHow(a, b, c);
}
System.out.println(m.ans());
}
}
めうめう🎒