結果
| 問題 |
No.172 UFOを捕まえろ
|
| コンテスト | |
| ユーザー |
piyoko_212
|
| 提出日時 | 2015-12-28 22:31:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 238 bytes |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 39,372 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 14:34:35 |
| 合計ジャッジ時間 | 930 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d%d%d",&a,&b,&c);
| ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int A=a-b;
if(A<0)A=-A;
int B=a+b;
if(B<0)B=-B;
double s=max(A,B)+sqrt(2.0)*c;
printf("%d\n",(int)s+1);
}
piyoko_212