結果
問題 |
No.267 トランプソート
|
ユーザー |
![]() |
提出日時 | 2018-04-03 17:08:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,295 bytes |
コンパイル時間 | 1,607 ms |
コンパイル使用メモリ | 108,560 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 08:30:44 |
合計ジャッジ時間 | 2,435 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 WA * 15 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <cmath> #include <limits.h> #include <map> #include <set> #include <queue> #include <algorithm> #include <functional> #include <stdio.h> using namespace std; long long MOD = 1000000007; int main() { map<string,string> X; X["A"] = "1"; X["T"] = "10"; X["J"] = "11"; X["Q"] = "12"; X["K"] = "13"; X["1"] = "A"; X["10"] = "T"; X["11"] = "J"; X["12"] = "Q"; X["13"] = "K"; int N; cin >> N; vector< vector<string> > V(4); string S = "DCHS"; for ( int i = 0; i < N; i++ ) { string s; cin >> s; for ( int j = 0; j < 4; j++ ) { if ( S[j] == s[0] ) { s = s.substr(1,s.length()-1); if ( X[s].length() ) { s = X[s]; } V[j].push_back(s); } } } for ( int i = 0; i < 4; i++ ) { sort( V[i].begin(), V[i].end() ); for ( int j = 0; j < V[i].size(); j++ ) { string s = V[i][j]; if ( X[s].length() ) { s = X[s]; } cout << S[i] << s; if ( i != 3 || j != V[i].size()-1 ) { cout << " "; } } } cout << endl; return 0; }