NC17239. PACM Team
描述
输入描述
The first line contains a positive integer N indicating the number of candidate groups.
Each of following N lines contains five space-separated integer pi, ai, ci, mi, gi indicating that i-th team consists of pi physics experts, ai algorithm experts, ci coding experts, mi math experts, and will bring gi knowledge points.
The last line contains four space-separated integer P, A, C, M indicating the maximum possible number of physics experts, algorithm experts, coding experts, and math experts, respectively.
1 ≤ N ≤ 36
0 ≤ pi,ai,ci,mi,gi ≤ 36
0 ≤ P, A, C, M ≤ 36
输出描述
The first line should contain a non-negative integer K indicating the number of invited groups.
The second line should contain K space-separated integer indicating the index of invited groups(groups are indexed from 0).
You can output index in any order as long as each index appears at most once. If there are multiple way to reach the most total knowledge points, you can output any one of them. If none of the groups will be invited, you could either output one line or output a blank line in the second line.
示例1
输入:
2 1 0 2 1 10 1 0 2 1 21 1 0 2 1
输出:
1 1
示例2
输入:
1 2 1 1 0 31 1 0 2 1
输出:
0
C++14(g++5.4) 解法, 执行用时: 3ms, 内存消耗: 504K, 提交时间: 2018-07-26 16:32:54
#include<iostream> using namespace std; int main() { printf("0\n"); return 0; }
C++11(clang++ 3.9) 解法, 执行用时: 4ms, 内存消耗: 492K, 提交时间: 2018-07-26 16:31:26
#include <bits/stdc++.h> using namespace std; int main(){ cout<<0<<endl; }
Python3(3.5.2) 解法, 执行用时: 29ms, 内存消耗: 3432K, 提交时间: 2018-07-26 16:44:39
print(0)