結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  cra77756176 | 
| 提出日時 | 2022-11-19 14:02:33 | 
| 言語 | Rust (1.83.0 + proconio) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 614 bytes | 
| コンパイル時間 | 12,251 ms | 
| コンパイル使用メモリ | 400,476 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:18:59 | 
| 合計ジャッジ時間 | 12,720 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
use std::io::{self, BufRead};
fn main() {
    let input = io::stdin()
        .lock()
        .lines()
        .flat_map(|l| {
            l.unwrap()
                .split_whitespace()
                .map(|n| n.parse::<usize>().unwrap())
                .collect::<Vec<_>>()
        })
        .collect::<Vec<_>>();
    let counts = (1..=10)
        .map(|i| input[1..].iter().filter(|&&n| n == i).count())
        .collect::<Vec<_>>();
    let n_pairs = counts.iter().map(|i| i / 2).sum::<usize>();
    let n_fours = counts.iter().map(|i| i % 2).sum::<usize>() / 4;
    println!("{}", n_pairs + n_fours);
}
            
            
            
        