QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#418681#5118. HotelimxxWA 0ms3800kbC++14445b2024-05-23 15:07:042024-05-23 15:07:06

Judging History

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

  • [2024-05-23 15:07:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3800kb
  • [2024-05-23 15:07:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,c1,c2;
const int inf=2e9;
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	string s;
	cin>>n>>c1>>c2;
	if(c1*2<=c2){
		cout<<n*3;
		return 0;
	}
	c1=min(c1,c2);
	long long ans=0;
	for(int i=1;i<=n;i++){
		cin>>s;
		sort(s.begin(),s.end());
		if(s[0]==s[1]||s[1]==s[2])ans+=c1+c2;
		else ans+=3*c1;
	}
	cout<<ans;
	return 0;
}
/*
3 1 3
MMM
MMM
FFF
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3568kb

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: 3800kb

input:

3 2 3
MMM
MMM
MMM

output:

15

result:

ok 1 number(s): "15"

Test #5:

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

input:

1 240 45
CAB

output:

135

result:

ok 1 number(s): "135"

Test #6:

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

input:

1 140 846
ACB

output:

3

result:

wrong answer 1st numbers differ - expected: '420', found: '3'