Submission #1176131

#TimeUsernameProblemLanguageResultExecution timeMemory
1176131giabao249Bank (IZhO14_bank)C++20
0 / 100
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; using pii = pair<int,int>; #define int long long #define FOR(i , a , b) for(int i = a ; i < b ; i++) #define REP(i , a , b) for(int i = a ; i <= b ; i++) #define FORD(i , a , b) for(int i = a ; i >= b ; i--) #define FORE(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); i++) #define el '\n' #define all(x) x.begin(), x.end() #define bit(x) (1 << (x)) #define log(...) logger(#__VA_ARGS__, __VA_ARGS__) const int inf = 1e18; const int base = 311; const int mod = 1e9 + 7; template <typename... Args> void logger(string vars, Args&&... values); template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; } template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; } //Think const int N = 20; string name = "Task"; int f[bit(N)][N]; int n , m , x; int cost[N] , staff[N]; void GOTO_OLP2025() { cin >> n >> m >> x; FOR(i , 0 , m) cin >> cost[i]; FOR(i , 0 , m) if(cost[i] == x) { cout << "YES" << el; return; } FOR(i , 0 , m){ FOR(j , 0 , m){ if(i == j) continue; if(cost[i] + cost[j] == x){ cout << "YES" << el; return; } } } cout << "NO" << el; } void file(string s){ string in = s + ".in"; string out = s + ".out"; if(fopen(in.c_str() , "r")){ freopen(in.c_str() , "r" , stdin); } } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); file(name); //int t ; cin >> t; //while(t--) GOTO_OLP2025(); return 0; } template <typename... Args> void logger(string vars, Args&&... values) { cerr << "["; stringstream ss(vars); string var; vector<string> varNames; while (getline(ss, var, ',')) { while (!var.empty() && var.front() == ' ') var.erase(0, 1); varNames.push_back(var); } string delim = ""; size_t i = 0; ((cerr << delim << varNames[i++] << " = " << values, delim = ", "), ...); cerr << "]\n"; }

Compilation message (stderr)

bank.cpp: In function 'void file(std::string)':
bank.cpp:48:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   48 |         freopen(in.c_str() , "r" , stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...