結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2023-06-05 19:39:06 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 734 bytes |
コンパイル時間 | 12,770 ms |
コンパイル使用メモリ | 406,220 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-29 06:19:00 |
合計ジャッジ時間 | 14,098 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 && y != 0) || (x == 0 && y < 0) { c = 2; } else if x != 0 && y == 0 { c = 1; } else { c = 0; } 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}"); }