結果

問題 No.2087 基数の変換
ユーザー Moss_Local
提出日時 2022-09-30 21:59:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 686 ms / 2,000 ms
コード長 833 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 47,088 KB
最終ジャッジ日時 2024-12-22 23:38:32
合計ジャッジ時間 35,166 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

from cgitb import reset
from collections import defaultdict
from functools import lru_cache
from sys import flags, stdin
import math
import re
import queue
from tokenize import String
import typing
import itertools
import bisect
import statistics
import numpy as np
# from numpy.core.function_base import _needs_add_docstring
# from numpy.core.numeric import outer
input = stdin.readline
MOD = 1000000007
INF = 122337203685477580


def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy > 0:
        out = str(X_dumy % n)+out
        X_dumy = int(X_dumy/n)
    return out


def solve():

    n = int(input().rstrip())
    m = int(input().rstrip())
    if m == 0:
        print(0)
        return

    # m is to change to base n
    p = Base_10_to_n(m, n)
    print(p)
    return


if __name__ == '__main__':
    solve()
0