結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2016-08-26 14:12:33 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 411 bytes |
コンパイル時間 | 349 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 04:05:48 |
合計ジャッジ時間 | 1,997 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d%d%d",&x, &y, &l); | ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> int main(){ int x, y, l; int count = 0; scanf("%d%d%d",&x, &y, &l); if(abs(x) > 0){ count ++; if(y < 0){ count++; } } int i; for(i = 0; ; i++){ if(abs(x) <= l * i){ count += i; break; } } for(i = 0; ; i++){ if(abs(y) <= l * i){ count += i; break; } } printf("%d\n",count); return 0; }