#include #include #include using namespace std;

int main() { int N; cin >> N; vector cards(N); for (int i = 0; i < N; i++) { cin >> cards[i]; } sort(cards.begin(), cards.end());

int sum = 0;
for (int i = 0; i < N; i++) {
    sum += cards[i];
}

int X = 21 - sum;
int greaterCount = 0;
int smallerCount = 0;

for (int i = 1; i <= 10; i++) {
    if (i > X) {
        greaterCount += 4;
    } else if (i < X) {
        smallerCount += 4;
    }
}

if (greaterCount > smallerCount || greaterCount == smallerCount) {
    cout << "DOSTA" << endl;
} else {
    cout << "VUCI" << endl;
}

return 0;

}

C++ 21 点游戏决策:优化策略,助你赢取胜利

原文地址: https://www.cveoy.top/t/topic/qr4D 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录