답안 #124215

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
124215 2019-07-02T18:24:54 Z HassenAissa Ice Hockey World Championship (CEOI15_bobek) C++14
40 / 100
71 ms 380 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,m,d;
    scanf("%lld%lld",&n,&m);
    vector<long long> tab;
    long long pluss=0;
    long long moins=0;
    for(long long i=0; i<n; i++)
    {
        scanf("%lld",&d);
        if(d<=m)
            tab.push_back(d);
    }
    long long res=0;

    for(long long i=0; i<(1<<tab.size()); i++)
    {
        long long total=0;
        long long nomb=0;
        for(long long j=0; j<tab.size(); j++)
        {
            if((i&(1ll<<j))==0)
            {
                total+=tab[j];
            }
        }
        if(total<=m)
        {
            res++;
        }
    }
    printf("%lld\n",res);
    return 0;
}

Compilation message

bobek.cpp: In function 'int main()':
bobek.cpp:23:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(long long j=0; j<tab.size(); j++)
                            ~^~~~~~~~~~~
bobek.cpp:22:19: warning: unused variable 'nomb' [-Wunused-variable]
         long long nomb=0;
                   ^~~~
bobek.cpp:9:15: warning: unused variable 'pluss' [-Wunused-variable]
     long long pluss=0;
               ^~~~~
bobek.cpp:10:15: warning: unused variable 'moins' [-Wunused-variable]
     long long moins=0;
               ^~~~~
bobek.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%lld",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~~~~
bobek.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld",&d);
         ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 252 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 348 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 10 ms 380 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Correct 71 ms 256 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 71 ms 360 KB Output is correct
2 Correct 18 ms 256 KB Output is correct
3 Correct 6 ms 256 KB Output is correct
4 Correct 6 ms 256 KB Output is correct
5 Correct 71 ms 256 KB Output is correct
6 Correct 10 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 380 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -