結果

問題 No.701 ひとりしりとり
ユーザー kobaya0514
提出日時 2018-06-15 23:31:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-30 15:31:26
合計ジャッジ時間 3,192 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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