結果

問題 No.3157 Nabeatsu
ユーザー hato336
提出日時 2025-05-23 20:47:14
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 511 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 371,300 KB
最終ジャッジ日時 2025-05-23 20:47:29
合計ジャッジ時間 10,238 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 TLE * 3 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
input = sys.stdin.readline
sys.set_int_max_str_digits(0)
s = list(map(int,list(input().rstrip())))
y = sum(s)
x = int(''.join(list(map(str,s))))
if y % 3 == 0:
    x -= 1
s = list(map(int,list(str(x))))

for i in range(len(s)):
    if s[i] == 3:
        s[i] = 2
        for j in range(i+1,len(s)):
            s[j] = 9
        break
y = sum(s)
x = int(''.join(list(map(str,s))))
if y % 3 == 0:
    x -= 1
print(x)
0