답안 #427600

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
427600 2021-06-14T17:40:38 Z CSQ31 Happiness (Balkan15_HAPPINESS) C++14
컴파일 오류
0 ms 0 KB
#include "happiness.h"
#include "happiness.cpp"
#include <stdio.h>
#include <stdlib.h>

#define NMAX 200000
#define QMAX 100000

static int N, Q;
static long long M;
static long long coins[NMAX], A[5];

int main()
{
	int i, d;
	long long max_code;

	scanf("%d%lld", &N, &M);
	for (i = 0; i < N; ++i) {
		scanf("%lld", &coins[i]);
	}
	if (init(N, M, coins))printf("1\n");
	else printf("0\n");
	scanf("%d", &Q);
	for (i = 0; i < Q; ++i) {
		int ck, c;
		scanf("%d%d", &ck, &c);
		for (int j = 0; j < c; j++) {
			scanf("%lld", &A[j]);
		}
		if (is_happy(ck, c, A))printf("1\n");
		else printf("0\n");
	}

	return 0;
}

Compilation message

happiness.cpp:2:10: fatal error: happiness.cpp: No such file or directory
    2 | #include "happiness.cpp"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
grader.cpp: In function 'int main()':
grader.cpp:16:12: warning: unused variable 'max_code' [-Wunused-variable]
   16 |  long long max_code;
      |            ^~~~~~~~