Submission #36417665
Source Code Expand
#include <bits/stdc++.h>
#define M_PI 3.14159265358979323846
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
using namespace std;
int main() {
map<string, bool> S_judge;
string s;
int N;
bool ans = 1;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> s;
if (!(s[0] == 'H' || s[0] == 'D' || s[0] == 'C' || s[0] == 'S')) { ans = 0; }
if (!(s[1] == 'A' || s[1] == '3' || s[1] == '4' || s[1] == '5' || s[1] == '6' || s[1] == '7' || s[1] == '8' || s[1] == '9' || s[1] == 'T' || s[1] == 'J' || s[1] == 'Q' || s[1] == 'K'||s[1]=='2')) {
ans = 0;
}
if (S_judge[s] == 1) { ans = 0; }
else {
S_judge[s] = 1;
}
}
if (ans == 1)cout << "Yes" << endl;
else {
cout << "No" << endl;
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Playing Cards Validation |
| User | amaoto |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 889 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 3624 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt, example3.txt |
| All | example0.txt, example1.txt, example2.txt, example3.txt, max0.txt, random0.txt, random1.txt, random10.txt, random11.txt, random12.txt, random13.txt, random2.txt, random3.txt, random4.txt, random5.txt, random6.txt, random7.txt, random8.txt, random9.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example0.txt | AC | 5 ms | 3528 KiB |
| example1.txt | AC | 2 ms | 3588 KiB |
| example2.txt | AC | 4 ms | 3468 KiB |
| example3.txt | AC | 2 ms | 3580 KiB |
| max0.txt | AC | 2 ms | 3468 KiB |
| random0.txt | AC | 2 ms | 3480 KiB |
| random1.txt | AC | 2 ms | 3588 KiB |
| random10.txt | AC | 2 ms | 3432 KiB |
| random11.txt | AC | 2 ms | 3584 KiB |
| random12.txt | AC | 2 ms | 3620 KiB |
| random13.txt | AC | 1 ms | 3488 KiB |
| random2.txt | AC | 2 ms | 3472 KiB |
| random3.txt | AC | 2 ms | 3524 KiB |
| random4.txt | AC | 2 ms | 3468 KiB |
| random5.txt | AC | 2 ms | 3472 KiB |
| random6.txt | AC | 2 ms | 3464 KiB |
| random7.txt | AC | 2 ms | 3472 KiB |
| random8.txt | AC | 3 ms | 3388 KiB |
| random9.txt | AC | 2 ms | 3624 KiB |