답안 #652145

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
652145 2022-10-21T13:42:01 Z 4EVER Cezar (COCI17_cezar) C++11
20 / 50
1 ms 340 KB
/******************************
*    author : @yayayaya       *
*    date : 21 / 10 / 2022    *
******************************/

/*   (≈ㅇᆽㅇ≈)♡    (≈ㅇᆽㅇ≈)♡    (≈ㅇᆽㅇ≈)♡    (≈ㅇᆽㅇ≈)♡    (≈ㅇᆽㅇ≈)♡ */
/*
                              /^--^\     /^--^\     /^--^\
                              \____/     \____/     \____/
                             /      \   /      \   /      \
                            |        | |        | |        |
                             \__  __/   \__  __/   \__  __/
        |^|^|^|^|^|^|^|^|^|^|^|^\ \^|^|^|^/ /^|^|^|^|^\ \^|^|^|^|^|^|^|^|^|^|^|^|
        | | | | | | | | | | | | |\ \| | |/ /| | | | | |\ \| | | | | | | | | | | |
        | | | | | | | | | | | | |/ /| | |\ \| | | | | |/ /| | | | | | | | | | | |
        | | | | | | | | | | | | |\/ | | | \/| | | | | |\/ | | | | | | | | | | | |
        #########################################################################
        | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
        | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |         */

/*******************************************************************************************
*            #################################################################             *
*            #                             _`                                #             *
*            #                          _ooOoo_                              #             *
*            #                         o8888888o                             #             *
*            #                         88" . "88                             #             *
*            #                         (| -_- |)                             #             *
*            #                         O\  =  /O                             #             *
*            #                      ____/`---'\____                          #             *
*            #                    .'  \|     |//  `.                         #             *
*            #                   /  \|||  :  |||//  \                        #             *
*            #                  /  _||||| -:- |||||_  \                      #             *
*            #                  |   | \  -  /'| |   |                        #             *
*            #                  | \_|  `\`---'//  |_/ |                      #             *
*            #                  \  .-\__ `-. -'__/-.  /                      #             *
*            #                ___`. .'  /--.--\  `. .'___                    #             *
*            #             ."" '<  `.___\_<|>_/___.' _> \"".                 #             *
*            #            | | :  `- \`. ;`. _/; .'/ /  .' ; |                #             *
*            #            \  \ `-.   \_\_`. _.'_/_/  -' _.' /                #             *
*            #=============`-.`___`-.__\ \___  /__.-'_.'_.-'=================#             *
*                                      `=--=-'                                             *
*                                                                                          *
*                                       /\_/\*                                             *
*                                      (  -.-)                                             *
*         _.-/`)                       / >O  \>1                            _.-/`)         *
*        // / / )                                                         // / / )         *
*     .=// / / / )              /\_/\           /\_/\                  .=// / / / )        *
*    //`/ / / / /              (  -.-)         (  -.-)                //`/ / / / /         *
*   // /     ` /               / >O  \>1       / >O  \>1             // /     ` /          *
*   \       /                                                        \       /             *
*    ))    .'            /\_/\         /\_/\         /\_/\            ))    .'             *
*   //    /             (  -.-)       (  -.-)       (  -.-)           //    /              *
*        /              / >O  \>1     / >O  \>1     / >O  \>1              /               *
*                                                                                          *
*******************************************************************************************/

#include <bits/stdc++.h>
// #pragma GCC optimize("O2")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimize ("O3,unroll-loops,no-stack-protector")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define PB push_back
#define ALL(i_) i_.begin(), i_.end()
#define LOG2(x) (31 - __builtin_clz(x))
#define getBit(x, i) ((x >> i) & 1)
#define rd(l, r) (l + rng() % (r - l + 1))
#define FOR(i_, a_, b_)  for(int i_ = (int) (a_); i_ <= (int) (b_); ++i_)
#define FORD(i_, a_, b_) for(int i_ = (int) (a_); i_ >= (int) (b_); --i_)
#define db(val) "["#val" = "<<(val)<<"] "

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;

template<class X, class Y> bool minimize(X &x, const Y &y){
    X eps = 1e-9;
    if (x > y + eps) {
        x = y;
        return 1;
    }
    return 0;
}

template<class X, class Y> bool maximize(X &x, const Y &y) {
    X eps = 1e-9;
    if (x + eps < y) {
        x = y;
        return 1;
    }
    return 0;
}

template<class T> T Abs(const T &x) { return (x < 0 ? -x : x); }

const int mod = (int) 1e9 + 7;
const int oo = (int) 1e9 + 99;
const int maxn = (int) 1e5 + 11;
const int LOG = (int) 20;
const ii dxy8[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1}, {1, -1}, {1, 1}, {-1, 1}, {-1, -1} };
const ii dxy4[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1} };



int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define TASK "CEZAR"
    if(fopen(TASK".inp", "r")) {
        freopen(TASK".inp", "r", stdin);
        freopen(TASK".out", "w", stdout);
    }
    int n; cin >> n;
    vector<int> a(n);
    FOR(i, 0, n - 1) cin >> a[i];
    int diff = 21 - accumulate(ALL(a), 0);
    int cnt[12];
    FOR(i, 2, 9) cnt[i] = 4;
    cnt[10] = 16;
    cnt[11] = 4;
    FOR(i, 0, n - 1) cnt[a[i]]--;
    int res = 0;
    FOR(i, diff + 1, 11) res += cnt[i];
    int ans = 0;
    FOR(i, 2, diff) ans += cnt[i];
    cout << ((res >= ans) ? "DOSTA" : "VUCI");
    return 0;
}

/// CONCACOCONCACOCONCACOCONCACOCONCACOCONCACOCONCACOCONCACOCONCACO /// 

Compilation message

cezar.cpp: In function 'int main()':
cezar.cpp:111:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  111 |         freopen(TASK".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
cezar.cpp:112:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  112 |         freopen(TASK".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
# 결과 실행 시간 메모리 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 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 272 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -