QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65146#5118. HotelJWChen#WA 2ms3696kbC++141.1kb2022-11-27 19:26:092022-11-27 19:26:10

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-27 19:26:10]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3696kb
  • [2022-11-27 19:26:09]
  • 提交

answer

// #include<bits/stdc++.h>
// using namespace std;

// typedef long long ll;

// const int N=1e5+10;
// ll a[N];
// int n;

// int main(){
//     ios::sync_with_stdio(false);
//     cin.tie(0);
//     cout.tie(0);
//     cin>>n;
//     for(int i=1;i<=n;i++) cin>>a[i];
//     sort(a+1,a+1+n);
//     ll ans=0;
//     ans=max(ans,a[n]+a[n-1]);
//     cout<<ans;
//     return 0;
// }

#include<bits/stdc++.h>
using namespace std;
int n,a,b,ans;
int f[4];
char ch,chh[5];
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    scanf("%c",&ch);
    f[1]=0;//3
    f[2]=0;//2  1-2
    f[3]=0;//1
    for(int i=1;i<=n;++i)
    {
        for(int j=1;j<=3;++j)
            scanf("%c",&chh[j]);
        if(chh[1]==chh[2]&&chh[2]==chh[3]) f[3]++;
        else if(chh[1]==chh[2]||chh[1]==chh[3]||chh[2]==chh[3]) f[2]++;
        else f[1]++;
        scanf("%c",&ch);
    }
    if(b<a)
    {
        ans=b*3*n;
    }
    else if(b>a*2)
    {
        ans=a*3*n;
    }
    else
    {
        ans=f[1]*3*a+(f[2]+f[3])*a+(f[2]+f[3])*b;
    }
    printf("%d\n",ans);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3636kb

input:

3 1 3
MMM
MMM
FFF

output:

9

result:

ok 1 number(s): "9"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3696kb

input:

3 3 1
ABC
DEF
GHI

output:

9

result:

ok 1 number(s): "9"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3508kb

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

input:

3 2 3
MMM
MMM
MMM

output:

15

result:

ok 1 number(s): "15"

Test #5:

score: 0
Accepted
time: 2ms
memory: 3460kb

input:

1 240 45
CAB

output:

135

result:

ok 1 number(s): "135"

Test #6:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

1 140 846
ACB

output:

420

result:

ok 1 number(s): "420"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3508kb

input:

2 488 849
CAC
DCD

output:

2674

result:

ok 1 number(s): "2674"

Test #8:

score: 0
Accepted
time: 1ms
memory: 3504kb

input:

2 49 987
BAB
AAB

output:

294

result:

ok 1 number(s): "294"

Test #9:

score: -100
Wrong Answer
time: 1ms
memory: 3484kb

input:

100 695 531
BCA
ADA
CBD
CFB
EAF
BAE
HCI
ECE
CII
BBB
AAC
ACC
AEC
BCC
DAC
DCF
HDC
DGF
IDB
ABB
ACB
ABB
BCD
ABC
CBD
GGD
EGC
CJF
JIC
ABB
BCC
CDA
DBD
FAF
DAC
CFG
HGF
CGH
AJD
ABA
CCC
ACC
CBC
FEE
GGG
DDF
BFD
EFB
GDK
ABB
CBB
ADB
DBD
CFE
ECC
AHC
IAA
CAH
DJE
ABB
BCC
AAD
EDB
BAE
ECE
CCH
HGC
CAJ
IJD
ABB
ACC
CAC
...

output:

159300

result:

wrong answer 1st numbers differ - expected: '132219', found: '159300'