結果

問題 No.538 N.G.S.
ユーザー mamekinmamekin
提出日時 2017-06-30 22:30:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 748 bytes
コンパイル時間 1,123 ms
コンパイル使用メモリ 100,300 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 19:45:26
合計ジャッジ時間 2,299 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    int x, y, z;
    cin >> x >> y >> z;

    double r = (z - y) / (double)(y - x);
    double d = z - y * r;

    double tmp = z * r + d;
    int ans;
    if(tmp < 0.0)
        ans = (int)(tmp - 0.5);
    else
        ans = (int)(tmp + 0.5);
    cout << ans << endl;

    return 0;
}
0