結果
問題 | No.172 UFOを捕まえろ |
ユーザー |
![]() |
提出日時 | 2015-09-14 13:04:32 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 183 bytes |
コンパイル時間 | 354 ms |
コンパイル使用メモリ | 24,192 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 14:13:44 |
合計ジャッジ時間 | 1,154 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:28: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration] 7 | printf("%.0lf\n", ceil(abs(x)+abs(y)+sqrt(2)*(double)r)); | ^~~ main.c:3:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘abs’ 2 | #include <math.h> +++ |+#include <stdlib.h> 3 | main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d %d %d", &x, &y, &r); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> int main(void){ int x, y, r; scanf("%d %d %d", &x, &y, &r); printf("%.0lf\n", ceil(abs(x)+abs(y)+sqrt(2)*(double)r)); return 0; }