結果

問題 No.701 ひとりしりとり
ユーザー kobaya0514kobaya0514
提出日時 2018-06-15 23:31:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 8,304 KB
最終ジャッジ日時 2023-09-13 05:21:26
合計ジャッジ時間 3,322 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
8,080 KB
testcase_02 AC 15 ms
8,120 KB
testcase_03 AC 15 ms
8,168 KB
testcase_04 AC 15 ms
8,128 KB
testcase_05 AC 15 ms
8,096 KB
testcase_06 AC 15 ms
8,160 KB
testcase_07 AC 15 ms
8,116 KB
testcase_08 AC 15 ms
8,168 KB
testcase_09 AC 16 ms
8,304 KB
testcase_10 AC 25 ms
8,140 KB
testcase_11 AC 120 ms
8,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n=int(input())

def solve(a):
  ans="abcdefghi"
  cnt_str="abcdefghijklmopqrstuvwxyz"
  cnt=0
  for s in itertools.permutations(ans):
    start=cnt%25
    end=start+1
    if end==25:
      end=0
    print(cnt_str[start]+"".join(list(s))+cnt_str[end])
    cnt+=1
    if cnt==(a-1):
      print(cnt_str[end]+"".join(list(s))+"n")
      break
  return

solve(n)
0