結果

問題 No.3081 Make Palindromic Multiple
ユーザー lam6er
提出日時 2025-03-31 17:46:25
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 835 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 82,704 KB
実行使用メモリ 68,096 KB
最終ジャッジ日時 2025-03-31 17:47:14
合計ジャッジ時間 13,381 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

def generate_beer():
    s = []
    for i in range(99, 1, -1):
        s.append(f"{i} bottles of beer on the wall, {i} bottles of beer.")
        s.append(f"Take one down and pass it around, {i-1} bottle{'s' if i-1 !=1 else ''} of beer on the wall.\n")
    s.append("1 bottle of beer on the wall, 1 bottle of beer.")
    s.append("Take one down and pass it around, no more bottles of beer on the wall.\n")
    s.append("No more bottles of beer on the wall, no more bottles of beer.")
    s.append("Go to the store and buy some more, 99 bottles of beer on the wall.")
    return '\n'.join(s)

beer_song = generate_beer()

n = int(input())
s = input().strip()

if s == "Hello, World!":
    print("H")
elif s == beer_song:
    print("9")
elif s.count('Q') == 1 and s.count('H') == 0 and s.count('9') == 0:
    print(s)
else:
    print(-1)
0