結果
| 問題 | No.647 明太子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-04 19:49:48 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,256 bytes |
| 記録 | |
| コンパイル時間 | 11,547 ms |
| コンパイル使用メモリ | 381,508 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-03 07:41:06 |
| 合計ジャッジ時間 | 12,581 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 RE * 6 |
ソースコード
use std::io::*;
fn main() {
let mut s: String = String::new();
std::io::stdin().read_to_string(&mut s).ok();
let mut itr = s.trim().split_whitespace();
let n: usize = itr.next().unwrap().parse().unwrap();
let ab: Vec<(usize, usize)> = (0..n)
.map(|_| {
(
itr.next().unwrap().parse().unwrap(),
itr.next().unwrap().parse().unwrap(),
)
})
.collect();
let m: usize = itr.next().unwrap().parse().unwrap();
let xy: Vec<(usize, usize)> = (0..m)
.map(|_| {
(
itr.next().unwrap().parse().unwrap(),
itr.next().unwrap().parse().unwrap(),
)
})
.collect();
let mut ans: Vec<Vec<usize>> = vec![Vec::new(); 1010];
for i in 0..m {
// 何人に買われるか
let mut cnt = 0;
for j in 0..n {
if xy[i].0 <= ab[j].0 && xy[i].1 >= ab[j].1 {
cnt += 1;
}
}
ans[cnt].push(i + 1);
}
for i in (1..1005).rev() {
if ans[i].len() > 0 {
for j in 0..ans[i].len() {
println!("{}", ans[i][j]);
}
return;
}
}
println!("0");
}