結果
問題 | No.2397 ω冪 |
ユーザー | かつっぱ競プロ |
提出日時 | 2023-07-28 23:33:25 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,618 bytes |
コンパイル時間 | 419 ms |
コンパイル使用メモリ | 82,440 KB |
実行使用メモリ | 117,864 KB |
最終ジャッジ日時 | 2024-10-06 21:57:07 |
合計ジャッジ時間 | 50,811 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,560 ms
109,928 KB |
testcase_01 | AC | 1,555 ms
110,488 KB |
testcase_02 | AC | 1,569 ms
111,212 KB |
testcase_03 | AC | 1,552 ms
110,872 KB |
testcase_04 | AC | 1,578 ms
111,768 KB |
testcase_05 | AC | 1,584 ms
111,464 KB |
testcase_06 | AC | 1,581 ms
111,552 KB |
testcase_07 | AC | 1,589 ms
111,456 KB |
testcase_08 | AC | 1,550 ms
111,340 KB |
testcase_09 | AC | 1,558 ms
111,772 KB |
testcase_10 | AC | 1,560 ms
111,572 KB |
testcase_11 | AC | 1,595 ms
111,468 KB |
testcase_12 | AC | 1,551 ms
111,500 KB |
testcase_13 | AC | 1,579 ms
111,384 KB |
testcase_14 | WA | - |
testcase_15 | AC | 1,574 ms
111,388 KB |
testcase_16 | AC | 1,567 ms
111,264 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 1,556 ms
111,508 KB |
testcase_20 | AC | 1,557 ms
111,212 KB |
testcase_21 | AC | 1,551 ms
111,464 KB |
testcase_22 | AC | 1,558 ms
111,332 KB |
testcase_23 | AC | 1,552 ms
111,344 KB |
testcase_24 | AC | 1,548 ms
111,252 KB |
testcase_25 | AC | 1,540 ms
111,468 KB |
testcase_26 | AC | 1,544 ms
111,328 KB |
testcase_27 | AC | 1,559 ms
111,448 KB |
testcase_28 | AC | 1,545 ms
111,592 KB |
testcase_29 | AC | 1,538 ms
111,724 KB |
testcase_30 | AC | 1,539 ms
111,208 KB |
testcase_31 | AC | 1,544 ms
111,480 KB |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 1,557 ms
111,092 KB |
testcase_35 | AC | 1,530 ms
111,732 KB |
testcase_36 | AC | 1,598 ms
116,588 KB |
testcase_37 | AC | 1,550 ms
116,456 KB |
testcase_38 | AC | 1,551 ms
116,712 KB |
testcase_39 | AC | 1,565 ms
117,104 KB |
testcase_40 | AC | 1,551 ms
117,864 KB |
ソースコード
from collections import defaultdict order = [[0], [1]] def toCnt(x): if x == 0:return defaultdict(int) k = 0 while x % 2 == 0: x //= 2 k += 1 tmp = toCnt(x // 2) tmp[k] += 1 return tmp # x > y def gt(x, y): xCnt = toCnt(x) yCnt = toCnt(y) for ps in order[::-1]: xSum = 0 ySum = 0 for p in ps: xSum += xCnt[p] ySum += yCnt[p] if xSum != ySum: return xSum > ySum return False for i in range(2, 20): k = 0 while k < len(order) and gt(i, order[k][0]): k += 1 if k < len(order) and not gt(order[k][0], i): order[k].append(i) else: order.insert(k, [i]) def toCnt2(x): xCnt = toCnt(x) cnt = [0] * len(order) for i in range(len(order)): for p in order[i]: cnt[i] = xCnt[p] return cnt[::-1] order2 = sorted(range(10**5), key=toCnt2) group = [] for v in order2: if len(group) == 0 or toCnt2(group[-1][0]) != toCnt2(v): group.append([v]) else: group[-1].append(v) rank = [0] * 10**5 for i in range(len(group)): for v in group[i]: rank[v] = i def cnt3(N): nCnt = [0] * (10 ** 5) if(N == '0'): return nCnt nOne = [] for i in range(len(N)): if(N[i] == '1'): nOne.append(i) nOne.append(len(N)) for i in range(len(nOne) - 1): nCnt[rank[nOne[i+1] - nOne[i] - 1]] += 1 return nCnt[::-1] nCnt = cnt3(input()) mCnt = cnt3(input()) if nCnt < mCnt: print("Yes") else: print("No")