| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 788130 | rainboy | Fruits (NOI22_fruits) | C11 | 93 ms | 17840 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N	400000
int main() {
	static int aa[N], cc[N];
	static long long ss[N + 1];
	static char used[N];
	static int kk[N], xx[N], yy[N];
	int n, k, i, l, a;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &aa[i]), aa[i]--;
		if (aa[i] >= 0)
			used[aa[i]] = 1;
	}
	for (a = 0; a < n; a++)
		scanf("%d", &cc[a]);
	k = 0;
	for (a = 0; a < n; a++) {
		kk[a] = k;
		if (!used[a])
			ss[k + 1] = ss[k] + cc[a], k++;
	}
	for (k = 1; k <= n; k++)
		printf("%lld ", ss[n] - ss[n - k]);
	printf("\n");
	l = 0;
	for (i = 1; i < n; i++)
		if (aa[i] == -2)
			l++;
		else {
			if (a > aa[i])
				aa[i] = -1;
			else {
				xx[i] = kk[aa[i]], yy[i] = xx[i] - l;
				if (yy[i] < 0)
					aa[i] = -1;
			}
		}
	for (i = 0; i < n; i++) {
	}
	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... | ||||
