QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#669495 | #5118. Hotel | blue_sky | WA | 0ms | 3824kb | C++20 | 1.5kb | 2024-10-23 18:48:14 | 2024-10-23 18:48:16 |
Judging History
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;
}
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;
// }
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
3 1 3 MMM MMM FFF
output:
9
result:
ok 1 number(s): "9"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
3 3 1 ABC DEF GHI
output:
9
result:
ok 1 number(s): "9"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3512kb
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: 3540kb
input:
3 2 3 MMM MMM MMM
output:
15
result:
ok 1 number(s): "15"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
1 240 45 CAB
output:
135
result:
ok 1 number(s): "135"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
1 140 846 ACB
output:
420
result:
ok 1 number(s): "420"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
2 488 849 CAC DCD
output:
2674
result:
ok 1 number(s): "2674"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
2 49 987 BAB AAB
output:
294
result:
ok 1 number(s): "294"
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
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'