結果
問題 | No.358 も~っと!門松列 |
ユーザー |
|
提出日時 | 2024-05-22 18:24:09 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 550 bytes |
コンパイル時間 | 13,721 ms |
コンパイル使用メモリ | 379,224 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-20 18:30:55 |
合計ジャッジ時間 | 14,727 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
fn main() {let mut s = String::new();std::io::stdin().read_line(&mut s).ok();let n: Vec<u32> = s.split_whitespace().flat_map(str::parse).collect();let (a, b, c) = (n[0], n[1], n[2]);let m = a.max(b).max(c);if a == b || b == c || c == a {println!("0");return;}if b == m || b == a.min(b).min(c) {println!("INF");return;}let a = (2..=m).filter(|i| {let (a, b, c) = (a % i, b % i, c % i);a != b&& b != c && c != a&& (b == a.max(b).max(c) || b == a.min(b).min(c))}).count();println!("{}", a)}