結果
問題 | No.294 SuperFizzBuzz |
ユーザー | fmhr |
提出日時 | 2015-10-25 18:10:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,564 bytes |
コンパイル時間 | 334 ms |
コンパイル使用メモリ | 82,068 KB |
実行使用メモリ | 75,928 KB |
最終ジャッジ日時 | 2024-09-13 09:02:12 |
合計ジャッジ時間 | 5,201 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
52,600 KB |
testcase_01 | AC | 42 ms
55,092 KB |
testcase_02 | AC | 40 ms
53,340 KB |
testcase_03 | AC | 40 ms
53,808 KB |
testcase_04 | AC | 40 ms
53,124 KB |
testcase_05 | AC | 40 ms
54,008 KB |
testcase_06 | AC | 59 ms
70,896 KB |
testcase_07 | AC | 78 ms
75,928 KB |
testcase_08 | AC | 411 ms
75,596 KB |
testcase_09 | AC | 713 ms
75,448 KB |
testcase_10 | WA | - |
testcase_11 | AC | 136 ms
75,676 KB |
testcase_12 | AC | 442 ms
75,720 KB |
testcase_13 | AC | 538 ms
75,640 KB |
testcase_14 | AC | 787 ms
75,652 KB |
ソースコード
# coding:utf-8 import sys ume_i=[0, 19, 20, 20, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25] ume_j=[0,75711, 151419, 751427, 302841, 902867, 1502853, 5699, 605701, 1205719, 1805703, 2405735, 3005701, 3605711, 11401, 611385, 1211401, 1811391, 2411421, 3011415, 3611383, 4211407, 4811419, 5411397, 6011395, 6611385, 7211393, 7811395, 22793, 622799, 1222795, 1822785, 2422789, 3022785, 3622775, 4222781, 4822807, 5422785, 6022785, 6622785, 7222771, 7822783, 8422785, 9022791, 9622769, 10222757, 10822781, 11422765, 12022781, 12622791, 13222757, 13822781, 14422783, 15022781, 15622793, 16222799, 45571, 645581, 1245591, 1845571, 2445581, 3045545, 3645561, 4245563, 4845567, 5445567, 6045557, 6645539, 7245557, 7845545, 8445561, 9045557, 9645563, 10245539, 10845557, 11445545, 12045553, 12645561, 13245557, 13845559, 14445575, 15045563, 15645565, 16245553, 16845567, 17445591, 18045541, 18645545, 19245537, 19845569, 20445563, 21045561, 21645557, 22245545, 22845567, 23445569, 24045561, 24645569, 25245579, 25845563, 26445559] def popcount(x): return bin(x).count("1") #def popcount(n): # n = (n & 0x5555555555555555) + ((n & 0xAAAAAAAAAAAAAAAA) >> 1) # n = (n & 0x3333333333333333) + ((n & 0xCCCCCCCCCCCCCCCC) >> 2) # n = (n & 0x0F0F0F0F0F0F0F0F) + ((n & 0xF0F0F0F0F0F0F0F0) >> 4) # n = (n & 0x00FF00FF00FF00FF) + ((n & 0xFF00FF00FF00FF00) >> 8) # n = (n & 0x0000FFFF0000FFFF) + ((n & 0xFFFF0000FFFF0000) >> 16) # n = (n & 0x00000000FFFFFFFF) + ((n & 0xFFFFFFFF00000000) >> 32) # return n # if N in ume: # print(ume.index(N)) # sys.exit() # else: def solve(): N = int(input()) count = 0 # 100000毎にume # ume_i = [] # ume_j = [] # c = 1000000 p = int(N/100000) start_i = ume_i[p] start_j = ume_j[p] if p!=0: count = p*100000-1 x = 0 for i in range(start_i,26): for j in range(start_j,10000000000000): a = bin(j)[2:] if len(a)>i: break if popcount(j)%3==0 and popcount(j)>=3 and a[-1]=='1': count += 1 # ==== # if count == c: # ume_i.append(i) # ume_j.append(j) # c += 1000000 # ==== if count==N: a = '0'*(i-len(a))+a n = a.replace('0', '3').replace('1', '5') x = ''.join(n) x = int(x) print(x) sys.exit() solve()