結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-05 19:26:34 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 699 bytes |
| コンパイル時間 | 15,517 ms |
| コンパイル使用メモリ | 406,080 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-29 06:17:44 |
| 合計ジャッジ時間 | 16,753 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 21 |
ソースコード
macro_rules! scan {
($buf:expr) => {{
use std::io::{stdin, BufRead};
use std::str::FromStr;
$buf.clear();
stdin().lock().read_line(&mut $buf).unwrap();
FromStr::from_str($buf.trim()).unwrap()
}};
}
fn main() {
let mut b = String::new();
let x: i32 = scan!(b);
let y: i32 = scan!(b);
let l: i32 = scan!(b);
let mut c;
if x == 0 && 0 <= y {
c = 0;
} else if x != 0 && y == 0 {
c = 1;
} else {
c = 2;
}
let mut pos = x;
while 0 < pos {
pos -= l;
c += 1;
}
let mut pos = y;
while 0 < pos {
pos -= l;
c += 1;
}
println!("{c}");
}