結果
問題 | No.267 トランプソート |
ユーザー |
|
提出日時 | 2016-11-24 23:12:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,015 bytes |
コンパイル時間 | 822 ms |
コンパイル使用メモリ | 81,468 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 10:50:21 |
合計ジャッジ時間 | 1,445 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES#include<stdio.h>#include<string>#include<iostream>#include<cctype>#include<cstdio>#include<vector>#include<stack>#include<queue>#include <algorithm>#include<math.h>#include<set>#include<map>#include<iomanip>//#include<bits/stdc++.h>using namespace std;int main() {int n;cin>>n;int d[4][15]={};for(int i=0;i<n;i++){char c;char g;cin>>c>>g;int a,b;if(c=='D')a=0;else if(c=='C')a=1;else if(c=='H')a=2;else a=3;if(g=='A')b=1;else if(g=='T')b=10;else if(g=='J')b=11;else if(g=='Q')b=12;else if(g=='K')b=13;else b=g-'0';d[a][b]=1;}bool f=0;for(int i=0;i<4;i++){for(int j=1;j<=13;j++){if(d[i][j]){if(f)cout<<" ";if(i==0)cout<<'D';else if(i==1)cout<<'C';else if(i==2)cout<<'H';else cout<<'S';if(j==1)cout<<'A';else if(j==10)cout<<'T';else if(j==11)cout<<'J';else if(j==12)cout<<'Q';else if(j==13)cout<<'K';else cout<<j;f=1;}}}cout<<endl;return 0;}