摘要: //做的第一个关于map的题,输入一些单词,按字典序输出其中不能通过重排与其他单词相同的单词,比较时不分大小写,但是输出时应保留原格式。#include<iostream>#include<algorithm>#include<string>#include<vector>#include<map> 阅读全文
posted @ 2022-03-25 16:30 noname5588 阅读(36) 评论(0) 推荐(0)
摘要: 键盘输入一个高精度的正整数 N(不超过 250位),去掉其中任意 k 个数字后剩下的数字按原左右次序将组成一个新的非负整数。 编程对给定的 N 和 k,寻找一种方案使得剩下的数字组成的新数最小。 看似很简单的贪心题,实际上有点小坑专门卡我这种菜鸡。 首先,肯定不能直接找每轮最大的数字删除,这样肯定不 阅读全文
posted @ 2022-03-20 15:53 noname5588 阅读(49) 评论(0) 推荐(0)
摘要: 洛谷P1025 将整数 n 分成 k 份,且每份不能为空,任意两个方案不相同(不考虑顺序)。 例如:n=7,k=3,下面三种分法被认为是相同的。 1,1,5;1,5,1;5,1,1. 问有多少种不同的分法。 状态转移方程是难点。 首先,dp[i][j]代表i被分j份的方案数。其中易知i<j的时候为0 阅读全文
posted @ 2022-03-20 13:10 noname5588 阅读(33) 评论(0) 推荐(0)
摘要: #include<cstdio>#include<algorithm>using namespace std;int w[2010],dp1[2010],dp2[2010];int n,m;int main(){ int i,j; scanf("%d%d",&n,&m); for(i=1;i<=n; 阅读全文
posted @ 2022-03-05 14:40 noname5588 阅读(24) 评论(0) 推荐(0)
摘要: #include<cstdio>#include<algorithm>using namespace std;int v[110],w[110],dp[250];int n;int main(){ int i,j,sum=0; scanf("%d",&n); for(i=1;i<=n;i++) { 阅读全文
posted @ 2022-03-05 14:38 noname5588 阅读(36) 评论(0) 推荐(0)
摘要: #include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<queue>using namespace std;char map[110][110];bool map1[110][110]={0};ty 阅读全文
posted @ 2022-02-28 14:20 noname5588 阅读(96) 评论(0) 推荐(0)