제출 #1125671

#제출 시각아이디문제언어결과실행 시간메모리
1125671cpptowinBring Down the Grading Server (CEOI23_gradingserver)C++20
0 / 100
4094 ms324 KiB
#include<bits/stdc++.h> #define fo(i,d,c) for(int i=d;i<=c;i++) #define fod(i,c,d) for(int i=c;i>=d;i--) #define maxn 1000010 #define N 1010 #define fi first #define se second #define pb emplace_back #define en cout<<"\n"; #define int long long #define inf (int)1e18 #define pii pair<int,int> #define vii vector<pii> #define lb(x) x&-x #define bit(i,j) ((i>>j)&1LL) #define offbit(i,j) (i^(1LL<<j)) #define onbit(i,j) (i|(1LL<<j)) #define vi vector<int> #define all(x) x.begin(),x.end() #define ss(x) (int)x.size() #define all(x) x.begin(),x.end() #define UNIQUE(v) v.erase(unique(all(v)),v.end()) template <typename T1, typename T2> bool minimize(T1 &a, T2 b) { if (a > b) { a = b; return true; } return false; } template <typename T1, typename T2> bool maximize(T1 &a, T2 b) { if (a < b) { a = b; return true; } return false; } using namespace std; const int mod = 1e9 + 7; const int nsqrt = 450; int x,y,z,t,s; void solve() { cin >> x >> y >> z >> t; bool ok = 0; bool cancel1 = 0,cancel2 = 0; while(1) { if(x <= 0 or z <= 0) break; if(cancel1 and cancel2) break; if(!ok) { if(x > t * s) z -= (x - t * s); else if(x >= s and t > 0) t--; else cancel1 = 1; } else { if(z > y * s) x -= (z - y * s); else if(z >= s and y > 0) y--; else cancel2 = 1; } ok ^= 1; } if(y <= 0) cout << "YES"; else cout << "NO"; en; } main() { #define name "TASK" if(fopen(name".inp","r")) { freopen(name".inp","r",stdin); freopen(name".out","w",stdout); } ios_base::sync_with_stdio(false); cin.tie(NULL); int T; cin >> s >> T; while(T--) solve(); }

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

gradingserver.cpp:72:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   72 | main()
      | ^~~~
gradingserver.cpp: In function 'int main()':
gradingserver.cpp:77:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   77 |         freopen(name".inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
gradingserver.cpp:78:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   78 |         freopen(name".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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...