제출 #433990

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4339902021-06-20 13:26:30rainboyMecho (IOI09_mecho)C11
100 / 100
229 ms9024 KiB
#include <stdio.h>
#define N 800
int di[] = { -1, 1, 0, 0 };
int dj[] = { 0, 0, -1, 1 };
char cc[N][N + 1];
int dd_[N][N], dd[N][N], qu[N * N], n, s;
int solve(int im, int jm, int id, int jd, int t) {
int i, j, head, cnt;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
dd[i][j] = n * n;
head = cnt = 0;
dd[im][jm] = 0, qu[head + cnt++] = im * n + jm;
while (cnt) {
int ij, h, d;
ij = qu[cnt--, head++], i = ij / n, j = ij % n, d = dd[i][j] + 1;
if (dd_[i][j] <= t + dd[i][j] / s)
continue;
if (i == id && j == jd)
return 1;
for (h = 0; h < 4; h++) {
int i_ = i + di[h], j_ = j + dj[h];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

mecho.c: In function 'main':
mecho.c:41:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |  scanf("%d%d", &n, &s);
      |  ^~~~~~~~~~~~~~~~~~~~~
mecho.c:43:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   43 |   scanf("%s", cc[i]);
      |   ^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...