結果
| 問題 |
No.306 さいたま2008
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2016-07-19 12:22:04 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 255 bytes |
| コンパイル時間 | 427 ms |
| コンパイル使用メモリ | 57,368 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-02-14 12:13:21 |
| 合計ジャッジ時間 | 1,359 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
コンパイルメッセージ
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("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <stdio.h>
int main() {
// your code goes here
double x1,y1,x2,y2;
scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
if(y1==y2){
printf("%lf\n",y1);
}else{
double t=x2/(x1+x2);
printf("%lf\n",t*y1+(1-t)*y2);
}
return 0;
}
horiesiniti