結果
| 問題 |
No.219 巨大数の概算
|
| コンテスト | |
| ユーザー |
sue_charo
|
| 提出日時 | 2017-07-21 20:23:01 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 907 bytes |
| コンパイル時間 | 294 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 33,812 KB |
| 最終ジャッジ日時 | 2024-10-09 03:40:40 |
| 合計ジャッジ時間 | 6,851 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 50 |
ソースコード
# coding: utf-8
import collections, copy, heapq, itertools, math, sys
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}
def read():
N = II()
A_B = [ILI() for __ in range(N)]
return N, A_B
def solve(N, A_B):
ans = []
for A, B in A_B:
num = A ** B
s_num = str(num)
len_num = len(s_num)
if len_num == 1:
X = 0
Y = num
Z = 1
else:
X = s_num[0]
Y = s_num[1]
Z = len_num - 1
ans.append("{} {} {}".format(X, Y, Z))
ans = "\n".join(map(str, ans))
return ans
def main():
params = read()
print(solve(*params))
if __name__ == "__main__":
main()
sue_charo