結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-10-05 00:00:46 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 279 bytes |
| コンパイル時間 | 88 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-21 17:00:50 |
| 合計ジャッジ時間 | 1,980 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 |
コンパイルメッセージ
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;
printf("%d %d\n", x, 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