7/25测试
正在进行…
IOI
开始于: 2026-7-25 11:30
108
小时
主持人:
27
https://oj.since2018.top/paste/show/SdUl6zOhTQMc1h8r
P7381
#include<iostream>
#include<cstring>
#include<queue>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<stack>
#include<sstream>
#include<set>
#include<time.h>
#include<stdlib.h>
#include<unordered_map>
#include<random>
#include<iomanip>
#define ll long long
#define ull unsigned long long
#define eps 1e-10
#define INF 1e9
#define delta 0.996
#define T 3000
#define pi acos(-1.0)
#define ld long double
#define vl vector<long long>
const ll mod1 = 1e9 + 7;
const ll mod2 = 998244353;
const ll mod3 = 1e9 + 9;
const int maxn = 1e5 + 10;
const int maxm = 5e3 + 10;
const ll inf = 1e18L;
using namespace std;
typedef pair<int,int>Pii;
typedef pair<ll,ll>P;
typedef pair<int, pair<int, int>>Pi;
typedef pair<string, Pi>psp;
typedef pair<int, vector<int>>piv;
const ll modd = 10007;
/*
dp[i][j] 表示,前 i 个球队,用了 j 张照片的最大值
dp[i][j] = dp[i - 1][j - x] + b[p[i] + x];
*/
int n, m, k, p[510], b[510], dp[510][510];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> k;
for(int i = 1; i <= n; i++)
cin >> p[i];
for(int i = 0; i <= m; i++)
cin >> b[i];
for(int i = 1; i <= n; i++)
{
for(int j = 0; j <= k; j++)
{
for(int x = 0; x <= j; x++)
{
if(p[i] + x > m) break;
dp[i][j] = max(dp[i][j],
dp[i - 1][j - x] + b[p[i] + x]);
}
}
}
cout << dp[n][k] << "\n";
return 0;
}
我们会在赛后检查代码相似度。
- 状态
- 正在进行…
- 规则
- IOI
- 题目
- 4
- 开始于
- 2026-7-25 11:30
- 结束于
- 2026-7-29 23:30
- 持续时间
- 108 小时
- 主持人
- 参赛人数
- 27