結果
| 問題 |
No.172 UFOを捕まえろ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-29 12:52:43 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 261 bytes |
| コンパイル時間 | 578 ms |
| コンパイル使用メモリ | 24,192 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-14 06:43:30 |
| 合計ジャッジ時間 | 1,487 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:15:8: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration]
15 | m += abs(x) + abs(y) + ceil(r * sqrt(2));
| ^~~
main.c:3:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘abs’
2 | #include <math.h>
+++ |+#include <stdlib.h>
3 |
main.c:13:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d%d%d",&x, &y, &r);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
#define PI 3.141592
int main(){
int x, y, r;
int m = 0;
double deg = 45;
double rad = deg * PI /18.0;
scanf("%d%d%d",&x, &y, &r);
m += abs(x) + abs(y) + ceil(r * sqrt(2));
printf("%d\n",m);
return 0;
}