結果

問題 No.701 ひとりしりとり
コンテスト
ユーザー terasa
提出日時 2022-06-09 21:07:33
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 1,015 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 130 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 84,480 KB
最終ジャッジ日時 2026-04-09 12:56:37
合計ジャッジ時間 2,727 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import pypyjit
import itertools
import heapq
import math
from collections import deque, defaultdict
import bisect
import random

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
pypyjit.set_param('max_unroll_recursion=-1')


def index_lt(a, x):
    'return largest index s.t. A[i] < x or -1 if it does not exist'
    return bisect.bisect_left(a, x) - 1


def index_le(a, x):
    'return largest index s.t. A[i] <= x or -1 if it does not exist'
    return bisect.bisect_right(a, x) - 1


def index_gt(a, x):
    'return smallest index s.t. A[i] > x or len(a) if it does not exist'
    return bisect.bisect_right(a, x)


def index_ge(a, x):
    'return smallest index s.t. A[i] >= x or len(a) if it does not exist'
    return bisect.bisect_left(a, x)


def generate(k):
    return random.sample(range(26), k)


N = int(input())
S = ['a']
for i in range(N):
    S = [S[-1]]
    for j in generate(19):
        S.append(chr(ord('a') + j))
    if i == N - 1:
        S[-1] = 'n'
    print(''.join(S))
0