QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#638171#5118. Hotelwzxtsl#WA 0ms3596kbC++231.3kb2024-10-13 15:06:332024-10-13 15:06:33

Judging History

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

  • [2024-10-13 15:06:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3596kb
  • [2024-10-13 15:06:33]
  • 提交

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();
    }
}

Details

Tip: Click on the bar to expand more detailed information

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'