結果
| 問題 |
No.538 N.G.S.
|
| コンテスト | |
| ユーザー |
gzlcp
|
| 提出日時 | 2017-07-19 04:51:25 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 512 bytes |
| コンパイル時間 | 756 ms |
| コンパイル使用メモリ | 91,188 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-25 00:18:45 |
| 合計ジャッジ時間 | 2,014 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 51 |
ソースコード
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define EPS 1e-6
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;
int main() {
ll b1, b2, b3;
cin>>b1>>b2>>b3;
long double r, d;
r = (b2 - b3) / (long double)(b1 - b2);
d = b2 - r * b1;
long double res = r * b3 + d;
if(res >= 0) cout<<(ll)(res + EPS)<<endl;
else cout<<(ll)(res - EPS)<<endl;
}
gzlcp