結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー jin128
提出日時 2016-08-26 14:12:33
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 411 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 159 ms
コンパイル使用メモリ 29,640 KB
最終ジャッジ日時 2026-02-23 22:18:09
ジャッジサーバーID
(参考情報)
judge1 / 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);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#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;

}
0