結果

問題 No.492 IOI数列
ユーザー 6soukiti29
提出日時 2017-03-20 14:01:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 1,000 ms
コード長 300 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-07-05 03:18:48
合計ジャッジ時間 1,659 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

def f2(n):

	if n == 1:
		return 1
	if n % 2 == 0:
		s = f2(n // 2) * (pow(100, n // 2, 1000000007) + 1)
		s = s % 1000000007
	else:
		s = f2(n - 1) * 100 + 1
		s = s % 1000000007
	return s

print(f2(N))

N2 = (N % 11)
if N2 == 0:
	s2 = 0
else:
	s2 = "1" + "01" * (N2 - 1)
print(s2)
0