結果
問題 | No.1771 A DELETEQ |
ユーザー | mkawa2 |
提出日時 | 2021-12-16 14:30:50 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 2,006 ms / 3,500 ms |
コード長 | 1,519 bytes |
コンパイル時間 | 338 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 84,260 KB |
最終ジャッジ日時 | 2024-09-13 11:04:46 |
合計ジャッジ時間 | 13,299 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 60 ms
75,236 KB |
testcase_01 | AC | 60 ms
75,964 KB |
testcase_02 | AC | 2,006 ms
82,848 KB |
testcase_03 | AC | 60 ms
76,344 KB |
testcase_04 | AC | 1,975 ms
83,696 KB |
testcase_05 | AC | 1,965 ms
82,532 KB |
testcase_06 | AC | 58 ms
75,980 KB |
testcase_07 | AC | 59 ms
75,664 KB |
testcase_08 | AC | 59 ms
75,892 KB |
testcase_09 | AC | 122 ms
81,208 KB |
testcase_10 | AC | 152 ms
80,608 KB |
testcase_11 | AC | 160 ms
80,480 KB |
testcase_12 | AC | 169 ms
79,936 KB |
testcase_13 | AC | 121 ms
79,724 KB |
testcase_14 | AC | 464 ms
83,320 KB |
testcase_15 | AC | 546 ms
83,112 KB |
testcase_16 | AC | 914 ms
82,740 KB |
testcase_17 | AC | 71 ms
79,016 KB |
testcase_18 | AC | 115 ms
79,732 KB |
testcase_19 | AC | 69 ms
81,020 KB |
testcase_20 | AC | 325 ms
84,260 KB |
testcase_21 | AC | 78 ms
79,800 KB |
testcase_22 | AC | 201 ms
82,920 KB |
testcase_23 | AC | 202 ms
82,992 KB |
testcase_24 | AC | 91 ms
79,812 KB |
testcase_25 | AC | 80 ms
81,084 KB |
testcase_26 | AC | 266 ms
82,860 KB |
testcase_27 | AC | 106 ms
79,740 KB |
testcase_28 | AC | 77 ms
79,860 KB |
evil_hand_1.txt | WA | - |
evil_hand_2.txt | WA | - |
evil_hand_3.txt | WA | - |
evil_random_1.txt | WA | - |
evil_random_2.txt | WA | - |
evil_random_3.txt | WA | - |
evil_random_4.txt | WA | - |
evil_random_5.txt | WA | - |
evil_random_6.txt | WA | - |
evil_random_7.txt | WA | - |
evil_random_8.txt | WA | - |
evil_random_9.txt | WA | - |
ソースコード
import sys # sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = 18446744073709551615 # inf = 4294967295 # md = 10**9+7 md = 998244353 def nHr(hn, hr): return nCr(hn+hr-1, hr-1) def nPr(com_n, com_r): if com_r < 0: return 0 if com_n < com_r: return 0 return fac[com_n]*ifac[com_n-com_r]%md def nCr(com_n, com_r): if com_r < 0: return 0 if com_n < com_r: return 0 return fac[com_n]*ifac[com_r]%md*ifac[com_n-com_r]%md # 準備 n_max = 200005 fac = [1] for i in range(1, n_max+1): fac.append(fac[-1]*i%md) ifac = [1]*(n_max+1) ifac[n_max] = pow(fac[n_max], md-2, md) for i in range(n_max-1, 1, -1): ifac[i] = ifac[i+1]*(i+1)%md x, y = LI() if x>4000 or y>4000: print(-1) exit() lim = min(x, y) ans = 0 for a in range(lim+1): for b in range(lim-a+1): ans += nCr(x+y-a-b*2, x-a-b)*nCr(y-b, y-a-b)%md*pow(2, a, md)%md ans %= md # pDB(a, b, ans) print(ans)