답안 #613762

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
613762 2022-07-30T10:27:48 Z Do_you_copy Cezar (COCI17_cezar) C++17
0 / 50
1 ms 212 KB
#include <bits/stdc++.h>
#define taskname "test"
#define fi first
#define se second
#define pb push_back
#define faster ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
using ll = long long;
using ull = unsigned ll;
using ld = long double;
using pii = pair <int, int>;
using pil = pair <int, ll>;
using pli = pair <ll, int>;
using pll = pair <ll, ll>;
mt19937 Rand(chrono::steady_clock::now().time_since_epoch().count());

ll min(const ll &a, const ll &b){
    return (a < b) ? a : b;
}

ll max(const ll &a, const ll &b){
    return (a > b) ? a : b;
}

//const ll Mod = 1000000007;
//const ll Mod2 = 999999999989;
//only use when required
const int maxN = 1e5 + 1;

int n;
int a[12] = {0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 4};
void Init(){
    cin >> n;
    ll sum = 0;
    for (int i = 1; i <= n; ++i){
        int x; cin >> x;
        --a[x];
        sum += x;
    }
    if (21 - sum >= 11) cout << "VUCI";
    else{
    ll f1 = 0, f2 = 0;
        for (int i = 0; i <= 11; ++i){
            if (i >  21 - sum){
                f1 += a[i];
            }
            else f2 += a[i];
        }
        cout << (f1 > f2) ? "DOSTA" : "VUCI";
    }
}


int main(){
    if (fopen(taskname".inp", "r")){
        freopen(taskname".inp", "r", stdin);
        //freopen(taskname".out", "w", stdout);
    }
    faster;
    ll tt = 1;
    //cin >> tt;
    while (tt--){
        Init();
    }
}

Compilation message

cezar.cpp: In function 'void Init()':
cezar.cpp:49:29: warning: second operand of conditional expression has no effect [-Wunused-value]
   49 |         cout << (f1 > f2) ? "DOSTA" : "VUCI";
      |                             ^~~~~~~
cezar.cpp:49:39: warning: third operand of conditional expression has no effect [-Wunused-value]
   49 |         cout << (f1 > f2) ? "DOSTA" : "VUCI";
      |                                       ^~~~~~
cezar.cpp: In function 'int main()':
cezar.cpp:56:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   56 |         freopen(taskname".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -