結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2017-09-06 22:40:32 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 575 bytes |
コンパイル時間 | 257 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-06 23:56:46 |
合計ジャッジ時間 | 1,817 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
ソースコード
#include <stdio.h> int main() { long long int X, Y, L, x, y; int i, j; scanf("%lld %lld %lld", &X, &Y, &L); x = X; y = Y; if (X < 0) { X = -X; } if (Y < 0) { Y = -Y; } for (i = 0; 0 < X; i++) { X -= L; //printf("X=%lld i=%d\n", X, i); } for (j = 0; 0 < Y; j++) { Y -= L; //printf("Y=%lld j=%d\n", Y, j); } if (((y > 0) || (y == 0)) && x != 0) { printf("%d\n", i+j+1); } else if (y < 0 && ((x != 0) || (x == 0))) { printf("%d\n", i+j+2); } else if (y > 0 && x == 0) { printf("%d\n", i+j); } return 0; }