Submission #36412046
Source Code Expand
#include <bits/stdc++.h>
#define st first
#define nd second
#define db double
#define re register
#define pb push_back
#define mk make_pair
#define int long long
#define ldb long double
#define pii pair<int, int>
#define ull unsigned long long
#define mst(a, b) memset(a, b, sizeof(a))
using namespace std;
const int N = 1e5 + 10, INF = 1e16;
inline int read()
{
int s = 0, w = 1;
char ch = getchar();
while(ch < '0' || ch > '9') { if(ch == '-') w *= -1; ch = getchar(); }
while(ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
return s * w;
}
map<string, bool> mp;
signed main()
{
int n = read();
for(re int i = 1; i <= n; i++){
string s;
cin >> s;
if(mp[s]) puts("No"), exit(0);
mp[s] = true;
if(s[0] != 'H' && s[0] != 'D' && s[0] != 'C' && s[0] != 'S') puts("No"), exit(0);
if(s[1] != 'A' && s[1] != 'T' && s[1] != 'J' && s[1] != 'Q' && s[1] != 'K'){
if(s[1] < '2' || s[1] > '9') puts("No"), exit(0);
}
}
puts("Yes");
return 0;
}
/*
1
10
9 9 4 7 3 10 10 8 4 3
*/
Submission Info
| Submission Time | |
|---|---|
| Task | B - Playing Cards Validation |
| User | Booksnow |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 1076 Byte |
| Status | AC |
| Exec Time | 7 ms |
| Memory | 3588 KiB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:27:14: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
27 | for(re int i = 1; i <= n; i++){
| ^
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 | 7 ms | 3392 KiB |
| example1.txt | AC | 2 ms | 3380 KiB |
| example2.txt | AC | 2 ms | 3388 KiB |
| example3.txt | AC | 2 ms | 3452 KiB |
| max0.txt | AC | 2 ms | 3380 KiB |
| random0.txt | AC | 1 ms | 3380 KiB |
| random1.txt | AC | 2 ms | 3532 KiB |
| random10.txt | AC | 2 ms | 3392 KiB |
| random11.txt | AC | 3 ms | 3532 KiB |
| random12.txt | AC | 2 ms | 3588 KiB |
| random13.txt | AC | 2 ms | 3580 KiB |
| random2.txt | AC | 2 ms | 3384 KiB |
| random3.txt | AC | 2 ms | 3576 KiB |
| random4.txt | AC | 2 ms | 3472 KiB |
| random5.txt | AC | 2 ms | 3380 KiB |
| random6.txt | AC | 2 ms | 3488 KiB |
| random7.txt | AC | 2 ms | 3488 KiB |
| random8.txt | AC | 2 ms | 3448 KiB |
| random9.txt | AC | 5 ms | 3588 KiB |