結果
| 問題 |
No.2558 中国剰余定理
|
| コンテスト | |
| ユーザー |
neko_the_shadow
|
| 提出日時 | 2024-01-26 18:34:11 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 12,030 ms |
| コンパイル使用メモリ | 385,776 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-28 07:32:00 |
| 合計ジャッジ時間 | 12,198 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
コンパイルメッセージ
warning: variable `A` should have a snake case name --> src/main.rs:7:9 | 7 | let A = tokens.next().unwrap(); | ^ help: convert the identifier to snake case: `a` | = note: `#[warn(non_snake_case)]` on by default warning: variable `B` should have a snake case name --> src/main.rs:8:9 | 8 | let B = tokens.next().unwrap(); | ^ help: convert the identifier to snake case: `b`
ソースコード
use std::io;
fn main() {
let mut line = String::new();
io::stdin().read_line(&mut line).unwrap();
let mut tokens = line.trim_end().split_whitespace().map(|v| v.parse::<usize>().unwrap());
let A = tokens.next().unwrap();
let B = tokens.next().unwrap();
let a = tokens.next().unwrap();
let b = tokens.next().unwrap();
for y in 0.. {
let x = y*A + a;
if x%B == b {
println!("{}", x);
break
}
}
}
neko_the_shadow