結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
umashika
|
| 提出日時 | 2016-02-26 02:44:21 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| コンパイル時間 | 114 ms |
| コンパイル使用メモリ | 23,552 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-22 13:51:40 |
| 合計ジャッジ時間 | 854 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%ld %ld %ld",&x,&y,&l);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<math.h>
int main()
{
long int x;
long int y;
long int l;
int count=0;
double k;
scanf("%ld %ld %ld",&x,&y,&l);
//(x,y)まで移動
if(y<0){
count+=2;
y = -1*y;//負ならば正にする
}
k = (double)y/l;
count += (int)ceil(k);
if(x<0){
count+=2;
x = -1*x;
}
k = (double)x/l;
count += (int)ceil(k);
printf("%d",count);
return 0;
}
umashika