이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <string.h>
#define N 100000
#define M 200000
int max(int a, int b) { return a > b ? a : b; }
int main() {
static int xx[N], yy[N], cc[N], dd[M];
int n, m, i, a, b, l, r, tmp, ans;
scanf("%d%d", &m, &n);
for (i = 0; i < n; i++)
scanf("%d%d%d", &xx[i], &yy[i], &cc[i]);
ans = 0;
for (a = 0; a < m; a++) {
memset(dd, 0, m * sizeof *dd);
for (i = 0; i < n; i++) {
l = (xx[i] - a + m) % m, r = (yy[i] - a + m) % m;
if (l > r)
tmp = l, l = r, r = tmp;
dd[l]++, dd[r]--;
}
for (b = 1; b < m; b++)
dd[b] += dd[b - 1];
ans = 0;
for (b = 1; b < m; b++)
ans = max(ans, dd[b]);
}
printf("%d\n", (ans + 1) / 2);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
arranging_tickets.c: In function 'main':
arranging_tickets.c:13:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
13 | scanf("%d%d", &m, &n);
| ^~~~~~~~~~~~~~~~~~~~~
arranging_tickets.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
15 | scanf("%d%d%d", &xx[i], &yy[i], &cc[i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| # | 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... |