結果

問題 No.2246 1333-like Number
ユーザー FromBooskaFromBooska
提出日時 2023-05-01 09:06:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 53,596 KB
最終ジャッジ日時 2024-04-30 14:09:13
合計ジャッジ時間 2,043 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,460 KB
testcase_01 AC 33 ms
52,408 KB
testcase_02 AC 32 ms
53,296 KB
testcase_03 AC 32 ms
53,160 KB
testcase_04 AC 34 ms
52,644 KB
testcase_05 AC 33 ms
52,428 KB
testcase_06 AC 31 ms
52,312 KB
testcase_07 AC 32 ms
52,620 KB
testcase_08 AC 32 ms
53,212 KB
testcase_09 AC 32 ms
52,792 KB
testcase_10 AC 33 ms
52,356 KB
testcase_11 AC 35 ms
52,544 KB
testcase_12 AC 33 ms
52,332 KB
testcase_13 AC 37 ms
52,268 KB
testcase_14 AC 33 ms
53,148 KB
testcase_15 AC 33 ms
52,640 KB
testcase_16 AC 35 ms
52,608 KB
testcase_17 AC 33 ms
53,012 KB
testcase_18 AC 33 ms
53,072 KB
testcase_19 AC 32 ms
53,288 KB
testcase_20 AC 36 ms
52,872 KB
testcase_21 AC 36 ms
52,756 KB
testcase_22 AC 36 ms
53,268 KB
testcase_23 AC 36 ms
52,824 KB
testcase_24 AC 37 ms
53,596 KB
testcase_25 AC 36 ms
52,684 KB
testcase_26 AC 35 ms
52,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 12222, 133333, 255555などになるはず
# たとえば2桁なら12, 13, 14, 15, ---, 78, 79, 89まで
# 3桁でも同じ個数しかない122, 133, 144, ---, 788, 799, 899
# ということはまず2桁のリストを作ればいい

two_digit = []
for a in range(1, 10):
    for b in range(a+1, 10):
        num = a*10+b
        two_digit.append(num)
        
#print(two_digit)
count = len(two_digit)
#print(count)

N = int(input())
N -= 1
rnd = N//count
remainder = N-count*rnd
base = two_digit[remainder]
#print(base)
ans = str(base) + str(base)[-1]*(rnd)
print(ans)
0