제출 #1284256

#제출 시각아이디문제언어결과실행 시간메모리
1284256beka19Bank (IZhO14_bank)C++20
0 / 100
1 ms572 KiB
#include <bits/stdc++.h>
using namespace std;
#define sped ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define s second
#define f first
const int N = 5e5 + 10;
void okok(){
    int n,m;
    cin >> n >> m;
    int x;
    cin >> x;
    int b[m + 1];
    for(int i = 0;i < m;i++){
        cin >> b[i];
    }
    for(int i = 1 ;i < (1<<m);i++){
        int sum = 0;
        for(int j = 0;j < m;j++){
            if( ((1 << j) & i) != 0){
                sum += b[i];
            }
        }
        if(sum == x){
            cout << "YES";
            return;
        }
    }
    cout << "NO";
}
signed main() {
    freopen("bank.in", "r", stdin) ;
   freopen("bank.out", "w", stdout);
sped
int tt = 1;
//cin >> tt;
while(tt--){
    okok();
    cout << '\n';
    }
}

















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

bank.cpp: In function 'int main()':
bank.cpp:32:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |     freopen("bank.in", "r", stdin) ;
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
bank.cpp:33:11: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |    freopen("bank.out", "w", stdout);
      |    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...