結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2016-09-09 23:20:09 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 480 bytes |
コンパイル時間 | 126 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 26,752 KB |
最終ジャッジ日時 | 2024-11-16 18:36:12 |
合計ジャッジ時間 | 43,805 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 RE * 3 TLE * 21 |
ソースコード
import itertools x = int(input()) ans_count = 0 ans_sum = 0 if x < 31 - x: for v in itertools.combinations(range(31), x): s = ['0'] * 31 ans_count += 1 for i in v: s[i] = '1' ans_sum += int(''.join(s), base=2) else: for v in itertools.combinations(range(31), 31 - x): s = ['1'] * 31 ans_count += 1 for i in v: s[i] = '0' ans_sum += int(''.join(s), base=2) print(ans_count, ans_sum)