QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#592570#9307. Clock Masterreal_sigma_team#RE 0ms4112kbC++231.2kb2024-09-26 23:42:052024-09-26 23:42:06

Judging History

你现在查看的是最新测评结果

  • [2024-09-26 23:42:06]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:4112kb
  • [2024-09-26 23:42:05]
  • 提交

answer

#include <bits/stdc++.h>
#include <immintrin.h>

using namespace std;

using ll = long long;
using ld = long double;
# define x first
# define y second
# define all(x) x.begin(), x.end()
# define rall(x) x.rbegin(), x.rend()

mt19937 mt(123);

void solve();
void init();

const int A = 12;
double buba[A], nw[A];
bool prime[A];

int32_t main() {
#ifndef LOCAL
    cin.tie(nullptr)->sync_with_stdio(false);
#endif
    cout << fixed << setprecision(30);
    init();
    fill(prime + 2, prime + A, true);
    vector<int> items;
    for (int i = 2; i < A; ++i) {
        if (prime[i]) {
            items.push_back(i);
            for (int j = 2 * i; j < A; j += i) prime[j] = false;
        }
    }
    for (auto x : items) {
        for (int i = A - 1; i >= 0; --i) {
            double ss = log(x);
            double qq = ss;
            for (int p = x; i + p < A; p *= x, qq += ss) {
                buba[i + p] = max(buba[i + p], buba[i] + qq);
            }
        }
    }
    cout << fixed << setprecision(10);
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
}

void init() {}

void solve() {
    int b;
    cin >> b;
    cout << buba[b] << '\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4112kb

input:

3
2
7
10

output:

0.6931471806
2.4849066498
3.4011973817

result:

ok 3 numbers

Test #2:

score: -100
Runtime Error

input:

5000
580
4555
4654
1420
53
1076
1226
2733
2285
348
2104
2293
3447
4208
710
307
1763
1142
3027
2151
3182
1546
3398
867
2380
830
4211
3117
3058
2251
1890
3961
4003
3991
4167
4976
1765
3235
2644
4070
4644
3645
875
3005
4769
4934
3846
2941
255
946
4164
1372
1193
3056
4472
508
3949
2473
4490
88
4014
2953...

output:


result: