QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#632197 | #5118. Hotel | Green_Hand# | WA | 0ms | 1640kb | C++20 | 586b | 2024-10-12 12:53:44 | 2024-10-12 12:53:45 |
Judging History
answer
#include <cstdio>
#include <cstring>
using namespace std;
int n,ans,c1,c2; char s[9];
int min(int x,int y) { return x < y ? x : y; }
void read(int &x)
{
char c = getchar(); x = 0;
while(c < '0' || c > '9') c = getchar();
while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
}
int main()
{
read(n), read(c1), read(c2), ans = 0,
c2 = min(3 * c1,c1 + c2), c1 *= 3;
for(int i = 1;i <= n; ++ i)
{
scanf(" %s",s + 1);
if(s[1] == s[2] || s[1] == s[3] || s[2] == s[3]) ans += c2;
else ans += c1;
}
printf("%d\n",ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 1636kb
input:
3 1 3 MMM MMM FFF
output:
9
result:
ok 1 number(s): "9"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 1640kb
input:
3 3 1 ABC DEF GHI
output:
27
result:
wrong answer 1st numbers differ - expected: '9', found: '27'