답안 #15089

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15089 2015-07-11T09:41:28 Z sujin 씽크스몰 (kriii3_TT) C++
10 / 30
10000 ms 2424 KB
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <stdlib.h>

int main(){
	int N, M;
	scanf("%d %d", &N, &M);

	int *a = (int *)malloc(sizeof(int) * (N + 1));
	int *b = (int *)malloc(sizeof(int) * (M + 1));
	for (int i = 0; i <= N; i++)
		scanf("%d", &a[i]);
	for (int i = 0; i <= M; i++)
		scanf("%d", &b[i]);

	int *c = (int *)calloc(N + M + 1, sizeof(int));
	for (int i = 0; i <= N; i++){
		for (int j = 0; j <= M; j++){
			c[i + j] += a[i] * b[j];
		}
	}

	int r = c[0];
	for (int i = 1; i <= N + M; i++)
		r ^= c[i];

	printf("%d", r);

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 2 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 2 ms 1084 KB Output is correct
8 Correct 0 ms 1084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 214 ms 1276 KB Output is correct
2 Correct 1530 ms 1828 KB Output is correct
3 Correct 4163 ms 2036 KB Output is correct
4 Execution timed out 10000 ms 2424 KB Program timed out
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Halted 0 ms 0 KB -