結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-07 10:21:00 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 637 bytes |
| コンパイル時間 | 464 ms |
| コンパイル使用メモリ | 24,576 KB |
| 実行使用メモリ | 8,612 KB |
| 最終ジャッジ日時 | 2025-03-07 10:21:03 |
| 合計ジャッジ時間 | 2,347 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 |
ソースコード
#include <stdio.h>
#include <stdbool.h>
void main(){
//X座標
int x = 0,y = 0,l = 0;
int input = scanf("%d\n%d\n%d\n",&x,&y,&l);
if(input == 2){
printf("入力ミス\n");
}
printf("(%d,%d) 移動距離:%d\n",x,y,l);
//命令回数
int instructionCount = 0;
//現在位置
int trueX = 0 , trueY = 0;
if( y < 0){
instructionCount += 2;
y *= -1;
}else if(x != 0){
instructionCount += 1;
if(x < 0){
x *= -1;
}
}
while(x > 0 || y > 0){
if(y >= 0){
y -= l;
instructionCount ++;
continue;
}
if(x >= 0){
x -= l;
instructionCount ++;
continue;
}
}
printf("%d\n",instructionCount);
}
Maeda