結果

問題 No.3623 2-Letter Shiritori 2
コンテスト
ユーザー LyricalMaestro
提出日時 2026-08-18 02:20:04
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 66 ms / 2,000 ms
+ 886µs
コード長 926 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 477 ms
コンパイル使用メモリ 96,108 KB
実行使用メモリ 78,848 KB
最終ジャッジ日時 2026-08-18 02:20:06
合計ジャッジ時間 1,460 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# https://yukicoder.me/problems/no/3623
 


def main():
    answer = []
    # 1巡目
    for s in range(26):
        answer.append((s, s))
        if s < 13:
            answer.append((s, s + 13))
            answer.append((s + 13, s))

        if s < 2:
            for d in range(2, 26, 2):
                for j in range(13):
                    s_ = (s + d * j) % 26
                    t_ = (s + d * (j + 1)) % 26
                    answer.append((s_, t_))
        answer.append((s, (s + 1) % 26))

    s = 0
    for d in range(2, 26):
        if d % 2 != 0 and d % 13 != 0:
            for j in range(26):
                s_ = (s + d * j) % 26
                t_ = (s + d * (j + 1)) % 26
                answer.append((s_, t_))
    
    for a in answer:
        a0 = ""
        a0 += chr(a[0] + ord("A"))        
        a0 += chr(a[1] + ord("A"))        
        print(a0)







if __name__ == "__main__":
    main()
0