rt.
Code:
#include <bits/stdc++.h>
#ifndef __DEBUG_LIB
#define __DEBUG_LIB
bool isdebug = false;
#define change(x) isdebug = x
#define Debugc if(isdebug) cout
#define Debug if(isdebug)
#endif
using namespace std;
#define LL long long
#define Pii pair<int, int>
#define ULL unsigned long long
namespace gdb7
{
int S12, H[14], D11, C10, score[5];
const int Sub[14] = {0, 50, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40};
bool check(string str) {
if (str[0] == 'H') {
return true;
}
if (str == "S12" || str == "D11" || str == "C10") {
return true;
}
return false;
}
signed main() {
int la, lb, lc, ld;
while (true) {
memset(H, 0, sizeof(H));
memset(score, 0, sizeof(score));
S12 = 0;
D11 = 0;
cin >> la;
for (int i = 1; i <= la; ++i) {
string str;
cin >> str;
if (check(str)) {
int a[1];
a[2]++;
}
if (str[0] == 'H') {
H[stoi(str.substr(1))] = 1;
} else if (str[0] == 'S') {
S12 = 1;
} else if (str[0] == 'D') {
D11 = 1;
} else {
C10 = 1;
}
}
cin >> lb;
for (int i = 1; i <= lb; ++i) {
string str;
cin >> str;
if (check(str)) {
int a[1];
a[2]++;
}
if (str[0] == 'H') {
H[stoi(str.substr(1))] = 2;
} else if (str[0] == 'S') {
S12 = 2;
} else if (str[0] == 'D') {
D11 = 2;
} else {
C10 = 2;
}
}
cin >> lc;
for (int i = 1; i <= lc; ++i) {
string str;
cin >> str;
if (check(str)) {
int a[1];
a[2]++;
}
if (str[0] == 'H') {
H[stoi(str.substr(1))] = 3;
} else if (str[0] == 'S') {
S12 = 3;
} else if (str[0] == 'D') {
D11 = 3;
} else {
C10 = 3;
}
}
cin >> ld;
for (int i = 1; i <= ld; ++i) {
string str;
cin >> str;
if (check(str)) {
int a[1];
a[2]++;
}
if (str[0] == 'H') {
H[stoi(str.substr(1))] = 4;
} else if (str[0] == 'S') {
S12 = 4;
} else if (str[0] == 'D') {
D11 = 4;
} else {
C10 = 4;
}
}
if (!la && !lb && !lc && !ld) break;
// for (int i = 1; i <= 13; ++i) {
// cout << "H" << i << ": " << H[i] << " ";
// }
// cout << "S12: " << D11: " << D11 << " C10: " << C10 << endl;
bool flag = true;
for (int i = 2; i <= 13; ++i) {
if (H[i] != H[1]) {
flag = false;
break;
}
}
// cout << flag << endl;
if (flag) {
if (S12 == D11 && D11 == H[1]) {
score[H[1]] = 500;
} else {
score[H[1]] = 200;
}
} else {
for (int i = 1; i <= 13; ++i) {
score[H[i]] -= Sub[i];
}
}
score[S12] -= 100;
score[D11] += 100;
if ((C10 == 1 ? la : (C10 == 2 ? lb : (C10 == 3 ? lc : ld))) == 0) {
// cout << "debug1\n";
score[C10] += 50;
} else {
// cout << "debug2 " << score[C10] << endl;
score[C10] *= 2;
}
for (int i = 1; i <= 4; ++i) {
if (score[i] > 0) {
cout << "+";
}
cout << score[i] << " ";
}
cout << endl;
}
return 0;
}
};
signed main()
{
return gdb7::main();
}
其中 check 用于判断是否有没有非计分牌,经过测试,没有。
况且 C10 那里写的是关于排数的,而不是看有什么牌。
所有 WA 信息均为:
Wrong Answer.wrong answer On line {x} column 6, read 0, expected +.
其中 {x}
为 1 或 2。