結果
問題 | No.313 π |
ユーザー |
|
提出日時 | 2015-12-06 16:28:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 740 bytes |
コンパイル時間 | 239 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 16,984 KB |
最終ジャッジ日時 | 2024-09-14 15:23:23 |
合計ジャッジ時間 | 6,946 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 TLE * 1 |
other | -- * 32 |
ソースコード
def Pi_Spigot():''' The spigot algorithm for digits of Pi.Rosetta code の以下のコードを借用。http://rosettacode.org/wiki/Pi#Python'''q, r, t, k, n, l = 1, 0, 1, 1, 3, 3while True:if 4 * q + r - t < n * t:yield nnr = 10 * (r - n * t)n = ((10 * (3 * q + r))//t) - 10 * nq *= 10r = nrelse:nr = (2 * q + r) * lnn = (q * (7 * k) + 2 + (r * l))//(t * l)q *= kt *= ll += 2k += 1n = nnr = nrS = input()S = S[0] + S[2:]i = 0for p in Pi_Spigot():if p != int(S[i]):print(S[i], p)breaki += 1