[Offer收割]编程练习赛1 register

Ended

Participants:955

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-06 16:15:06

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
#include <map>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
using namespace std;
using ll=long long ;
const int maxn=1e4+10;
const ll INF=1LL<<50;
ll dp[maxn];
int a[maxn],b[maxn];
int n,m,k,T;
auto solve=[]()
{
    for(int i=1;i<=k;i++)
        dp[i]=INF;
    dp[0]=0;
    for(int i=0;i<m;i++)
        for(int j=0;j<=k;j++)
            dp[j]=min(dp[j],dp[max(0,j-b[i])]+a[i]);
};
int main()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX