QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#567981 | #5118. Hotel | xiaozhi# | AC ✓ | 1ms | 3872kb | C++17 | 635b | 2024-09-16 14:52:35 | 2024-09-16 14:52:35 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 998244353;
const int inf = 1e8;
void solve() {
int n, c1, c2;
cin >> n >> c1 >> c2;
int ans = 0;
for (int i = 1; i <= n; i++) {
string s;
cin >> s;
int cost = 3 * min(c1, c2);
if (s[0] == s[1] || s[1] == s[2] || s[2] == s[0]) {
cost = min(cost, c2 + min(c1, c2));
}
ans += cost;
}
cout << ans;
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cout << fixed << setprecision(10);
int t = 1;
// cin >> t;
while (t--) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3512kb
input:
3 1 3 MMM MMM FFF
output:
9
result:
ok 1 number(s): "9"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
3 3 1 ABC DEF GHI
output:
9
result:
ok 1 number(s): "9"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3788kb
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: 3512kb
input:
3 2 3 MMM MMM MMM
output:
15
result:
ok 1 number(s): "15"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1 240 45 CAB
output:
135
result:
ok 1 number(s): "135"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
1 140 846 ACB
output:
420
result:
ok 1 number(s): "420"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
2 488 849 CAC DCD
output:
2674
result:
ok 1 number(s): "2674"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 49 987 BAB AAB
output:
294
result:
ok 1 number(s): "294"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3624kb
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:
132219
result:
ok 1 number(s): "132219"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
100 815 412 BAC CAB DEE AFC DCE EHB DGG JEH GFF AAA CAB BBC AEB FAF CEG CAA DII JJB ECA ABB BCC BDA BCC EBB CBA HDD CFG DJH DGJ AAB ABC ABC BBC DEB EFE EEF IBC EIB BBJ AAA CAC BCD AEE CDA GDA AAB EHC JFI DFC AAB ACB CAB ABB EBA FGF CDE GDG AFF KAJ BBA AAB BDA DDB FFA EEA CGE CCF IFB AGA AAA AAC BBD ...
output:
103000
result:
ok 1 number(s): "103000"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
501 762 131 ACB BDC EDC BBF FCB BEG GDF ECE HKA BBA BAC CDB DDC FEA GCD HDF BBC HDC HFE ABA CBB CDB ABD DEF FAE ACD BEG EBG ABK BBB BBA CBB ACD EAD EGF CCB IIE IBB AKH BBA CCA CCC CBD EFD CFD FHC DFH JIA DBG BAA CBB DDB CCA BED DEF CEF GAF FEJ JBK ABA CBC BDC CCC FBC FFF HHD DBC DBD JGH BAA CAC BDA ...
output:
174623
result:
ok 1 number(s): "174623"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
501 893 616 BCB DDD DBD BCD CBA AHG DEF BII ECI ABA ABB AAD AAE FAC BFB GEG DCI DAH IKD AAB CCC ADD CEB CFF BBF AFE EEH FBJ IAC BBB CAB BBB DCA DEC DEA DCH DCB FFH JBI AAA CBC DDA DAA AAA AGA FCH ECB CFF GBC BAB BCB BCD EBC FDB FEC GGC EDH IJC BEK BAA ABA BCA DDD ABF ECG EDE DEC EBF ICC AAB CCA AAB ...
output:
803264
result:
ok 1 number(s): "803264"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
998 823 349 BBA ADA DAD DEE CCC EFG FGI FAE ADE AAB AAB BBD DBB FEE CFA HDA FDD DIA JBG BAB CCA CBC ACC DEB ECC CDF GGD EEA GFE AAB BCB DDA CEE FEF BEG EBG CEA DBC DBD BAB CAA CBC DAC CCB BBD HGB AII EFA AJA BAA CCB BCB DBC CEE DCB DEH HDE AIJ HHK ABA BCA CBB ABE FAF AFF EAG DCE JED CFI BBB CCB ADA ...
output:
946488
result:
ok 1 number(s): "946488"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
998 645 646 CAC CCA BAE EDA CDF DDD BHI CBJ DDE BAA CBA DDB ADE BEC BDG HDB GCH CJE HIF ABA BAA CBA EBB DEB EEC ECE HEF GHF DGF BBA BBC BAD ABE FBA GCG HHB FFI GIC KHG AAA CCC DDA ACB ACF AGC BEA GEA GHI ECK ABA BAB DAA BCE DEB BBD BDE HBD GCJ KDJ AAA CCA AAB DBD BAE EBD GBD CDF HGH IAC AAB ABB BCC ...
output:
1742438
result:
ok 1 number(s): "1742438"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
998 419 453 BAB CDA CBB EFB CFA CGC HFD IAF IGH BBB BBB BCD BCD AAA CCB FAF BAG HAI CIE AAB BCB CCD CDC AEB EFA GHB FGD DAH IIG ABB CCA ABC AED CBE EDG HAE DEC ECA IDI ABA BAC ABC BBC AFD GAA EDG EFG BIJ IBJ AAA BAA BBC DAD FDD BCC HBA GEB EDF GGJ ABB CBA BDD EEC DAB FFG FFC AAI BJJ IAA ABA CBC DDD ...
output:
1137061
result:
ok 1 number(s): "1137061"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
998 580 808 BCB ABB BBA ECE AFG FCA GGE BBE AAB ABA ACB CAD EBB FAE CDC CDE IHG EHJ ECF ABA ACA BAD CED BBF GAG FDF AIH BHD JID ABA CAB BCB CAB ACC GBB EGE DFB HII HFK BAA BBB BAD DDB BAA GBE HAC FGG ABG CCB ABB ACC AAD CEE BBE ADB ABG ACH CEC CEJ ABA BBA CDC ACC FDD DAF GAE HGB ABA KHA ABB BCA BDA ...
output:
1624936
result:
ok 1 number(s): "1624936"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
998 678 328 CCC BAA CED DEC AED HGD CDA JIF DFE AAB BCA BBB ECC CDB GEF FAB IBD JEJ HDK ABA CCB CDC DDC BBF EGC EAF DFA FCF FHC BAA ACA BBD ADC BBF GAB FFH HFE ICH DDC BBA ABB BAA DDC EFF DAE HFG ICF GGE IKE BAA BCC CCC CCD CEE EFE BEG ECD AGI IEK ABA CCA BBD DBA BDE BAE HAC EFF AAH CFH BBA ABB AAB ...
output:
890192
result:
ok 1 number(s): "890192"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
999 597 346 CAC BDB DBC DFF DDB BHH EFB AJC FEC ABB BBA ABC DCC BBD CDD GCF EGE EEJ IFH AAA CAA DAD BAC CEF BDD ECA DDH FJH GFA ABA CCB ABC ADC ECB EGG BCD GBE FEB HBF BAB CCA ABD DEB CBD EGD BDD HIE GCE AKK ABA ACA ADB BDE EEA CDF EBF GBC JHG JCJ ABA ABC DCD CAB DBF FAD DBD HHI IID DCA ABA CAC BAA ...
output:
930394
result:
ok 1 number(s): "930394"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
999 432 414 AAC AAA BCC BCD GCF CHG CHG DGD JAI BAA BBA BCC EDE CCF DDF EHG BGI DGJ EDE BAB CBC ACB EAA BEB GDG EFA IGE HFJ ADK BAA CBA DAC CBD BDA ACC DEE IGE IDH DHH AAB CCC DDD ECC DEA EBE AGE IED JIH JFE ABB CBB DCA BCE BAC ADD BGB EGA GGE AFI AAA AAB DDB BDB AFF CAA GDF DGG IGF CEH AAA CAC DBA ...
output:
1121526
result:
ok 1 number(s): "1121526"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
999 320 780 CCA CBC BEE DFB CCE DDD BBC BCI FIG AAB BAB BDC BAC FCA EEA GCA CDD BJA BDG BAB CCA CDC CCD BEE FFE EFG GHG GCG HIC BAA AAB AAB CEC DEF EBB GGB IHF JHA CHG AAA CCC DCB BAE FAF FFF CFD FCF ADI HJC AAB BAA CDB CDD CBB FFD DCD AGA JHA EEG ABA BCA BBC CED BED EGB DGH IED IJE ADI BAB BBA CBA ...
output:
959040
result:
ok 1 number(s): "959040"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
999 532 651 ABC DBA AAE DCE CGA CCH ACE ECJ JJE BBA AAC DDB AED CED CBE DBG IIA EIA HGF ABB CAB ACC DAD FDC FGB DBD AGD EAD BGJ BBA ACA ADA ABE DCB GFE FEH FFC DGG EJE BAB ABC BAB CAA EFF GGB DBE BCA GAA GJE BAB CBB ACA CBA BAE FCC ADG ADE BGI CCF ABB CBB DAD ECD ADB GDD HDB FIC DGJ FEA BBA BAC BDC ...
output:
1472982
result:
ok 1 number(s): "1472982"
Test #22:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
999 357 996 BCC CCD ADD DBB CEC FEA AHB FAJ CAD BBB CCC CBC BAE EBE FEG EEE CCD EGH CGI BAB CBB ADD EAE FBF DCA GBB GDI HAG KJG ABB ACB BDC ADD ADB CFF DFA HHH DHI EGG ABA CCA DBB CAE CDB DFD FAH AHG ADB EKD ABB ACB DBC DAC EAB DFA GDG BII GJG JGK ABB BAC BBD BDC AEA EDG DDB IDF GJF HGH ABB ABC ADB ...
output:
1069929
result:
ok 1 number(s): "1069929"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
1000 952 386 CAB DBC DBD FBF FEG FDH ACA CCI KIJ ABB AAA DCA CBD BFD DEA AAC BFF JAI AGA BBB CAA DCD CED BAC GBB EHG EBG DEG BHE ABA BCB DAC EBE EEB EBD HGA HIE GFF EGJ BAA ABC ACC AAB CBF FEA BBH HCB CGC GFH BBA BCA ADA BAD EBB BDD HBF ECF EAG GKK ABA CCB ADC ECC DFC CBB EBC BAB HCC GDA BBA CCC CBD...
output:
1048762
result:
ok 1 number(s): "1048762"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
1000 486 2 BAB CDC EEC BEE EAA CED ICB JAG HCA BBB BBB DDA ACC AEB EBG FDD CCG AHE JAG BAB BAC ABA EED CBC BGC DCE ECI JCJ GDE BAB ABB ACD BDE FCA EBD EAH BGD JAG CJI BBB BAC ADA CEE CDA DFD CAB IEC GDE KGJ BBA CAC CBA BDB FCF BGF GCA DEA AJE EBH ABB ACC CCB BDA CFB EBG FDC IBH FEJ FBD ABA BCA CDC D...
output:
5430
result:
ok 1 number(s): "5430"
Test #25:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
1000 810 766 ABC ABD ACA BAF DCC GAC HEE CBE GCH BAB CBA DBC AAC FBD BBG GHA EID JBH DDD ABB ABA DCA BEA EDC EAC CDC AAG CCB DDI BBA BCC BBA BCC FFD BFF AFF GCE BDE DFI ABB BAC ADB DBE DCF AGC DDA FBH HDE GBE ABB ABC CDD BDE FBD CEG HAD FGC FIF DAH BAA CCC ACB EED EFD BFC GAA GCI FIH DEF BBA BBB ABC...
output:
2073562
result:
ok 1 number(s): "2073562"
Test #26:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
1000 889 958 ACB CAB EAA BAC EDG FHD CFI GID JGD AAA CAC DBC DAA BFA BGA GCA IIA BAE KEF BBA BBB DAA CAB ECE FGB AFC ADC GIJ HIC BBA ACC CAA ADE DFD CBD HDA DII FGG HJC AAB BCB DBB CEB CBE EAB HEH GFD DDI HFB ABA CBA ACB DEB DCA GFG AAE HIG DCE IKA BAA BAA DAD CDE EDA DEA FDC AGC DEA KAD ABA BCC ACA...
output:
2425920
result:
ok 1 number(s): "2425920"
Test #27:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
1000 82 743 ABA DCD BEC AED EGG DCE DCE DCH GHF ABB CBB CBC DDE CBE DGC GAD ECF AGG CDH BAB CBA BBC AEC DFF FGC ABE CCH GHG AEE BAA CCA BAB AEE BAE DBE DFC IBE DEJ GKB BBB BBB ADB BCB CFF CGC CFA FGH FJC IBE BBA AAC DCB ECA AFB EEG DDA ICG JAB HCE BAA ABA BBC EEE AAB GFB HDB CEH IGJ CIB BBB BCC BAD ...
output:
246000
result:
ok 1 number(s): "246000"