結果
問題 | No.539 インクリメント |
ユーザー |
![]() |
提出日時 | 2017-07-01 13:53:13 |
言語 | Nim (2.2.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 706 bytes |
コンパイル時間 | 3,270 ms |
コンパイル使用メモリ | 66,156 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 01:32:41 |
合計ジャッジ時間 | 4,284 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 1 |
other | AC * 2 RE * 1 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 17) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import strutils,sequtilsproc reversed(s : string) : string=vara = ""i = s.lenfor j in 1..i:a &= s[^j]return aproc ctoi(c : char):int=return int(c) - int('0')varS : stringlef,rig,j : intN = stdin.readline.parseIntfor n in 0..<N:S = stdin.readlineS = reversed(S)for i,s in S:if s.isDigit:if s == '9':if S[i+1].isDigit:S[i] = '0'else:S[i] = '0'S = S[0..i] & '1' & S[i+1..S.len-1]breakelse:S[i] = ($(s.ctoi + 1))[0]breakecho reversed(S)