이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Memory_lib.h"
#define N	101
int min(int a, int b) { return a < b ? a : b; }
int code(char c) {
	if (c == '<')
		return 0;
	if (c == '>')
		return 1;
	if (c == '[')
		return 2;
	return 3;
}
int Memory(int n, int x) {
	int i, c, c_, d_, d, a, a_;
	if (x == 0)
		return ((0 * N + 0) * N + 0) * 4 + 1;
	c_ = x / 4 / N / N, i = x / 4 / N % N, d_ = x / 4 % N, a_ = x % 4;
	a = code(Get(i + 1)), d = d_ + ((a & 1) == 0 ? 1 : -1);
	if (d < 0)
		return -1;
	c = min(d_, d), d_ = d;
	if (c == c_) {
		if ((a_ & 1) != 0 && (a & 1) != 0 || (a_ & 1) == 0 && (a ^ a_) != 1)
			return -1;
		a_ = a;
	}
	if (i + 1 < n)
		return ((c_ * N + (i + 1)) * N + d_) * 4 + a_;
	else {
		if (d != 0 || (a_ & 1) == 0)
			return -1;
		if (c_ + 1 == N)
			return -2;
		return (((c_ + 1) * N + 0) * N + 0) * 4 + 1;
	}
}
컴파일 시 표준 에러 (stderr) 메시지
memory.c: In function 'Memory':
memory.c:28:21: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   28 |   if ((a_ & 1) != 0 && (a & 1) != 0 || (a_ & 1) == 0 && (a ^ a_) != 1)
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~| # | 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... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |