9363 [ICPC2022 Xi‘an R] Hotel

#include 
#define int_max 0x3f3f3f3f;
#define long_max 9223372036854775807;
using namespace std;
typedef long long ll;
typedef pair PII;
typedef pair PDD;
typedef unsigned long long ull;
const int MAXN = 1e6;
int n,c1,c2;
string s;
int main() {
    cin>>n>>c1>>c2;
    int res = 0;
    for(int i=1;i<=n;i++){
        cin>>s;
        int k = min(3*c1,3*c2);
        if(s[0] == s[1] || s[0] == s[2] || s[1] == s[2]){
            k = min({c2 + c1 , c2 + c2 , k});
        }
        res += k;
    }
    cout<

你可能感兴趣的:(基本算法,算法,c++,数据结构)