結果
| 問題 | No.2051 Divide |
| コンテスト | |
| ユーザー |
ixTL255
|
| 提出日時 | 2023-02-16 23:11:11 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 2,000 ms |
| + 807µs | |
| コード長 | 644 bytes |
| 記録 | |
| コンパイル時間 | 11,142 ms |
| コンパイル使用メモリ | 182,116 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-17 18:09:39 |
| 合計ジャッジ時間 | 11,920 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
fn divisors (n: usize) -> Vec<usize> {
let mut res: Vec<usize> = Vec::new();
for i in 1..=n {
if i * i > n { break; }
if n % i == 0 {
res.push(i);
if n / i > i {
res.push(n / i);
}
}
}
res.sort();
res
}
fn main() {
let mut s = String::new();
std::io::stdin().read_line(&mut s).ok();
let mut itr = s.trim().split_whitespace();
let a: usize = itr.next().unwrap().parse().unwrap();
let b: usize = itr.next().unwrap().parse().unwrap();
let res = divisors(a);
println!("{}", res.iter().filter(|x| *x % b == 0).count());
}
ixTL255