Submission #904063

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9040632024-01-11 19:17:58rainboyShifty Grid (CCO17_shifty)C11
25 / 25
9 ms1636 KiB
#include <stdio.h>
#define N 100
#define M 100
#define K (N * M * 4 + 1)
int aa[N][M], ii[N * M], jj[N * M], n, m;
int tt[K], hh[K], dd[K], k;
void rotate(int i1, int j1, int i2, int j2, int cw) {
int di, dj, a, b, c;
di = (i2 - i1 + n) % n, dj = (j2 - j1 + m) % m;
if (cw) {
tt[k] = 2, hh[k] = j1, dd[k] = n - di, k++;
tt[k] = 1, hh[k] = i1, dd[k] = m - dj, k++;
tt[k] = 2, hh[k] = j1, dd[k] = di, k++;
tt[k] = 1, hh[k] = i1, dd[k] = dj, k++;
a = aa[i1][j1], b = aa[i1][j2], c = aa[i2][j1];
aa[i1][j1] = c, ii[c] = i1, jj[c] = j1;
aa[i1][j2] = a, ii[a] = i1, jj[a] = j2;
aa[i2][j1] = b, ii[b] = i2, jj[b] = j1;
} else {
tt[k] = 1, hh[k] = i1, dd[k] = m - dj, k++;
tt[k] = 2, hh[k] = j1, dd[k] = n - di, k++;
tt[k] = 1, hh[k] = i1, dd[k] = dj, k++;
tt[k] = 2, hh[k] = j1, dd[k] = di, k++;
a = aa[i1][j1], b = aa[i1][j2], c = aa[i2][j1];
aa[i1][j1] = b, ii[b] = i1, jj[b] = j1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.c: In function 'main':
Main.c:40:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   40 |  scanf("%d%d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~
Main.c:43:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   43 |    scanf("%d", &a);
      |    ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...