- 博客(16)
- 收藏
- 关注
原创 1005 Spell It Right (20分) PTA(Advanced Level) Practice
#include<iostream>#include<algorithm>#include<sstream>using namespace std;typedef long long ll;string English[10]={"zero","one","two","three","four","five","six","seven","eight","nine"};string itos(int a){ string s; stringstream.
2020-08-13 01:18:33 148
原创 1041 Be Unique (20分) PTA(Advanced Level) Practice
样例1输入7 5 31 5 88 67 88 17输出31.样例2输入5 888 666 666 888 888输出None#include<iostream>#include<algorithm>#include<map>using namespace std;typedef long long ll;map<int,int>Map;int main(){ int N,a[100009]; cin>>..
2020-08-12 21:49:38 174
原创 十一届蓝桥杯省赛B组c/c++ 试题E 矩阵
dfs肯定跑不出来 这种一般都是动态规划左边的数小 上边的数小对于每个新的数 要么紧挨着放在上边一行 要么紧挨着放在下边一行如果放在下边,当然前提是上边有数才行dp【i】【j】:上边i个数,下边一行j个数的可能的情况数初始:dp【0】【0】=1 上边一行和下边一行都没数的情况算一种一个新的数 dp【i】【j】放在上边 dp【i】【j】+= dp【i-1】【j】放在下边 dp【i】【j】+= dp【i】【j-1】 放之前要判断填完这个 1010*1010 的表最后的 dp【..
2020-08-12 21:36:15 2341 6
原创 十一届蓝桥杯省赛B组c/c++ 试题I 整数拼接
先是 部分 分数 的代码 , 后面是优化的思路和代码#include<iostream>#include<algorithm>using namespace std;int n,K,a[1001],ans=0;bool Merge(int i,int j){//第i个数和第j个数拼接 是否符合条件 int t=a[j],cnt=1; while(t!=0){ cnt*=10; t/=10; } if((a[i]*cnt+a[j])%K==0) .
2020-08-12 21:00:55 593 1
原创 十一届蓝桥杯省赛B组c/c++ 试题G 解码
#include<iostream>#include<algorithm>using namespace std;int main(){ string s,ans; cin>>s; for(int i=0;i<s.length();i++) { int k=s[i]-'0'; if(k<10&&k>1) for(int j=1;j<k;j++) ans+=s[i-1]; else .
2020-08-12 16:57:38 250
原创 十一届蓝桥杯省赛B组c/c++ 试题H 走方格
dfs可以做, 但是建议,递推肯定不会超时#include<iostream>#include<algorithm>using namespace std;typedef long long ll;#define MAX 10000const ll INF=1e9;int n,m,ans=0;int a[31][30];int main(){ cin>>n>>m; a[1][1]=1; for(int i=1;i<=n;..
2020-08-12 16:33:00 355
原创 1027 Colors in Mars (20分)PTA(Advanced Level) Practice
1027 Colors in Mars (20分)People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2
2020-08-09 23:38:07 82
原创 1002 A+B for Polynomials (25 分) PTA(Advanced Level) Practice
Sample Input:2 1 2.4 0 3.22 2 1.5 1 0.5Sample Output:3 2 1.5 1 2.9 0 3.2#include<iostream>#include<map>using namespace std;map<int,double>M;int n,Max=-1;void d(){ cin>>n; for(int i=0;i<n;i++){ int a; double b;.
2020-08-09 16:28:31 161
原创 UE4 静态网格体碰撞 Collision Prims:0
问题:问题出现过程: 制作贪吃蛇案例,食物是自己建的,蛇头碰到食物后出现检测不到的问题。食物是用笔刷创建几何体(一个椭圆球减去下半部分) 组合得到的形状 (形状见下面图)然后创建了静态网络物体一个蓝图类里添加这个静态网格体 如图出现碰撞模拟检测 检测不到这个蓝图的问题而新建的测试蓝图,点击绿色添加组件, 添加的 Cube则可以被检测到对比发现 笔刷创建那个 静态网格体显示 Collision Prims:0如图:图片是改好的,之前 Collision Prims:0 且为黄色,感觉是这
2020-08-06 04:38:32 2147 2
原创 并查集 模板-食物链
//并查集////查询 是否在同一个组//合并 这两个组#include<iostream>#include<algorithm>using namespace std;typedef long long ll;const int N=100;int head[N];int rank[N];void init(int n){ for(int i=...
2020-02-04 11:25:37 90
原创 动态规划 完全背包问题 zzzz
//完全背包问题 #include<iostream>#include<algorithm>using namespace std;int dp[4][8];int main(){ int n=3;//3种物品 int W=7;//7个容量 int w[4]={0,3,4,2}; int v[4]={0,4,5,3}; //dp[i][j]:表示 ...
2020-02-03 16:25:45 111
原创 棋盘多项式 递归搜索
棋盘多项式问题描述 八皇后问题是在棋 盘上放皇后,互相不攻击,求方案。变换一下棋子,还可以有八车问题,八马问题,八兵问题,八王问题,注意别念反。在这道题里,棋子换成车,同时棋盘也得 换,确切说,是进行一些改造。比如现在有一张n*n的棋盘,我们在一些格子上抠几个洞,这些洞自然不能放棋子了,会漏下去的。另外,一个车本来能攻击和它 的同行同列。现在,你想想,在攻击的过程中如果踩到一个洞,便会自取灭...
2020-02-03 13:47:18 429
原创 HPU‘s birthday
HPU’s birthday时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述2019.10.20 is the 110th birthday of HPU. On that day, you can see the string “110” everywhere. Hery is ...
2020-02-03 13:23:07 187
原创 Xor Path 树路径异或
Xor Path时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述In graph theory, if an undirected gragh G(V, E) without cycle has n vertices, n − 1 edges and the graph is conne...
2020-02-03 12:54:20 229
原创 数组模拟邻接表 链式向前星
原理和想法在注释里//数组模拟邻接表//链式向前星 #include<iostream>#include<cstring>using namespace std;class node{ public: int from; int to; int other;//权重啊其他的啥的 int next;//存该边起点的出边的上一条出边 的序号 }e...
2020-02-01 18:21:05 190 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人