結果
| 問題 |
No.98 円を描こう
|
| コンテスト | |
| ユーザー |
TLwiegehtt
|
| 提出日時 | 2015-07-07 06:50:19 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 262 bytes |
| コンパイル時間 | 155 ms |
| コンパイル使用メモリ | 24,448 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 03:15:06 |
| 合計ジャッジ時間 | 678 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d %d", &x, &y);
| ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main(void){
int ans;
int x,y;
double len;
scanf("%d %d", &x, &y);
len = sqrt(1.0*x*x+y*y);
len = len*2.0;
if(floor(len) == ceil(len)){
len+=1;
}
ans = (int)ceil(len);
printf("%d\n", ans);
return 0;
}
TLwiegehtt