結果

問題 No.3054 Modulo Inequalities
ユーザー lam6er
提出日時 2025-03-20 21:11:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 82,080 KB
実行使用メモリ 77,356 KB
最終ジャッジ日時 2025-03-20 21:11:36
合計ジャッジ時間 11,098 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 16 RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

X = int(input())

# Initial solution (m, c) = (7,5)
current_m = 7
current_c = 5

while True:
    # Check if current_c has exactly X digits
    if len(str(current_c)) == X:
        a = (current_m - 1) // 2
        b = a + 1
        print(f"{a} {b} {current_c}")
        break
    # Generate next solution using recurrence relations
    next_m = 3 * current_m + 4 * current_c
    next_c = 2 * current_m + 3 * current_c
    current_m, current_c = next_m, next_c
0