답안 #472717

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
472717 2021-09-14T08:18:08 Z MamdouhN Cezar (COCI17_cezar) C++14
50 / 50
1 ms 268 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"

vector<int>allcards;

main()
{
    for(int i=2;i<=14;i++)
    {
        int x = i;
        if(i>11) x =10;
        allcards.push_back(x);
        allcards.push_back(x);
        allcards.push_back(x);
        allcards.push_back(x);
    }
    int deck = 52;
    //cout<<allcards.size()<<endl;
    //for(auto v:allcards)cout<<v<<" ";
    //cout<<endl;
    sort(allcards.begin(),allcards.end());
    int n;
    cin>>n;
    int sum = 0;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        for(int i=0;i<allcards.size();i++)
            if(allcards[i]==x)
            {
                allcards[i]=0;
                break;
            }
        deck--;
        sum+=x;
    }
    sum = 21-sum;
    int greate=0;
    for(int i=0;i<allcards.size();i++)if(allcards[i]>sum)greate++;
    if(greate>=deck-greate)cout<<"DOSTA"<<endl;
    else cout<<"VUCI"<<endl;

}

Compilation message

cezar.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~
cezar.cpp: In function 'int main()':
cezar.cpp:31:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |         for(int i=0;i<allcards.size();i++)
      |                     ~^~~~~~~~~~~~~~~~
cezar.cpp:42:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |     for(int i=0;i<allcards.size();i++)if(allcards[i]>sum)greate++;
      |                 ~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 268 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct