답안 #655647

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
655647 2022-11-05T05:02:19 Z zegna12 Jelly Flavours (IOI20_jelly) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
typedef long long int ll; typedef long double ld; using namespace std; const ll mod = 1e9 + 7, inf = 1e18, maxn = 1e5;

int find_maximum_unique(int X, int Y, vector<int> a, vector<int> b) {
	int N = X + 2 * Y, M = a.size() & 1;
	for (auto& x : b)
		x *= 2;
	vector<vector<int>> dp(2, vector<int> (N + 1, 0));
	for (int _ = 0; _ < a.size(); ++_) {
		int x = a[_];
		int y = b[_];
		for (int j = N; j >= x; --j)
			dp[_ & 1][j] = max(dp[_ & 1][j], dp[(_ & 1) ^ 1][j - x] + 1);
		for (int j = N; j >= y; --j)
			dp[_ & 1][j] = max(dp[_ & 1][j], dp[(_ & 1) ^ 1][j - y] + 1);
	}
	return *max_element(dp[M].begin(), dp[M].end());
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << fixed << setprecision(20);
	// freopen ("hps.in", "r", stdin);
	// freopen ("hps.out", "w", stdout);
	return 0;
}

Compilation message

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:11:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for (int _ = 0; _ < a.size(); ++_) {
      |                  ~~^~~~~~~~~~
/usr/bin/ld: /tmp/ccvGFVVi.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccW0JFvl.o:jelly.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status