結果

問題 No.3054 Modulo Inequalities
ユーザー lam6er
提出日時 2025-04-15 23:29:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 82,884 KB
実行使用メモリ 77,200 KB
最終ジャッジ日時 2025-04-15 23:30:27
合計ジャッジ時間 9,556 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 16 RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

X = int(input())

# Initialize the first valid solution (x=7, y=5) which gives a=3, c=5 (1 digit)
current_x, current_y = 7, 5

while True:
    a = (current_x - 1) // 2
    c = current_y
    if len(str(c)) == X:
        print(a, a + 1, c)
        break
    # Generate next solution using the recurrence relations
    next_x = 3 * current_x + 4 * current_y
    next_y = 2 * current_x + 3 * current_y
    current_x, current_y = next_x, next_y
0