結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
sino
|
| 提出日時 | 2020-04-17 23:14:22 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
MLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,358 bytes |
| 記録 | |
| コンパイル時間 | 23,389 ms |
| コンパイル使用メモリ | 409,196 KB |
| 実行使用メモリ | 437,532 KB |
| 平均クエリ数 | 31.53 |
| 最終ジャッジ日時 | 2026-03-31 09:38:00 |
| 合計ジャッジ時間 | 11,723 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 MLE * 1 |
ソースコード
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
#[allow(unused_macros)]
macro_rules! read {
([$t:ty] ; $n:expr) =>
((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
($($t:ty),+ ; $n:expr) =>
((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
([$t:ty]) =>
(rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
($t:ty) =>
(rl().parse::<$t>().unwrap());
($($t:ty),*) => {{
let buf = rl();
let mut w = buf.split_whitespace();
($(w.next().unwrap().parse::<$t>().unwrap()),*)
}};
}
#[allow(dead_code)]
fn rl() -> String {
let mut buf = String::new();
std::io::stdin().read_line(&mut buf).unwrap();
buf.trim_end().to_owned()
}
fn main() {
use std::io::{self, Write};
let mut lb = 0u64;
let mut ub = 1000000000u64;
while ub - lb > 1 {
let q = (lb + ub) / 2;
println!("? {}", q);
io::stdout().flush().unwrap();
let react = read!(i32);
if react == 1 {
lb = q;
} else {
ub = q - 1;
}
}
println!("? {}", ub);
let react = read!(i32);
if react == 1 {
println!("! {}", ub);
}
else {
println!("! {}", lb);
}
}
sino