# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9785 | hodduc | Solve another chuck (kriii2_S) | C++98 | 4 ms | 1712 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#define rotR 0
#define rotC 1
#define negR 2
#define negC 3
int R, C;
int map[101][101];
int path[50002][3], PC;
void swap_two(int r1, int c1, int r2, int c2)
{
if(r1 == r2) {
// c1을 뒤집음
path[PC][0] = negC;
path[PC++][1] = c1;
// c2를 c1자리로 rot
path[PC][0] = rotR;
path[PC][1] = r1;
path[PC++][2] = c1 > c2 ? (c1 - c2) : (C - (c2 - c1));
// c1을 뒤집음
path[PC][0] = negC;
path[PC++][1] = c1;
// 반대로 rot
path[PC][0] = rotR;
path[PC][1] = r1;
path[PC++][2] = c1 > c2 ? (C - (c1 - c2)) : (c2 - c1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |