結果
| 問題 |
No.172 UFOを捕まえろ
|
| コンテスト | |
| ユーザー |
z615533
|
| 提出日時 | 2018-09-28 16:34:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 275 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 30,336 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 04:53:21 |
| 合計ジャッジ時間 | 998 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d %d %d",&x,&y,&z);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main() {
int x,y,z,x1,y1,z2;
double z1;
int result;
scanf("%d %d %d",&x,&y,&z);
x1 = abs(x);
y1 = abs(y);
z1 = sqrt(2.0)*(double)z;
z2 = (int)z1;
result = x1 + y1 + z2 + 1;
printf("%d\n",result);
return 0;
}
z615533