QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#632197#5118. HotelGreen_Hand#WA 0ms1640kbC++20586b2024-10-12 12:53:442024-10-12 12:53:45

Judging History

This is the latest submission verdict.

  • [2024-10-12 12:53:45]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 1640kb
  • [2024-10-12 12:53:44]
  • Submitted

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'