結果
| 問題 | No.3126 Dual Query Problem |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2026-05-27 00:18:42 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 188 ms / 2,000 ms |
| コード長 | 1,084 bytes |
| 記録 | |
| コンパイル時間 | 1,204 ms |
| コンパイル使用メモリ | 204,448 KB |
| 実行使用メモリ | 7,452 KB |
| 最終ジャッジ日時 | 2026-05-27 00:19:05 |
| 合計ジャッジ時間 | 9,853 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
#![allow(non_snake_case, unused_imports)]
use std::collections::{HashMap, HashSet};
use proconio::{input, marker::Usize1, marker::Chars};
use itertools::Itertools;
#[allow(unused_macros)]
macro_rules! d {
( $( $x:expr ),* $(,)? ) => {
eprintln!(
concat!( $( stringify!($x), "={:?} " ),* ),
$( $x ),*
);
};
}
#[allow(dead_code)]
fn yn(b: bool) -> &'static str {
if b { "Yes" } else { "No" }
}
fn main() {
input! {
N: usize,
Q: usize,
X: [i64; N],
}
let d: HashMap<i64, usize> = X.iter().copied().collect::<HashSet<_>>()
.into_iter()
.enumerate()
.map(|(i, x)| (x, i))
.collect();
let cnt = d.len() + N;
if cnt > Q {
println!("No");
return;
}
println!("Yes");
let mut used = HashSet::new();
for x in X {
if !used.contains(&x) {
println!("1 {} {}", d[&x]+1, x);
used.insert(x);
}
println!("2 {}", d[&x]+1)
}
for _ in 0..Q-cnt {
println!("1 1 1")
}
}
norioc