結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
fal_rnd
|
| 提出日時 | 2017-08-08 18:50:52 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 139 ms / 5,000 ms |
| コード長 | 607 bytes |
| 記録 | |
| コンパイル時間 | 2,476 ms |
| コンパイル使用メモリ | 87,060 KB |
| 実行使用メモリ | 47,020 KB |
| 最終ジャッジ日時 | 2025-10-24 21:02:34 |
| 合計ジャッジ時間 | 6,252 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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