Submission #1069675

# Submission time Handle Problem Language Result Execution time Memory
1069675 2024-08-22T08:03:40 Z NeroZein Bring Down the Grading Server (CEOI23_gradingserver) C++17
0 / 100
4000 ms 1104 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int s, q;
	cin >> s >> q;
	while (q--) {
		vector<long long> c(2), f(2), mn(2, LLONG_MAX);
		cin >> c[0] >> f[0] >> c[1] >> f[1];
		for (int i = 0; i < 2; ++i) {
			for (int j = 0; j <= f[i ^ 1]; ++j) {
				long long damage = c[i] - (f[i ^ 1] - j) * s;
				if (damage > 0) {
					mn[i] = min(mn[i], (c[i ^ 1] + damage - 1) / damage + j); 
				}
			}
		}
		cout << (mn[0] <= mn[1] ? "YES" : "NO") << '\n'; 
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Execution timed out 4086 ms 348 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 87 ms 1104 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 87 ms 1104 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4070 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 87 ms 1104 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 87 ms 1104 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 87 ms 1104 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 87 ms 1104 KB Output isn't correct
3 Halted 0 ms 0 KB -