結果
| 問題 |
No.172 UFOを捕まえろ
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-08-07 23:43:46 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 180 bytes |
| コンパイル時間 | 545 ms |
| コンパイル使用メモリ | 23,808 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 10:00:32 |
| 合計ジャッジ時間 | 1,460 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:34: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration]
8 | printf("%d\n", (int)ceil(abs(x) + abs(y) + r*(1 / sqrt(2.0)) * 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:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d %d %d", &x, &y, &r);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main() {
int x, y, r;
scanf("%d %d %d", &x, &y, &r);
printf("%d\n", (int)ceil(abs(x) + abs(y) + r*(1 / sqrt(2.0)) * 2));
return 0;
}
くれちー