QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#669506#5118. Hotelblue_skyWA 0ms3576kbC++201.6kb2024-10-23 18:51:122024-10-23 18:51:12

Judging History

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

  • [2024-10-23 18:51:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3576kb
  • [2024-10-23 18:51:12]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define bug(X) cout << "bug:# " << X << endl
#define bug2(f, X) cout << "bug:# " << f << " " << X << endl
#define bug3(i, j, G) cout << "bug:# " << i << ' ' << j << ' ' << G << endl
#define endl '\n'
using namespace std;
const int mod = 998244353;
const int N = 10 + 5e5;
void _();
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    // cin >> t;
    while (t--)
        _();
    return 0;
}

void _()
{
    int n, x, y;
    cin >> n >> x >> y;
    int res = 0;
    for (int i = 0; i < n; i++)
    {
        map<char, int> cnt;
        string s;
        cin >> s;
        for (auto v : s)
            cnt[v]++;
        int t = min(3 * x, 3 * y);
        if (cnt.size() < 3)
            t = min(t, x + y);
        res += t;
    }
    if (x * 2 >= y)
        res = n * 3 * y;
    cout << res << endl;
}

// void _()
// {
//     int n, x, y;
//     cin >> n >> x >> y;
//     int res = 0;
//     int f2 = 0, f1 = 0;
//     for (int i = 0; i < n; i++)
//     {
//         map<char, int> cnt;
//         string s;
//         cin >> s;
//         for (auto v : s)
//             cnt[v] = 1;
//         if (cnt.size() == 3)
//             f1 += 3;
//         else
//             f1++, f2++;
//     }
//     res = min({f1 * x + f2 * y, x * n * 3, y * n * 3});
//     for (int i = 0; i <= f2; i++)
//     {
//         int f11 = n * 3 - i * 2;
//         res = min(res, f11 * x + i * y);
//     }
//     cout << res << endl;
// }

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 1 3
MMM
MMM
FFF

output:

9

result:

ok 1 number(s): "9"

Test #2:

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

input:

3 3 1
ABC
DEF
GHI

output:

9

result:

ok 1 number(s): "9"

Test #3:

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

input:

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

output:

13140

result:

wrong answer 1st numbers differ - expected: '12264', found: '13140'