QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#753024#5118. HotelHaijieTanWA 0ms3856kbC++231.9kb2024-11-16 10:59:532024-11-16 10:59:53

Judging History

你现在查看的是最新测评结果

  • [2024-11-16 10:59:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3856kb
  • [2024-11-16 10:59:53]
  • 提交

answer

#include<iostream>
#include<vector>
#include<bitset>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<numeric>//iota -- iota(all(a), x) a从头到尾从x开始递增
#include<cstring>
#include<ctime>
#include<array>
#include<list>
#include<random>
#include<tuple>
#include<deque>
#include<map>
#include<stack>
#include<set>
using namespace std;
#define IOS ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
#define int long long
#define all(x) x.begin(), x.end()
#define pb push_back
#define pf push_front
#define lowbit(x) (x & (-x))
const int xy[][2] = { 0,1, 0, -1, 1, 0, -1, 0 };
#define mem(a, x) memset(a, x, sizeof a)
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<char, char> PCC;
typedef pair<int, char> PIC;
typedef pair<char, int> PCI;
#define x first
#define y second
#define NO cout << "NO\n"
#define YES cout << "YES\n"
inline int read();
const int INF = 1e9, N = 1e4 + 10, MOD = 998244353, M = 1e4 + 10, K = 131;
const double PI = acos(-1.0);
void solve() {
    int n, a, b; cin >> n >> a >> b;
    int ret = 0;
    for (int i = 1; i <= n; i++) {
        string s; cin >> s;
        sort(all(s));
        if (s[0] == s[1] || s[1] == s[2]) {
            if (a * 2 > b)ret += a + b;
            else if (a >= b)ret += 3 * b;
            else ret += 3 * a;
        }
        else {
            if (a >= b)ret += b * 3;
            else ret += a * 3;
        }
    }
    cout << ret << endl;
}
signed main() {
    IOS;
    int _ = 1;
    //cin >> _;
    while (_--)solve();
    return 0;
}
inline int read()
{
    int x = 0, f = 1; char ch = getchar();
    while (ch < '0' || ch>'9') { if (ch == '-') f = -1; ch = getchar(); }
    while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar(); }
    return x * f;
}
/*   /\_/\
*   (= ._.)
*   / >  \>
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3804kb

input:

3 1 3
MMM
MMM
FFF

output:

9

result:

ok 1 number(s): "9"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

3 3 1
ABC
DEF
GHI

output:

9

result:

ok 1 number(s): "9"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

10 438 438
WWW
SOU
PUN
ETC
OME
CFI
NAL
GOO
DHO
TEL

output:

12264

result:

ok 1 number(s): "12264"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

3 2 3
MMM
MMM
MMM

output:

15

result:

ok 1 number(s): "15"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

1 240 45
CAB

output:

135

result:

ok 1 number(s): "135"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

1 140 846
ACB

output:

420

result:

ok 1 number(s): "420"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

2 488 849
CAC
DCD

output:

2674

result:

ok 1 number(s): "2674"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

2 49 987
BAB
AAB

output:

294

result:

ok 1 number(s): "294"

Test #9:

score: -100
Wrong Answer
time: 0ms
memory: 3808kb

input:

100 695 531
BCA
ADA
CBD
CFB
EAF
BAE
HCI
ECE
CII
BBB
AAC
ACC
AEC
BCC
DAC
DCF
HDC
DGF
IDB
ABB
ACB
ABB
BCD
ABC
CBD
GGD
EGC
CJF
JIC
ABB
BCC
CDA
DBD
FAF
DAC
CFG
HGF
CGH
AJD
ABA
CCC
ACC
CBC
FEE
GGG
DDF
BFD
EFB
GDK
ABB
CBB
ADB
DBD
CFE
ECC
AHC
IAA
CAH
DJE
ABB
BCC
AAD
EDB
BAE
ECE
CCH
HGC
CAJ
IJD
ABB
ACC
CAC
...

output:

140583

result:

wrong answer 1st numbers differ - expected: '132219', found: '140583'