結果
| 問題 |
No.1220 yukipoker
|
| ユーザー |
|
| 提出日時 | 2020-09-04 22:25:48 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,643 bytes |
| コンパイル時間 | 12,104 ms |
| コンパイル使用メモリ | 401,120 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-26 14:38:09 |
| 合計ジャッジ時間 | 13,604 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 25 |
コンパイルメッセージ
warning: unused variable: `k` --> src/main.rs:71:13 | 71 | let k: usize = sc.cin(); | ^ help: if this is intentional, prefix it with an underscore: `_k` | = note: `#[warn(unused_variables)]` on by default
ソースコード
#![allow(unused_imports, unused_macros, dead_code)]
macro_rules! min {
(.. $x:expr) => {{
let mut it = $x.iter();
it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
}};
($x:expr) => ($x);
($x:expr, $($ys:expr),*) => {{
let t = min!($($ys),*);
if $x < t { $x } else { t }
}}
}
macro_rules! max {
(.. $x:expr) => {{
let mut it = $x.iter();
it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
}};
($x:expr) => ($x);
($x:expr, $($ys:expr),*) => {{
let t = max!($($ys),*);
if $x > t { $x } else { t }
}}
}
macro_rules! trace {
($x:expr) => {
#[cfg(debug_assertions)]
eprintln!(">>> {} = {:?}", stringify!($x), $x)
};
($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! flush {
() => {
std::io::stdout().flush().unwrap();
};
}
macro_rules! put {
(.. $x:expr) => {{
let mut it = $x.iter();
if let Some(x) = it.next() { print!("{}", x); }
for x in it { print!(" {}", x); }
println!("");
}};
($x:expr) => { println!("{}", $x) };
($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}
/// Flush is stronger?
fn solve(n: usize, m: usize, k: usize) -> bool {
if n + 1 <= k {
// S=0
return true;
}
let mut r = 1.0; // F/S
for i in 0..k {
r *= (n - i) as f64 / (i + 1) as f64;
r /= m as f64;
}
r *= m as f64;
r /= (n - k + 1) as f64;
r < 1.0
}
fn main() {
let mut sc = Scanner::new();
let q: usize = sc.cin();
for _ in 0..q {
let n: usize = sc.cin();
let m: usize = sc.cin();
let k: usize = sc.cin();
put!(if n <= m * 2 { "Flush" } else { "Straight" });
}
}
use std::collections::VecDeque;
use std::io::{self, Write};
use std::str::FromStr;
struct Scanner {
stdin: io::Stdin,
buffer: VecDeque<String>,
}
impl Scanner {
fn new() -> Self {
Scanner {
stdin: io::stdin(),
buffer: VecDeque::new(),
}
}
fn cin<T: FromStr>(&mut self) -> T {
while self.buffer.is_empty() {
let mut line = String::new();
let _ = self.stdin.read_line(&mut line);
for w in line.split_whitespace() {
self.buffer.push_back(String::from(w));
}
}
self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
}
fn chars(&mut self) -> Vec<char> {
self.cin::<String>().chars().collect()
}
fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
(0..n).map(|_| self.cin()).collect()
}
}