結果
問題 | No.267 トランプソート |
ユーザー | kyuridenamida |
提出日時 | 2015-08-21 22:23:33 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 1,892 ms |
コンパイル使用メモリ | 171,236 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 11:28:25 |
合計ジャッジ時間 | 2,304 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; string tb1 = "A123456789TJQK"; string tb2 = "DCHS"; bool cmp(string a,string b){ a[0] = 'A'+tb2.find(a[0]); a[1] = 'A'+tb1.find(a[1]); b[0] = 'A'+tb2.find(b[0]); b[1] = 'A'+tb1.find(b[1]); return a < b; } int main(){ int N; string s; vector<string> S; cin >> N; for(int i = 0 ; i < N ; i++){ cin >> s; S.push_back(s); } sort(S.begin(),S.end(),cmp); for(int i = 0 ; i < S.size() ; i++){ cout << S[i]; if( i + 1 == S.size() ) cout << endl; else cout << " "; } }