結果
問題 | No.2397 ω冪 |
ユーザー | かつっぱ競プロ |
提出日時 | 2023-07-28 23:39:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,672 bytes |
コンパイル時間 | 198 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 115,432 KB |
最終ジャッジ日時 | 2024-10-06 22:07:46 |
合計ジャッジ時間 | 58,096 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,380 ms
109,096 KB |
testcase_01 | AC | 1,345 ms
110,068 KB |
testcase_02 | AC | 1,334 ms
110,564 KB |
testcase_03 | AC | 1,331 ms
110,112 KB |
testcase_04 | AC | 1,370 ms
110,756 KB |
testcase_05 | AC | 1,369 ms
111,096 KB |
testcase_06 | AC | 1,365 ms
110,896 KB |
testcase_07 | AC | 1,385 ms
110,760 KB |
testcase_08 | AC | 1,341 ms
110,964 KB |
testcase_09 | AC | 1,328 ms
110,888 KB |
testcase_10 | AC | 1,358 ms
110,824 KB |
testcase_11 | AC | 1,415 ms
110,560 KB |
testcase_12 | AC | 1,331 ms
110,828 KB |
testcase_13 | AC | 1,341 ms
110,760 KB |
testcase_14 | WA | - |
testcase_15 | AC | 1,341 ms
110,704 KB |
testcase_16 | AC | 1,332 ms
110,960 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 1,338 ms
110,884 KB |
testcase_20 | AC | 1,398 ms
110,564 KB |
testcase_21 | AC | 1,416 ms
110,572 KB |
testcase_22 | AC | 1,320 ms
110,844 KB |
testcase_23 | AC | 1,292 ms
110,888 KB |
testcase_24 | AC | 1,323 ms
110,852 KB |
testcase_25 | AC | 1,376 ms
110,844 KB |
testcase_26 | AC | 1,332 ms
111,080 KB |
testcase_27 | AC | 1,444 ms
110,884 KB |
testcase_28 | AC | 1,314 ms
111,096 KB |
testcase_29 | AC | 1,327 ms
110,852 KB |
testcase_30 | AC | 1,338 ms
110,852 KB |
testcase_31 | AC | 1,374 ms
110,820 KB |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 1,323 ms
110,852 KB |
testcase_35 | AC | 1,371 ms
110,760 KB |
testcase_36 | AC | 1,382 ms
114,016 KB |
testcase_37 | AC | 1,350 ms
113,792 KB |
testcase_38 | AC | 1,340 ms
114,080 KB |
testcase_39 | AC | 1,324 ms
114,076 KB |
testcase_40 | AC | 1,323 ms
115,432 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 #print(order) #print(order2[:10]) #print(group[:5]) 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")