結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
![]() |
提出日時 | 2025-02-10 17:12:51 |
言語 | Nim (2.2.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 274 bytes |
コンパイル時間 | 4,669 ms |
コンパイル使用メモリ | 67,552 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-10 17:12:58 |
合計ジャッジ時間 | 5,685 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 WA * 2 |
ソースコード
import sequtils, strutils let s1 = stdin.readLine ns = s1.toSeq.mapIt ($it).parseInt var l, r: int s2 = s1 for i in 0 ..< s1.high: let max = (ns[i..^1]).max if max == ns[i]: continue l = i r = ns[i..^1].maxIndex.succ i swap(s2[l], s2[r]) break echo s2