QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#790587 | #9307. Clock Master | IllusionaryDominance# | WA | 25ms | 4512kb | C++20 | 941b | 2024-11-28 13:44:52 | 2024-11-28 13:44:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 30000 + 5;
int pri[MAX_N], pcnt;
char np[MAX_N];
int v[MAX_N], M;
double w[MAX_N], f[MAX_N];
void init() {
for (int i = 2; i < MAX_N; i ++) {
if (!np[i]) {
pri[++ pcnt] = i;
for (int j = i; j < MAX_N; j *= i) {
M ++;
v[M] = j;
w[M] = log(j);
}
}
for (int j = 1; j <= pcnt && i * pri[j] < MAX_N; j ++) {
np[i * pri[j]] = 1;
if (i % pri[j] == 0) break;
}
}
for (int i = 1; i <= M; i ++) {
for (int j = MAX_N - 1; j >= v[i]; j --) {
f[j] = max(f[j], f[j - v[i]] + w[i]);
}
}
}
int main() {
init();
int T;
scanf("%d", &T);
while (T --) {
int x;
scanf("%d", &x);
printf("%.10lf\n", f[x]);
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 24ms
memory: 4512kb
input:
3 2 7 10
output:
0.6931471806 2.4849066498 3.4011973817
result:
ok 3 numbers
Test #2:
score: -100
Wrong Answer
time: 25ms
memory: 4444kb
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:
67.8834674004 223.5402209187 224.8432633993 115.1467322756 13.7756880638 97.6733655707 106.0445378392 167.5620879794 152.4302563778 49.3669742372 143.6084836677 152.4909133296 192.2138987432 213.3645067165 76.3667480056 45.6534021705 129.7378310502 101.6760457813 177.5135183602 146.4564467660 182.52...
result:
wrong answer 1st numbers differ - expected: '59.8085219', found: '67.8834674', error = '0.1350133'