結果
問題 |
No.501 穴と文字列
|
ユーザー |
![]() |
提出日時 | 2017-04-28 15:11:18 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 3,451 ms |
コンパイル使用メモリ | 65,796 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 01:10:31 |
合計ジャッジ時間 | 4,089 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
import strutils, sequtils, algorithm when isMainModule: var input = stdin.readline.split.map(parseint) (n, d) = (input[0], input[1]) cnt = newSeq[int](n) pos = 0 for i in 0..d-1: cnt[pos].inc pos = (pos + 1) mod n var ans = "" for i in 0..n-1: if cnt[i] == 0: ans = ans & "C" elif cnt[i] == 1: ans = ans & "A" elif cnt[i] == 2: ans = ans & "B" ans.sort(system.cmp) echo ans