結果

問題 No.456 Millions of Submits!
ユーザー imulanimulan
提出日時 2016-12-07 22:38:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,568 bytes
コンパイル時間 1,843 ms
コンパイル使用メモリ 177,092 KB
実行使用メモリ 10,816 KB
最終ジャッジ日時 2023-09-05 06:31:40
合計ジャッジ時間 13,217 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,436 KB
testcase_01 AC 2 ms
6,088 KB
testcase_02 AC 2 ms
5,984 KB
testcase_03 AC 2 ms
5,888 KB
testcase_04 AC 3 ms
5,984 KB
testcase_05 WA -
testcase_06 AC 4 ms
5,944 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

typedef pair<double,int> P;

inline double f(double x, int a, int b)
{
    return pow(x,a)*pow(log(x),b);
}

const int N=1000000;
double l[N],r[N];

int main()
{
    int m;
    scanf(" %d", &m);

    vector<P> q[11][11];
    rep(i,m)
    {
        int a,b;
        double t;
        scanf(" %d %d %lf", &a, &b, &t);

        q[a][b].pb(P(t,i));

        l[i]=1;
        r[i]=100000;
    }

    rep(a,11)rep(b,11)
    {
        // printf("a,b %d %d\n", a,b);
        // cout << "size = " << q[a][b].size() << endl;
        rep(times,100)
        {
            map<double,vector<P>> query;
            rep(i,q[a][b].size())
            {
                int idx=q[a][b][i].se;
                double mid=(l[idx]+r[idx])/2;
                query[mid].pb(q[a][b][i]);
                // printf("mid= %f\n", mid);
            }

            for(const auto &v:query)
            {
                double mid = v.fi;
                vector<P> qs = v.se;
                rep(i,qs.size())
                {
                    double t=qs[i].fi;
                    int idx=qs[i].se;
                    if(f(mid,a,b)<=t) l[idx]=mid;
                    else r[idx]=mid;
                }
            }
        }
    }

    rep(i,m) printf("%.15f\n", (l[i]+r[i])/2);
    return 0;
}
0