結果

問題 No.456 Millions of Submits!
ユーザー ei1333333ei1333333
提出日時 2016-12-08 22:23:21
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 982 bytes
コンパイル時間 1,449 ms
コンパイル使用メモリ 155,080 KB
実行使用メモリ 49,176 KB
最終ジャッジ日時 2023-09-05 21:05:55
合計ジャッジ時間 10,646 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,756 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 10 ms
4,376 KB
testcase_08 AC 10 ms
4,376 KB
testcase_09 AC 75 ms
4,448 KB
testcase_10 AC 76 ms
4,444 KB
testcase_11 AC 742 ms
8,164 KB
testcase_12 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

vector< pair< double, int > > qs[11][11];
double ans[1000000];

double F(int A, int B, double mid)
{
  return (pow(mid, A) * pow(log(mid), B));
}

int main()
{
  int M;
  scanf("%d", &M);
  for(int i = 0; i < M; i++) {
    int A, B;
    double T;
    scanf("%d %d %lf", &A, &B, &T);
    qs[A][B].emplace_back(T, i);
  }

  for(int i = 0; i < 11; i++) {
    for(int j = 0; j < 11; j++) {

      map< double, double > vv;
      vv.emplace(0, 0);
      vv.emplace(1e5, 1e5);
      for(auto &k : qs[i][j]) {
        double low = (--vv.lower_bound(k.first))->second, high = vv.lower_bound(k.first)->second;
        while(high - low > 1e-9) {
          double mid = (low + high) * 0.5;
          double v = F(i, j, mid);
          vv.emplace(v, mid);
          if(v < k.first) low = mid;
          else high = mid;
        }
        ans[k.second] = low;
      }
    }
  }
  for(int i = 0; i < M; i++) {
    printf("%.12lf\n", ans[i]);
  }
}
0