結果

問題 No.701 ひとりしりとり
ユーザー 双六双六
提出日時 2020-07-25 15:10:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 277 ms / 2,000 ms
コード長 940 bytes
コンパイル時間 1,193 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 80,600 KB
最終ジャッジ日時 2023-09-09 13:28:39
合計ジャッジ時間 3,379 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
73,248 KB
testcase_01 AC 112 ms
73,192 KB
testcase_02 AC 116 ms
72,956 KB
testcase_03 AC 117 ms
73,152 KB
testcase_04 AC 114 ms
73,432 KB
testcase_05 AC 117 ms
72,884 KB
testcase_06 AC 117 ms
73,428 KB
testcase_07 AC 116 ms
72,888 KB
testcase_08 AC 120 ms
77,788 KB
testcase_09 AC 144 ms
80,004 KB
testcase_10 AC 157 ms
79,900 KB
testcase_11 AC 277 ms
80,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

import random

#処理内容
def main():
	N = int(input())
	L = [chr(i) for i in range(97, 110)] + [chr(i) for i in range(111, 123)]
	rand = list(range(25))
	# print(chr(110))
	# print(len(L))
	if N == 1:
		print("n")
		return
	
	start = None
	for i in range(N - 1):
		if start == None:
			word = ""
			for j in range(19):
				word += L[random.randrange(25)]
			val = L[random.randrange(25)]
			start = val
			word += val
			print(word)
		else:
			word = start
			for j in range(18):
				word += L[random.randrange(25)]
			val = L[random.randrange(25)]
			start = val
			word += val
			print(word)

	word = start
	for j in range(18):
		word += L[random.randrange(25)]
	word += "n"
	print(word)
	
if __name__ == '__main__':
	main()
0