結果

問題 No.538 N.G.S.
ユーザー nanophoto12nanophoto12
提出日時 2017-08-16 15:14:07
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 823 bytes
コンパイル時間 701 ms
コンパイル使用メモリ 89,992 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 12:53:01
合計ジャッジ時間 2,055 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>
#include <stack>

using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> t3;

ll dp[100010];

int main()
{
    int b1,b2,b3;
    cin >> b1 >> b2 >> b3;
    if(b2 == 0 && b3 == 0)
    {
        cout << 0 << endl;
        return 0;
    }
    double d1 = b2 - b1;
    double d2 = b3 - b2;
    double r = d2 / d1;
    double d = b2 - r * b1;
    //cout << "r:" << r << ",d:" << d << endl;
    double result = b3 * r + d;
    cout << (int)round(result) << endl;
    return 0;
}
0