結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-10-05 00:01:09 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 252 bytes |
| コンパイル時間 | 103 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-21 17:00:54 |
| 合計ジャッジ時間 | 1,515 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%d%d%d", &x, &y, &l);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int x, y, l, k, c=0;
scanf("%d%d%d", &x, &y, &l);
c += y < 0 ? 2 : 0;
x = x>0? x:-x;
y = y>0? y:-y;
for(k = 0; k < x;k+=l,c++);
for(k = 0; k < y;k+=l,c++);
if(x!=0) c++;
printf("%d\n", c);
return 0;
}
mosmos_21