Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstdlib>
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <string>
- #include <string.h>
- #include <queue>
- #include <stack>
- #include <deque>
- #include <map>
- #include <set>
- #include <cmath>
- #include <sstream>
- #include <ctime>
- #define pb push_back
- #define mp make_pair
- #define PI 3.1415926535897932384626433832795
- #define ALL(x) x.begin(), x.end()
- #define F first
- #define S second
- #define m0(x) memset(x,0,sizeof(x))
- #define m1(x) memset(x,-1,sizeof(x))
- #define pw(x) (1ull<<(x))
- using namespace std;
- typedef long long ll;
- typedef unsigned long long ull;
- typedef long double ld;
- typedef pair<int,int> pii;
- const int INF = 2147483647;
- const ll LLINF = 9223372036854775807LL;
- const char pr[] = {'2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A', 'c', 's', 'h', 'd' };
- inline int prior(char c) {
- int ans = 0;
- while (pr[ans]!=c) ans++;
- return ans;
- }
- bool comp(const Card &a, const Card &b) {
- if (a.suit == b.suit) return prior(a.rank)<prior(b.rank);
- else return prior(a.suit)<prior(b.suit);
- }
- void sort_card(int n, Card card[]) {
- sort(card, card+n, comp);
- }
Advertisement
Add Comment
Please, Sign In to add comment