結果
問題 |
No.1110 好きな歌
|
ユーザー |
![]() |
提出日時 | 2020-07-10 21:53:39 |
言語 | Rust (1.83.0 + proconio) |
結果 |
TLE
|
実行時間 | - |
コード長 | 744 bytes |
コンパイル時間 | 15,379 ms |
コンパイル使用メモリ | 378,544 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-10-11 13:11:12 |
合計ジャッジ時間 | 22,305 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 TLE * 1 -- * 29 |
ソースコード
fn main() { let (n, d): (usize, i32) = { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).unwrap(); let mut iter = buf.split_whitespace(); ( iter.next().unwrap().parse().unwrap(), iter.next().unwrap().parse().unwrap(), ) }; let mut fav = Vec::with_capacity(n); let mut set = std::collections::BTreeSet::new(); for i in 0..n { let a: i32 = { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).unwrap(); buf.trim_end().parse().unwrap() }; fav.push(a); set.insert((a, i)); } for a in fav { println!("{}", set.range(..(a - d, n)).count()); } }