結果
問題 | No.2158 X日後に全完するhibit君 |
ユーザー | 👑 chro_96 |
提出日時 | 2022-12-09 23:19:05 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,185 bytes |
コンパイル時間 | 396 ms |
コンパイル使用メモリ | 31,488 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-04-22 23:03:44 |
合計ジャッジ時間 | 1,126 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 1 ms
6,948 KB |
testcase_02 | WA | - |
testcase_03 | AC | 1 ms
6,940 KB |
testcase_04 | WA | - |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | WA | - |
testcase_07 | AC | 1 ms
6,940 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 1 ms
6,940 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 1 ms
6,940 KB |
testcase_16 | AC | 1 ms
6,940 KB |
testcase_17 | AC | 1 ms
6,940 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 0 ms
6,940 KB |
testcase_24 | WA | - |
testcase_25 | AC | 1 ms
6,940 KB |
testcase_26 | WA | - |
testcase_27 | AC | 1 ms
6,944 KB |
ソースコード
#include <stdio.h> void func (int pi, int k, int t, int n, double *prob, double tmp_prob) { if (t > 21) { return; } prob[t] += ((double)n)/((double)(pi-k)); if (n > 0) { func(pi, k, t+1, n, prob, tmp_prob*((double)n)/((double)(pi-k))); } if (pi-k-n > 0) { func(pi, k, t+1, n+1, prob, tmp_prob*((double)(pi-k-n))/((double)(pi-k))); } return; } int main () { int n = 0; int k = 0; int p[6] = {}; int s[6] = {}; int t[6] = {}; int res = 0; double e[5000] = {}; double ans = 0.0; int sum = 0; double prob[6][22] = {}; res = scanf("%d", &n); res = scanf("%d", &k); for (int i = 0; i < n; i++) { res = scanf("%d", p+i); res = scanf("%d", s+i); res = scanf("%d", t+i); sum += t[i]; } if (sum > 60) { printf("-1\n"); return 0; } for (int i = 0; i < 6; i++) { func(p[i], k, k+2, 1, prob[i], 1.0); } for (int i = 0; i < (1<<n); i++) { int is_ok = 1; int b = (1<<n)-1; while (b >= 0) { b &= i; if (e[b] > 0.0) { is_ok = 0; } b--; } if (is_ok > 0) { for (int i = 1; i < 22; i++) { } } } }