Submission #1273093

#TimeUsernameProblemLanguageResultExecution timeMemory
1273093algoproclubCloud Computing (CEOI18_clo)C++20
0 / 100
1 ms572 KiB
// UUID: 514f9c8b-0a44-48f7-917d-212d498cbeb7
#include <bits/stdc++.h>
using namespace std;

int main() {
#define int long long
	int n;
	cin >> n;
	vector<int> dppc(50*n+1000, INT_MAX);
	dppc[0]=0;
	for(int i=0;i<n;i++){
		int c, _, v;
		cin >> c >> _ >> v;
		for(int j=50*i;0<=j;j--){
			dppc[j+c]=min(dppc[j+c], dppc[j]+v);
		}
	}
	int m;
	cin >> m;
	vector<int> dporder(50*m+1000, INT_MIN);
	dporder[0]=0;
	for(int i=0;i<m;i++){
		int c, _, v;
		cin >> c >> _ >> v;
		for(int j=50*i;0<=j;j--){
			dporder[j+c]=max(dporder[j+c], dporder[j]+v);
		}
	}
	for(int i=1;i<50*m;i++) dporder[i]=max(dporder[i-1], dporder[i]);
	int ans=0;
	for(int i=0;i<50*n;i++){
		printf("[%d %d]\n", dppc[i], dporder[i]);
		ans=max(ans, dporder[i]-dppc[i]);
	}
	cout << ans;
}

Compilation message (stderr)

clo.cpp: In function 'int main()':
clo.cpp:32:27: warning: format '%d' expects argument of type 'int', but argument 2 has type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} [-Wformat=]
   32 |                 printf("[%d %d]\n", dppc[i], dporder[i]);
      |                          ~^
      |                           |
      |                           int
      |                          %lld
clo.cpp:32:30: warning: format '%d' expects argument of type 'int', but argument 3 has type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} [-Wformat=]
   32 |                 printf("[%d %d]\n", dppc[i], dporder[i]);
      |                             ~^
      |                              |
      |                              int
      |                             %lld
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...