-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path1042.cpp
More file actions
28 lines (23 loc) · 695 Bytes
/
1042.cpp
File metadata and controls
28 lines (23 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <vector>
using namespace std;
const int NUM_CARDS = 54;
const int NUM_SUITS = 13;
const string suits[] = {"S", "H", "C", "D", "J"};
int main() {
int k, order[NUM_CARDS];
cin >> k;
for (int i = 0; i < NUM_CARDS; i++)
cin >> order[i];
vector<string> deck(NUM_CARDS);
for (int i = 0; i < NUM_CARDS; i++)
deck[i] = suits[i / NUM_SUITS] + to_string(i % NUM_SUITS + 1);
while (k--) {
vector<string> temp(deck);
for (int i = 0; i < NUM_CARDS; i++)
deck[order[i] - 1] = temp[i];
}
for (int i = 0; i < NUM_CARDS; i++)
cout << deck[i] << (i < NUM_CARDS - 1 ? ' ' : '\n');
return 0;
}