結果
| 問題 |
No.2558 中国剰余定理
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-02 14:34:55 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 750 bytes |
| コンパイル時間 | 12,940 ms |
| コンパイル使用メモリ | 379,560 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-26 16:54:08 |
| 合計ジャッジ時間 | 14,267 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
fn main() {
let (big_a, big_b, a, b) = input_tuple::<usize>();
for x in 0..100_000_000 {
if x % big_a == a && x % big_b == b {
println!("{}", x);
return;
}
}
}
fn input_tuple<T>() -> (T, T, T, T)
where
T: std::str::FromStr,
<T as std::str::FromStr>::Err: std::fmt::Debug,
{
let stdin = std::io::stdin();
let mut buf = String::new();
stdin.read_line(&mut buf).unwrap();
buf = buf.trim_end().to_owned();
let mut iter = buf.split_whitespace();
let n = iter.next().unwrap().parse().unwrap();
let m = iter.next().unwrap().parse().unwrap();
let l = iter.next().unwrap().parse().unwrap();
let o = iter.next().unwrap().parse().unwrap();
(n, m, l, o)
}