結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2023-06-05 19:42:23 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 689 bytes |
コンパイル時間 | 18,569 ms |
コンパイル使用メモリ | 379,192 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 06:19:29 |
合計ジャッジ時間 | 13,883 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 20 |
ソースコード
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 y < 0 { c = 2; } else if x == 0 { c = 0 } else { c = 1; } let mut pos_x = x; while 0 < pos_x { pos_x -= l; c += 1; } let mut pos_y = y; while 0 < pos_y { pos_y -= l; c += 1; } println!("{c}"); }