結果
問題 | No.267 トランプソート |
ユーザー |
|
提出日時 | 2019-01-19 09:01:09 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 3,381 ms |
コンパイル使用メモリ | 65,576 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 10:20:06 |
合計ジャッジ時間 | 4,255 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import sequtils,strutils,algorithmproc sortCard(x,y:string):int =proc toN(c:char):int =if c == 'A' : return 1if c == 'T' : return 10if c == 'J' : return 11if c == 'Q' : return 12if c == 'K' : return 13return c.ord - '0'.ordproc toA(c:char):int =if c == 'D': return 0if c == 'C': return 1if c == 'H': return 2if c == 'S': return 3if x[0] != y[0]: return x[0].toA() - y[0].toA()return x[1].toN() - y[1].toN()let n = stdin.readLine().parseInt()echo stdin.readLine().split().sorted(sortCard).join(" ")