# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
793371 | rainboy | RPS string (innopolis2021_final_C) | C11 | 14 ms | 2172 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <string.h>
#define N 500000
int main() {
int t;
scanf("%d", &t);
while (t--) {
static char cc[N + 1], win[N + 1];
int d, n, i, b, c;
scanf("%d%s", &d, cc), n = strlen(cc);
for (i = 0; i < n; i++)
if (cc[i] == 'r')
cc[i] = 0;
else if (cc[i] == 'p')
cc[i] = 1;
else
cc[i] = 2;
memset(win, '1', n * sizeof *win), win[n] = 0;
if (d == 1) {
b = 0;
for (i = 0; i < n; i++) {
c = cc[i];
b |= 1 << c;
if ((b & 1 << (c + 1) % 3) != 0 && (b & 1 << (c + 2) % 3) == 0)
win[i] = '0';
}
b = 0;
for (i = n - 1; i >= 0; i--) {
c = cc[i];
b |= 1 << c;
if ((b & 1 << (c + 1) % 3) != 0 && (b & 1 << (c + 2) % 3) == 0)
win[i] = '0';
}
}
printf("%s\n", win);
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |