Submission #101757

# Submission time Handle Problem Language Result Execution time Memory
101757 2019-03-20T00:45:44 Z rocketninja7 Ice Hockey World Championship (CEOI15_bobek) C++14
20 / 100
69 ms 384 KB
#include <cstdio>

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

Compilation message

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("%d", &A[i]);
         ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 3 ms 256 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 69 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -