Submission #1049424

# Submission time Handle Problem Language Result Execution time Memory
1049424 2024-08-08T18:17:49 Z rainboy Bring Down the Grading Server (CEOI23_gradingserver) C
45 / 100
4000 ms 1048576 KB
#include <stdio.h>
 
long long min(long long a, long long b) { return a < b ? a : b; }
 
int c;
 
int solve(long long x1, long long y1, long long x2, long long y2) {
	long long y;
 
	if (x1 + y1 * c <= 0)
		return 0;
	if (x2 + y2 * c <= 0)
		return 1;
	if (x1 <= 0) {
		if (x2 > 0)
			return !solve(x2, y2, x1 + c, y1 - 1);
		else {
			y = min(-x1 / c + 1, -x2 / c + 1);
			return solve(x1 + y * c, y1 - y, x2 + y * c, y2 - y);
		}
	}
	if (x1 >= x2 && (x1 >= c || y1 > 0))
		return 1;
	if (!solve(x2 - x1, y2, x1, y1))
		return 1;
	if (x2 >= c || y1 == 0)
		return 0;
	return !solve(x2, y2, x1 + c, y1 - 1);
}
 
int main() {
	int t;
 
	scanf("%d%d", &c, &t);
	while (t--) {
		long long x1, y1, x2, y2;
 
		scanf("%lld%lld%lld%lld", &x1, &y2, &x2, &y1), x1 -= y1 * c, x2 -= y2 * c;
		printf(solve(x1, y1, x2, y2) ? "YES\n" : "NO\n");
	}
	return 0;
}

Compilation message

gradingserver.c: In function 'main':
gradingserver.c:34:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   34 |  scanf("%d%d", &c, &t);
      |  ^~~~~~~~~~~~~~~~~~~~~
