QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#592570 | #9307. Clock Master | real_sigma_team# | RE | 0ms | 4112kb | C++23 | 1.2kb | 2024-09-26 23:42:05 | 2024-09-26 23:42:06 |
Judging History
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...