結果
問題 |
No.882 約数倍数
|
ユーザー |
|
提出日時 | 2019-09-14 18:06:09 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 500 ms |
コード長 | 948 bytes |
コンパイル時間 | 10,896 ms |
コンパイル使用メモリ | 383,732 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 06:29:15 |
合計ジャッジ時間 | 11,709 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 |
ソースコード
#![allow(unused_imports)] #![allow(dead_code)] use std::io::prelude::*; use std::cmp::{max, min}; use std::collections::BinaryHeap; const MOD: i64 = 1e9 as i64 + 7; fn main(){ let a: isize = read(); let b: isize = read(); let mut f = false; for i in 1..=100{ let c = b * i; if a < c{ break; } if a % c == 0{ f = true; } } let ans = if f {"YES"} else {"NO"}; println!("{}", ans); } fn read<T>() -> T where T: std::str::FromStr, { let stdin = std::io::stdin(); let token: String = stdin .lock() .bytes() .map(|c| c.unwrap() as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().unwrap() }