結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2020-04-04 05:15:06 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 692 bytes |
コンパイル時間 | 279 ms |
コンパイル使用メモリ | 27,648 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 06:55:48 |
合計ジャッジ時間 | 1,085 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include<stdio.h>int main() {// 宣言int controlCnt = 0;signed int X = 0;signed int Y = 0;signed int distance = 0;// 入力値受け取りscanf("%d", &X);scanf("%d", &Y);scanf("%d", &distance);// X方向if (Y >= 0) {controlCnt += Y / distance + (Y % distance > 0);if (X == 0)goto answer;}else {controlCnt ++;controlCnt += -Y / distance + (-Y % distance > 0);if (X == 0) {controlCnt++;goto answer;}}// Y方向controlCnt++;if (X > 0)controlCnt += X / distance + (X % distance > 0);elsecontrolCnt += -X / distance + (-X % distance > 0);goto answer;// 回答表示answer:printf("%d", controlCnt);return 0;}