# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1125629 | cpptowin | Bring Down the Grading Server (CEOI23_gradingserver) | C++20 | 4094 ms | 324 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;
while(1)
{
if(x < 0 or z < 0) break;
if(!ok)
{
if(x > t * s) z -= (x - t * s);
else if(x >= s and t) t--;
}
else
{
if(z > y * s) x -= (z - y * s);
else if(z >= s and y) y--;
}
// cout << x << ' ' << y << ' ' << z << ' ' << t;en;
ok ^= 1;
}
if(x > 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();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |