結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-26 14:15:36 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 727 ms / 5,000 ms |
| コード長 | 398 bytes |
| コンパイル時間 | 98 ms |
| コンパイル使用メモリ | 20,992 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 18:47:49 |
| 合計ジャッジ時間 | 1,616 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
コンパイルメッセージ
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 = 2;
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;
}