結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
nak3
|
| 提出日時 | 2017-11-03 17:31:29 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 856 bytes |
| コンパイル時間 | 11,873 ms |
| コンパイル使用メモリ | 379,072 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-22 15:32:06 |
| 合計ジャッジ時間 | 13,190 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 8 |
ソースコード
use std::io;
use std::str::FromStr;
fn main() {
let stdin = io::stdin();
let mut buf = String::new();
stdin.read_line(&mut buf).ok();
let mut it = buf.split_whitespace().map(|n| i64::from_str(n).unwrap());
let a = it.next().unwrap();
let mut buf = String::new();
stdin.read_line(&mut buf).ok();
let mut it = buf.split_whitespace().map(|n| i64::from_str(n).unwrap());
let b = it.next().unwrap();
let mut buf = String::new();
stdin.read_line(&mut buf).ok();
let mut it = buf.split_whitespace().map(|n| i64::from_str(n).unwrap());
let c = it.next().unwrap();
let mut ans = 0;
ans += (a / c).abs();
ans += (b / c).abs();
if a % c != 0 {
ans += 1;
}
if b % c != 0 {
ans += 1;
}
if a != 0 && b != 0 {
ans += 1;
}
println!("{}", ans);
}
nak3