結果

問題 No.172 UFOを捕まえろ
ユーザー z615533z615533
提出日時 2018-09-28 16:36:07
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 294 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 30,592 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 04:53:25
合計ジャッジ時間 1,000 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d %d %d",&x,&y,&z);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>
#include <cstdlib>

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;
}
0