QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#105404 | #4230. Leaderboard Effect | marsxiang5902# | AC ✓ | 1142ms | 106004kb | C++17 | 1.3kb | 2023-05-14 00:18:37 | 2023-05-14 00:18:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int MN = 17, MT = 105, MS = 1<<MN;
const double EPS = 1e-13;
int N, T, rt[MN], ct[MN]; double ps[MN];
double ft[MT][1<<MN], solves[MT][MN];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> N >> T;
for (int i = 0; i < N; i++)
cin >> rt[i] >> ct[i] >> ps[i];
ft[0][0] = 1;
for (int t = 0; t <= T; t++) {
for (int b = 0; b < 1<<N; b++) {
double den = 0;
for (int i = 0; i < N; i++)
if (~b&1<<i)
den += solves[t][i];
for (int i = 0; i < N; i++)
if (~b&1<<i) {
double x = ft[t][b] * (den < EPS ?
1. / (N-__builtin_popcount(b)) : solves[t][i] / den);
if (t+rt[i] <= T) {
ft[t+rt[i]][b|1<<i] += x * (1-ps[i]);
}
if (t+rt[i]+ct[i] <= T) {
ft[t+rt[i]+ct[i]][b|1<<i] += x * ps[i];
solves[t+rt[i]+ct[i]][i] += x * ps[i];
}
}
}
for (int i = 0; i < N; i++)
solves[t+1][i] += solves[t][i];
}
for (int i = 0; i < N; i++)
printf("%.8f\n", solves[T][i]);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3928kb
input:
4 42 10 10 0.75 10 10 0.75 10 12 1 10 12 1
output:
0.45625000 0.45625000 0.29687500 0.29687500
result:
ok 4 numbers
Test #2:
score: 0
Accepted
time: 2ms
memory: 3804kb
input:
4 42 10 12 0.75 10 12 0.75 10 10 1 10 10 1
output:
0.20312500 0.20312500 0.68323864 0.68323864
result:
ok 4 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
5 100 40 60 0.6 40 61 1 10 40 0.3 10 40 0.4 10 40 0.5
output:
0.12000000 0.00000000 0.11262857 0.15973968 0.20644444
result:
ok 5 numbers
Test #4:
score: 0
Accepted
time: 264ms
memory: 29672kb
input:
15 100 4 14 0.954205412740471 5 11 0.264054003774017 1 7 0.521673865442381 3 12 0.6756938980261 1 15 0.980129050876819 2 12 0.836645892885326 10 3 0.959863273940343 13 6 0.230786407526669 3 13 0.0575791282076707 6 5 0.706328060881614 1 15 0.662404274712202 2 13 0.715327416279894 11 2 0.9275847467499...
output:
0.54668836 0.05551902 0.39362139 0.35087492 0.66742441 0.57122251 0.79995222 0.04000540 0.00614505 0.55125623 0.29998903 0.39126058 0.76047492 0.51880518 0.07174879
result:
ok 15 numbers
Test #5:
score: 0
Accepted
time: 525ms
memory: 55400kb
input:
16 100 1 8 0.203833126785817 1 10 0.551151943064124 1 12 0.996220861387656 1 7 0.198656409543208 2 2 0.467994369421028 8 3 0.201277956430612 1 10 0.33397726300295 1 8 0.223430703554389 3 12 0.715363922664928 9 6 0.883743052774488 1 9 0.51636293824285 2 7 0.00210327442137626 6 11 0.978989778915285 1 ...
output:
0.08588048 0.42529273 0.93741115 0.09222496 0.43399594 0.07552293 0.17343080 0.10175300 0.53493334 0.76513889 0.40857003 0.00023455 0.83749110 0.15063275 0.88919854 0.77605125
result:
ok 16 numbers
Test #6:
score: 0
Accepted
time: 497ms
memory: 54752kb
input:
16 100 36 30 0.246284470931766 40 2 0.00729886464249319 34 9 0.969806174971755 2 27 0.700168809611093 2 49 0.00964738878291982 11 13 0.843818712396597 23 15 0.015695164745825 2 11 0.860911871987035 8 39 0.759047449661107 33 17 0.156016479857797 5 40 0.704380590007194 2 36 0.0742940485679995 13 17 0....
output:
0.02241736 0.00067199 0.18813400 0.26740220 0.00080645 0.48120717 0.00150862 0.72890064 0.09353025 0.01441575 0.10047945 0.00790530 0.01610835 0.01146441 0.19344225 0.10854051
result:
ok 16 numbers
Test #7:
score: 0
Accepted
time: 2ms
memory: 3876kb
input:
2 100 44 23 0.344489870631275 18 13 0.617983603136949
output:
0.34448987 0.61798360
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 1142ms
memory: 106004kb
input:
17 100 1 6 0.618966248907732 1 6 0.126915204708293 4 7 0.35153234988752 2 3 0.0368548187261588 1 5 0.299571483949073 1 12 0.944530094804986 3 12 0.249408160616937 1 11 0.91317090384857 5 8 0.377638681694897 4 12 0.639080155811651 1 4 0.809300766237897 8 5 0.812731204986182 1 10 0.480107932016118 7 1...
output:
0.60972060 0.06641629 0.27596479 0.01163167 0.26539687 0.92761872 0.11045245 0.90002284 0.27245478 0.54441906 0.80755701 0.78743828 0.42419748 0.45328987 0.07108885 0.02305064 0.27663099
result:
ok 17 numbers
Test #9:
score: 0
Accepted
time: 968ms
memory: 90708kb
input:
17 85 8 6 0.9977 1 4 0.9459 5 9 0.0733 2 9 0.759 9 6 0.921 5 6 0.2015 2 8 0.9407 8 10 0.7806 5 3 0.864 4 4 0.0777 9 3 0.9518 8 2 0.8221 10 9 0.2471 4 8 0.4679 7 6 0.603 3 2 0.4067 5 5 0.8879
output:
0.58672452 0.91295342 0.00658062 0.42105609 0.46074979 0.03150304 0.74982986 0.24689806 0.74161589 0.00871656 0.63433834 0.59940764 0.03096626 0.14190175 0.22628927 0.28520295 0.68121595
result:
ok 17 numbers
Test #10:
score: 0
Accepted
time: 955ms
memory: 90860kb
input:
17 85 9 7 0.0563 7 7 0.1979 9 3 0.7689 1 6 0.0291 7 7 0.9631 5 8 0.847 8 6 0.6752 2 9 0.0396 4 2 0.6747 8 3 0.1071 8 4 0.5134 9 7 0.7491 6 8 0.3134 3 1 0.8355 4 5 0.5561 1 10 0.372 9 9 0.4515
output:
0.00549408 0.03723780 0.62943725 0.00354347 0.78102353 0.67715794 0.41080643 0.00374388 0.64244093 0.01655332 0.30380512 0.42383168 0.08619829 0.82697093 0.46128471 0.16376087 0.12859537
result:
ok 17 numbers
Test #11:
score: 0
Accepted
time: 997ms
memory: 90612kb
input:
17 85 1 7 0.1344 5 8 0.99 8 3 0.437 4 9 0.1375 3 2 0.8208 1 8 0.5922 10 6 0.655 8 5 0.8043 2 5 0.8447 5 10 0.3305 9 3 0.725 1 8 0.0394 6 5 0.8091 8 7 0.6427 9 6 0.7282 4 7 0.1024 1 6 0.4222
output:
0.02711503 0.79243716 0.20619678 0.02044318 0.79747439 0.42687881 0.28520395 0.55188338 0.79282214 0.08161989 0.49829325 0.00412196 0.64301075 0.29925802 0.38662524 0.01447454 0.27060757
result:
ok 17 numbers
Test #12:
score: 0
Accepted
time: 987ms
memory: 90728kb
input:
17 85 10 2 0.6556 3 1 0.7738 1 8 0.9047 3 10 0.9973 10 4 0.5266 8 1 0.4384 5 3 0.3559 3 6 0.7999 8 6 0.9665 3 4 0.142 7 5 0.0319 6 3 0.4056 6 10 0.0477 8 10 0.1334 5 8 0.8102 8 8 0.6 7 5 0.318
output:
0.39728913 0.76142213 0.83152020 0.78082780 0.19624489 0.25409024 0.19070461 0.70361579 0.68028082 0.03555314 0.00259539 0.21120366 0.00395479 0.01442606 0.52903049 0.21826075 0.08768449
result:
ok 17 numbers
Test #13:
score: 0
Accepted
time: 910ms
memory: 96988kb
input:
17 100 10 41 0.986344070444954 38 40 0.13596976314146 23 65 0.589188420670698 23 41 0.862487981086339 66 62 0.756039635351495 84 82 0.466671597793749 17 74 0.451825236037525 97 49 0.785964886639839 76 26 0.432545432217108 10 33 0.495053202758143 35 72 0.437261903429889 55 95 0.333190022475783 83 56 ...
output:
0.07155791 0.00853195 0.03578151 0.05741747 0.00000000 0.00000000 0.02657796 0.00000000 0.00000000 0.07617775 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
result:
ok 17 numbers
Test #14:
score: 0
Accepted
time: 976ms
memory: 96852kb
input:
17 100 52 66 0.608312285077897 77 36 0.182402129968963 43 16 0.906840075497175 75 100 0.508033408075313 25 60 0.688919263266595 84 59 0.17045120790047 75 9 0.831462171228754 16 69 0.185113485186001 71 54 0.372346884200038 90 65 0.235248490382517 62 50 0.917089563798644 47 45 0.717838729472597 56 51 ...
output:
0.00000000 0.00000000 0.06028281 0.00000000 0.04155354 0.00000000 0.05264229 0.01116549 0.00000000 0.00000000 0.00000000 0.04266143 0.00000000 0.04509807 0.00000000 0.03976723 0.05607487
result:
ok 17 numbers
Test #15:
score: 0
Accepted
time: 2ms
memory: 3924kb
input:
5 40 10 8 0.9 10 9 0.9 10 10 0.9 10 11 0.9 10 12 0.9
output:
0.53850000 0.37650000 0.24150000 0.23850000 0.23850000
result:
ok 5 numbers