結果
| 問題 | No.1694 ZerOne |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-07 07:33:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 312 bytes |
| 記録 | |
| コンパイル時間 | 198 ms |
| コンパイル使用メモリ | 82,168 KB |
| 実行使用メモリ | 82,544 KB |
| 最終ジャッジ日時 | 2024-07-23 03:04:07 |
| 合計ジャッジ時間 | 3,869 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 30 |
ソースコード
from itertools import combinations
S=input()
popcount=0
digitsum=0
for i in range(len(S)):
if S[i]=="1":
popcount+=1
digitsum+=i+1
if popcount*(popcount+1)//2>digitsum:
print(0)
else:
ans=0
for num in combinations(range(1,len(S)+1),popcount):
if sum(num)==digitsum:
ans+=1
print(ans)