結果

問題 No.219 巨大数の概算
コンテスト
ユーザー taba
提出日時 2016-04-16 06:44:12
言語 PyPy2
(7.3.20)
結果
WA  
実行時間 -
コード長 269 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 362 ms
コンパイル使用メモリ 77,176 KB
最終ジャッジ日時 2025-12-03 20:25:28
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 47 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math
n=input()
def P(a,b):
	r=1
	while b>0:
		if b&1==0:
			a*=a
			b/=2
		else:
			r*=a
			b-=1
		while a>=10:
			a/=10.
		while r>=10:
			r/=10.
	return `r`[:3:2]
for i in xrange(n):
	a,b=map(int,raw_input().split())
	x,y=P(a,b)
	print x,y,int(math.log10(a)*b)
0