結果

問題 No.313 π
ユーザー fmhrfmhr
提出日時 2015-12-06 23:26:58
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 583 bytes
コンパイル時間 1,441 ms
コンパイル使用メモリ 86,588 KB
実行使用メモリ 216,508 KB
最終ジャッジ日時 2023-10-12 17:47:38
合計ジャッジ時間 8,190 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,304 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_pi():
	q, r, t, k, m, x = 1, 0, 1, 1, 3, 3
	for j in range(200003):
		if 4 * q + r - t < m * t:
			yield m
			q, r, t, k, m, x = 10*q, 10*(r-m*t), t, k, (10*(3*q+r))//t - 10*m, x
		else:
			q, r, t, k, m, x = q*k, (2*q+r)*x, t*x, k+1, (q*(7*k+2)+r*x)//(t*x), x+2


def main():
	s = input()
	if s[0] != '3':
		print(s[0],'3')
		return
	if s[1] != '.':
		print(s[1],'.')
		return
	digits = make_pi()
	pi_list = []
	my_array = []
	for i in make_pi():
		my_array.append(str(i))
	for i in range(len(s)):
		if s[2+i]!=my_array[1+i]:
			print(s[2+i],my_array[1+i])
			return
main()
0