結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
fal_rnd
|
| 提出日時 | 2017-08-08 18:50:52 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 75 ms / 5,000 ms |
| + 425µs | |
| コード長 | 607 bytes |
| 記録 | |
| コンパイル時間 | 1,655 ms |
| コンパイル使用メモリ | 93,472 KB |
| 実行使用メモリ | 43,856 KB |
| 最終ジャッジ日時 | 2026-07-15 21:53:32 |
| 合計ジャッジ時間 | 4,443 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
import java.util.*;
import java.util.stream.IntStream;
public class Main{
static Scanner s=new Scanner(System.in);
static int getInt(){return Integer.parseInt(s.next());}
static IntStream REPS(int v){return IntStream.range(0,v);}
static IntStream INS(int n) {return REPS(n).map(i->getInt());}
public static void main(String[]$){
HashMap<Integer,Integer>h=new HashMap<>();
INS(getInt()*3).forEach(i->h.merge(i,1,Integer::sum));
Collection<Integer>b=h.values();
System.out.println(
b.stream()
.filter(i->i%2==1)
.count()/4
+b.stream()
.mapToInt(i->i/2)
.sum()
);
}
}
fal_rnd