gradingserver.c:38:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   38 |   scanf("%lld%lld%lld%lld", &x1, &y2, &x2, &y1), x1 -= y1 * c, x2 -= y2 * c;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Runtime error 423 ms 1048576 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 42 ms 1224 KB Output is correct
3 Correct 47 ms 1108 KB Output is correct
4 Correct 49 ms 1120 KB Output is correct
5 Correct 49 ms 3992 KB Output is correct
6 Correct 54 ms 4004 KB Output is correct
7 Correct 57 ms 3924 KB Output is correct
8 Correct 55 ms 3920 KB Output is correct
9 Correct 46 ms 3924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 42 ms 1224 KB Output is correct
3 Correct 47 ms 1108 KB Output is correct
4 Correct 49 ms 1120 KB Output is correct
5 Correct 49 ms 3992 KB Output is correct
6 Correct 54 ms 4004 KB Output is correct
7 Correct 57 ms 3924 KB Output is correct
8 Correct 55 ms 3920 KB Output is correct
9 Correct 46 ms 3924 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 44 ms 3920 KB Output is correct
12 Correct 48 ms 4040 KB Output is correct
13 Correct 58 ms 3936 KB Output is correct
14 Correct 53 ms 3976 KB Output is correct
15 Correct 54 ms 3916 KB Output is correct
16 Correct 54 ms 3816 KB Output is correct
17 Correct 53 ms 3996 KB Output is correct
18 Correct 45 ms 4008 KB Output is correct
19 Correct 52 ms 4688 KB Output is correct
20 Correct 63 ms 4436 KB Output is correct
21 Correct 79 ms 4868 KB Output is correct
22 Correct 61 ms 4692 KB Output is correct
23 Correct 59 ms 4692 KB Output is correct
24 Correct 69 ms 4436 KB Output is correct
25 Correct 66 ms 4436 KB Output is correct
26 Correct 49 ms 4652 KB Output is correct
27 Correct 51 ms 4448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 73 ms 1104 KB Output is correct
2 Correct 72 ms 1288 KB Output is correct
3 Correct 80 ms 1104 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 42 ms 1224 KB Output is correct
3 Correct 47 ms 1108 KB Output is correct
4 Correct 49 ms 1120 KB Output is correct
5 Correct 49 ms 3992 KB Output is correct
6 Correct 54 ms 4004 KB Output is correct
7 Correct 57 ms 3924 KB Output is correct
8 Correct 55 ms 3920 KB Output is correct
9 Correct 46 ms 3924 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 44 ms 3920 KB Output is correct
12 Correct 48 ms 4040 KB Output is correct
13 Correct 58 ms 3936 KB Output is correct
14 Correct 53 ms 3976 KB Output is correct
15 Correct 54 ms 3916 KB Output is correct
16 Correct 54 ms 3816 KB Output is correct
17 Correct 53 ms 3996 KB Output is correct
18 Correct 45 ms 4008 KB Output is correct
19 Correct 52 ms 4688 KB Output is correct
20 Correct 63 ms 4436 KB Output is correct
21 Correct 79 ms 4868 KB Output is correct
22 Correct 61 ms 4692 KB Output is correct
23 Correct 59 ms 4692 KB Output is correct
24 Correct 69 ms 4436 KB Output is correct
25 Correct 66 ms 4436 KB Output is correct
26 Correct 49 ms 4652 KB Output is correct
27 Correct 51 ms 4448 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 43 ms 3816 KB Output is correct
30 Correct 48 ms 3840 KB Output is correct
31 Correct 52 ms 3920 KB Output is correct
32 Correct 54 ms 3924 KB Output is correct
33 Correct 53 ms 3920 KB Output is correct
34 Correct 53 ms 3920 KB Output is correct
35 Correct 55 ms 3780 KB Output is correct
36 Correct 43 ms 3920 KB Output is correct
37 Correct 52 ms 4432 KB Output is correct
38 Correct 61 ms 4436 KB Output is correct
39 Correct 80 ms 4720 KB Output is correct
40 Correct 66 ms 4692 KB Output is correct
41 Correct 62 ms 4696 KB Output is correct
42 Correct 66 ms 4264 KB Output is correct
43 Correct 74 ms 4456 KB Output is correct
44 Correct 49 ms 4432 KB Output is correct
45 Correct 50 ms 4500 KB Output is correct
46 Correct 135 ms 5460 KB Output is correct
47 Correct 68 ms 5780 KB Output is correct
48 Correct 309 ms 5456 KB Output is correct
49 Correct 120 ms 5544 KB Output is correct
50 Correct 178 ms 5576 KB Output is correct
51 Correct 169 ms 5204 KB Output is correct
52 Correct 46 ms 4440 KB Output is correct
53 Correct 71 ms 4432 KB Output is correct
54 Correct 61 ms 4436 KB Output is correct
55 Correct 1557 ms 5924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 42 ms 1224 KB Output is correct
3 Correct 47 ms 1108 KB Output is correct
4 Correct 49 ms 1120 KB Output is correct
5 Correct 49 ms 3992 KB Output is correct
6 Correct 54 ms 4004 KB Output is correct
7 Correct 57 ms 3924 KB Output is correct
8 Correct 55 ms 3920 KB Output is correct
9 Correct 46 ms 3924 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 44 ms 3920 KB Output is correct
12 Correct 48 ms 4040 KB Output is correct
13 Correct 58 ms 3936 KB Output is correct
14 Correct 53 ms 3976 KB Output is correct
15 Correct 54 ms 3916 KB Output is correct
16 Correct 54 ms 3816 KB Output is correct
17 Correct 53 ms 3996 KB Output is correct
18 Correct 45 ms 4008 KB Output is correct
19 Correct 52 ms 4688 KB Output is correct
20 Correct 63 ms 4436 KB Output is correct
21 Correct 79 ms 4868 KB Output is correct
22 Correct 61 ms 4692 KB Output is correct
23 Correct 59 ms 4692 KB Output is correct
24 Correct 69 ms 4436 KB Output is correct
25 Correct 66 ms 4436 KB Output is correct
26 Correct 49 ms 4652 KB Output is correct
27 Correct 51 ms 4448 KB Output is correct
28 Correct 73 ms 1104 KB Output is correct
29 Correct 72 ms 1288 KB Output is correct
30 Correct 80 ms 1104 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 78 ms 13652 KB Output is correct
33 Correct 82 ms 12112 KB Output is correct
34 Correct 79 ms 12884 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 44 ms 3772 KB Output is correct
38 Correct 48 ms 3924 KB Output is correct
39 Correct 49 ms 3924 KB Output is correct
40 Correct 55 ms 3996 KB Output is correct
41 Correct 53 ms 3920 KB Output is correct
42 Correct 54 ms 3924 KB Output is correct
43 Correct 53 ms 3156 KB Output is correct
44 Correct 42 ms 2348 KB Output is correct
45 Correct 54 ms 3668 KB Output is correct
46 Correct 61 ms 3152 KB Output is correct
47 Correct 79 ms 3564 KB Output is correct
48 Correct 64 ms 3452 KB Output is correct
49 Correct 64 ms 2640 KB Output is correct
50 Correct 58 ms 1868 KB Output is correct
51 Correct 66 ms 1420 KB Output is correct
52 Correct 48 ms 1836 KB Output is correct
53 Correct 51 ms 2784 KB Output is correct
54 Runtime error 477 ms 1048576 KB Execution killed with signal 9
55 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 42 ms 1224 KB Output is correct
3 Correct 47 ms 1108 KB Output is correct
4 Correct 49 ms 1120 KB Output is correct
5 Correct 49 ms 3992 KB Output is correct
6 Correct 54 ms 4004 KB Output is correct
7 Correct 57 ms 3924 KB Output is correct
8 Correct 55 ms 3920 KB Output is correct
9 Correct 46 ms 3924 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 43 ms 3916 KB Output is correct
12 Correct 48 ms 2164 KB Output is correct
13 Correct 49 ms 3920 KB Output is correct
14 Correct 48 ms 3960 KB Output is correct
15 Correct 68 ms 3860 KB Output is correct
16 Correct 56 ms 3920 KB Output is correct
17 Correct 53 ms 2388 KB Output is correct
18 Correct 43 ms 3920 KB Output is correct
19 Correct 463 ms 5796 KB Output is correct
20 Execution timed out 4075 ms 2716 KB Time limit exceeded
21 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 42 ms 1224 KB Output is correct
3 Correct 47 ms 1108 KB Output is correct
4 Correct 49 ms 1120 KB Output is correct
5 Correct 49 ms 3992 KB Output is correct
6 Correct 54 ms 4004 KB Output is correct
7 Correct 57 ms 3924 KB Output is correct
8 Correct 55 ms 3920 KB Output is correct
9 Correct 46 ms 3924 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 44 ms 3920 KB Output is correct
12 Correct 48 ms 4040 KB Output is correct
13 Correct 58 ms 3936 KB Output is correct
14 Correct 53 ms 3976 KB Output is correct
15 Correct 54 ms 3916 KB Output is correct
16 Correct 54 ms 3816 KB Output is correct
17 Correct 53 ms 3996 KB Output is correct
18 Correct 45 ms 4008 KB Output is correct
19 Correct 52 ms 4688 KB Output is correct
20 Correct 63 ms 4436 KB Output is correct
21 Correct 79 ms 4868 KB Output is correct
22 Correct 61 ms 4692 KB Output is correct
23 Correct 59 ms 4692 KB Output is correct
24 Correct 69 ms 4436 KB Output is correct
25 Correct 66 ms 4436 KB Output is correct
26 Correct 49 ms 4652 KB Output is correct
27 Correct 51 ms 4448 KB Output is correct
28 Correct 73 ms 1104 KB Output is correct
29 Correct 72 ms 1288 KB Output is correct
30 Correct 80 ms 1104 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 43 ms 3816 KB Output is correct
34 Correct 48 ms 3840 KB Output is correct
35 Correct 52 ms 3920 KB Output is correct
36 Correct 54 ms 3924 KB Output is correct
37 Correct 53 ms 3920 KB Output is correct
38 Correct 53 ms 3920 KB Output is correct
39 Correct 55 ms 3780 KB Output is correct
40 Correct 43 ms 3920 KB Output is correct
41 Correct 52 ms 4432 KB Output is correct
42 Correct 61 ms 4436 KB Output is correct
43 Correct 80 ms 4720 KB Output is correct
44 Correct 66 ms 4692 KB Output is correct
45 Correct 62 ms 4696 KB Output is correct
46 Correct 66 ms 4264 KB Output is correct
47 Correct 74 ms 4456 KB Output is correct
48 Correct 49 ms 4432 KB Output is correct
49 Correct 50 ms 4500 KB Output is correct
50 Correct 135 ms 5460 KB Output is correct
51 Correct 68 ms 5780 KB Output is correct
52 Correct 309 ms 5456 KB Output is correct
53 Correct 120 ms 5544 KB Output is correct
54 Correct 178 ms 5576 KB Output is correct
55 Correct 169 ms 5204 KB Output is correct
56 Correct 46 ms 4440 KB Output is correct
57 Correct 71 ms 4432 KB Output is correct
58 Correct 61 ms 4436 KB Output is correct
59 Correct 1557 ms 5924 KB Output is correct
60 Correct 78 ms 13652 KB Output is correct
61 Correct 82 ms 12112 KB Output is correct
62 Correct 79 ms 12884 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 44 ms 3772 KB Output is correct
66 Correct 48 ms 3924 KB Output is correct
67 Correct 49 ms 3924 KB Output is correct
68 Correct 55 ms 3996 KB Output is correct
69 Correct 53 ms 3920 KB Output is correct
70 Correct 54 ms 3924 KB Output is correct
71 Correct 53 ms 3156 KB Output is correct
72 Correct 42 ms 2348 KB Output is correct
73 Correct 54 ms 3668 KB Output is correct
74 Correct 61 ms 3152 KB Output is correct
75 Correct 79 ms 3564 KB Output is correct
76 Correct 64 ms 3452 KB Output is correct
77 Correct 64 ms 2640 KB Output is correct
78 Correct 58 ms 1868 KB Output is correct
79 Correct 66 ms 1420 KB Output is correct
80 Correct 48 ms 1836 KB Output is correct
81 Correct 51 ms 2784 KB Output is correct
82 Runtime error 477 ms 1048576 KB Execution killed with signal 9
83 Halted 0 ms 0 KB -