結果
問題 |
No.723 2つの数の和
|
ユーザー |
![]() |
提出日時 | 2022-12-16 20:06:30 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 478 bytes |
コンパイル時間 | 15,183 ms |
コンパイル使用メモリ | 401,072 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-16 01:02:08 |
合計ジャッジ時間 | 17,342 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 2 |
ソースコード
use std::collections::HashMap; fn main() { let mut xx = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok(); let xx: Vec<i64> = xx.split_whitespace().flat_map(str::parse).collect(); let mut count = HashMap::new(); for &x in &xx[2..] { *count.entry(x).or_insert(0) += 1; } let mut answer = 0; for &x in &xx[2..] { answer += count.get(&(xx[1] - x)).unwrap_or(&0); } println!("{answer}"); }