Krypton

2024-01-04 08:33
文章标签 krypton

本文主要是介绍Krypton,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

题目:
In the future several years, you will surely remember that you once participated in a special China Collegiate Programming Contest. Due to COVID-19, all parties had paid a lot of effort to eventually hold a rare online programming contest. As a problem writer, I would also like to express my sincere gratitude to the organizing committee, all the contestants and others who have worked hard in this process. I also sincerely wish you good results in this special contest and a special and sweat memory in the future.

Maybe several years later, you may recall that …

Once there was a mobile game, where there was a virtual currency called coupon that could only be purchased by RMB. Kelo found that relying on his liver alone cannot make him stronger, so he decided to purchase some coupons. When he opened the recharge page, he found that this game had seven recharge columns, and was holding an activity called “First Recharge Reward”. If it was the first time a recharge column was chosen, some additional coupons would be given to the player as a reward. A player might receive several rewards if he chose several different recharge columns. A column could be chosen for arbitrary times, but there would be no additional reward except for the first time it was chosen. Here is a table describing the price, amount of coupons in normal case and additional first recharge rewards of each column.

[Math Processing Error]
Kelo had recently earned [Math Processing Error] yuan by writing problems for China Collegiate Programming Contest. He decided to recharge all these [Math Processing Error] yuan to the game, and hoped to get as many coupons as possible with these hard-earned money.

Input
The only line contains an only integer [Math Processing Error] ([Math Processing Error]).

Output
Print the maximum amount of coupons Kelo might get.

Examples
Input
100
Output
1084
Input
198
Output
2108
题解:
01背包和完全背包的混合背包

#include <bits/stdc++.h>
using namespace std;
const int N=2005;
int f[N];
struct node {int k,v,w;
};
vector<node> e;
int main()
{int m;cin>>m;e.push_back({-1,1,18});e.push_back({-1,6,60+18});e.push_back({-1,28,280+28});e.push_back({-1,88,880+58});e.push_back({-1,198,1980+128});e.push_back({-1,328,3280+198});e.push_back({-1,648,6480+388});e.push_back({1,1,10});e.push_back({1,6,60});e.push_back({1,28,280});e.push_back({1,88,880});e.push_back({1,198,1980});e.push_back({1,328,3280});e.push_back({1,648,6480});for(int i=0;i<14;i++){if(e[i].k==-1){for(int j=m;j>=e[i].v;j--){f[j]=max(f[j],f[j-e[i].v]+e[i].w);}}else{for(int j=e[i].v;j<=m;j++){f[j]=max(f[j],f[j-e[i].v]+e[i].w);}}}cout<<f[m]<<endl;return 0;
}

这篇关于Krypton的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/568740

相关文章

uva 11651 - Krypton Number System(矩阵快速幂)

题目链接:uva 11651 - Krypton Number System 题目大意:给定进制base,和分数score,求在base进制下,有多少个数的值为score,要求不能有连续相同的数字以及前导0.计算一个数的值即为相邻两位数的差平方的和。 解题思路:因为score很大,所以直接dp肯定超时,但是即使对于base=6的情况,每次新添一个数score最大增加25(0-5),所以用

UVA 11651 - Krypton Number System(DP+矩阵快速幂)

UVA 11651 - Krypton Number System 题目链接 题意:给一个进制base,一个分数score求该进制下,有多少数满足一下条件: 1、没有连续数字 2、没有前导零 3、分数为score,分数的计算方式为相邻数字的平方差的和 思路:先从dp入手,dp[i][j]表示组成i,最后一个数字为j的种数,然后进行状态转移,推出前面一步能构成的状态,也就是到dp[(b

uva 129 Krypton Factor (DFS+巧妙的判断方法)

原题链接: UVA  129 参考刘汝佳书《算法竞赛入门经典(第二版)》P195. 我是搬运工。 1.记录字母到‘A’的差值。 2.由于前面的子串已经判断过,所以只需判断含有新加字符的所有后缀子串。 3.注意输出格式 代码如下: #include<iostream>#include<cstdio>#include<cstring>using

推荐好用的免费.net第三方控件 Krypton Toolkit

下载地址:http://www.componentfactory.com/download 安装后控件栏出现Krypton Toolkit控件库。

UVA/7-5 129 - Krypton Factor

串 #include<cstdio>#include<cstring>const int MAXN=100;char a[MAXN];int n,L,cnt;bool dfs(int cur){if(cnt++ == n){for(int i=0;i<cur;i++){if(i%64==0 && i) printf("\n"); //若16组后要先换行else if(