제출 #101759

#제출 시각아이디문제언어결과실행 시간메모리
101759rocketninja7Ice Hockey World Championship (CEOI15_bobek)C++14
40 / 100
18 ms512 KiB
#include <cstdio>

int main(){
    int N;
    long long int M;
    scanf("%d%lld", &N, &M);
    long long int A[N];
    for(int i=0;i<N;i++){
        scanf("%lld", &A[i]);
    }
    long long int ans=0;
    for(int i=0;i<(1<<N);i++){
        long long int temp=0;
        long long int tempI=i;
        while(tempI>0){
            temp+=A[__builtin_ctz(tempI)];
            if(temp>M){
                break;
            }
            tempI-=tempI&-tempI;
        }
        if(temp<=M){
            ans++;
        }
    }
    printf("%lld", ans);
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

bobek.cpp: In function 'int main()':
bobek.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%lld", &N, &M);
     ~~~~~^~~~~~~~~~~~~~~~~~
bobek.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld", &A[i]);
         ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...