結果

問題 No.550 夏休みの思い出(1)
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2017-07-30 18:53:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,093 bytes
コンパイル時間 1,560 ms
コンパイル使用メモリ 164,808 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 05:59:51
合計ジャッジ時間 3,244 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,940 KB
testcase_02 WA -
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 WA -
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
6,948 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
6,940 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 1 ms
6,944 KB
testcase_27 AC 1 ms
6,944 KB
testcase_28 AC 2 ms
6,944 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 AC 2 ms
6,944 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 2 ms
6,944 KB
testcase_35 AC 2 ms
6,944 KB
testcase_36 WA -
testcase_37 AC 2 ms
6,940 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 2 ms
6,940 KB
testcase_41 AC 2 ms
6,940 KB
testcase_42 AC 1 ms
6,944 KB
testcase_43 AC 2 ms
6,940 KB
testcase_44 AC 2 ms
6,944 KB
testcase_45 AC 2 ms
6,940 KB
testcase_46 AC 2 ms
6,940 KB
testcase_47 AC 2 ms
6,944 KB
testcase_48 AC 2 ms
6,940 KB
testcase_49 AC 2 ms
6,940 KB
testcase_50 AC 2 ms
6,940 KB
testcase_51 AC 2 ms
6,940 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 2 ms
6,940 KB
testcase_55 AC 2 ms
6,944 KB
testcase_56 AC 2 ms
6,940 KB
testcase_57 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/








typedef long long ll;
#define double long double
#define EPS 0
ll A, B, C; double a, b, c;
//---------------------------------------------------------------------------------------------------
__int128_t f(__int128_t x) { return x*x*x + a*x*x + b*x + c; }
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A >> B >> C;

    a = A, b = B, c = C;
    double d = (-a - sqrt(a *a - 3 * b)) / 3;
    double e = (-a + sqrt(a *a - 3 * b)) / 3;

    ll low, high;

    low = -1010101010LL, high = floor(d);
    while (low + 1 != high) {
        ll x = (low + high) / 2;
        if (0 <= f(x)) high = x;
        else low = x;
    }
    printf("%lld ", high);

    high = ceil(d), low = floor(e);
    if (high != low) {
        while (high + 1 != low) {
            ll x = (low + high) / 2;
            if (0 <= f(x)) high = x;
            else low = x;
        }
    }
    printf("%lld ", high);

    low = floor(e), high = 1010101010LL;
    while (low + 1 != high) {
        ll x = (low + high) / 2;
        if (0 <= f(x)) high = x;
        else low = x;
    }
    printf("%lld\n", high);
}
0