QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#638171 | #5118. Hotel | wzxtsl# | WA | 0ms | 3596kb | C++23 | 1.3kb | 2024-10-13 15:06:33 | 2024-10-13 15:06:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define For(i,aa,a) for(int i=aa;i<=a;i++)
int n,m;
const int N=2e6+7;
int a1,a2;
void solve(){
cin>>n>>a1>>a2;
if(a2>2*a1){
cout<<n*3*a1<<endl;
return;
}
if(a2<a1){
int sum=0;
for(int i=1;i<=n;i++){
string s;
int fl=0;
cin>>s;
int bro[27]={0};
for(int j=0;j<3;j++){
bro[s[j]-'A']++;
if(bro[s[j]-'A']==2){
sum+=a2;
fl=1;
}
}
if(fl==1)sum+=a2;
else sum+=3*a2;
}
cout<<sum<<endl;
return;
}
if(a2>=a1&&a2<=2*a2){
int sum=0;
for(int i=1;i<=n;i++){
string s;
int fl=0;
cin>>s;
int bro[27]={0};
for(int j=0;j<3;j++){
bro[s[j]-'A']++;
if(bro[s[j]-'A']==2){
sum+=a2;
fl=1;
}
}
if(fl==1)sum+=a2;
else sum+=3*a1;
}
cout<<sum<<endl;
return;
}
}
signed main(){
int t=1;
//cin>>t;
while(t--){
solve();
}
}
詳細信息
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: 3596kb
input:
3 3 1 ABC DEF GHI
output:
9
result:
ok 1 number(s): "9"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3540kb
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: -100
Wrong Answer
time: 0ms
memory: 3544kb
input:
3 2 3 MMM MMM MMM
output:
18
result:
wrong answer 1st numbers differ - expected: '15', found: '18'