結果
| 問題 |
No.98 円を描こう
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-12-23 17:14:56 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 231 bytes |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 23,936 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 03:15:05 |
| 合計ジャッジ時間 | 639 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d %d",&x,&y);
| ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<math.h>
int main()
{
int x,y,i;
double d;
scanf("%d %d",&x,&y);
d=sqrt(x*x+y*y);
for (i=1;;i++) {
if (d<i/2.0 && i/2.0<=d+1) {
break;
}
}
printf("%d\n",i);
return 0;
}