一二三四五 上山打老虎

上一页 1 2 3 4 5 6 7 8 ··· 15 下一页
摘要: 链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805073643683840 思路:最短路的变式题 dijk 中vis表示是否被当作过最小点,因为堆中已经有这个点了但是没有被当作最小点过,所有堆中可能存在多个同一个点 阅读全文
posted @ 2021-04-23 08:57 黒川川 阅读(66) 评论(0) 推荐(0)
摘要: 链接:https://pintia.cn/problem-sets/994805046380707840/problems/1336215880692482053 string中find的使用方法; 推荐使用:string str; str.find("smallstr",(int)s);从s处开始 阅读全文
posted @ 2021-04-21 22:26 黒川川 阅读(248) 评论(0) 推荐(0)
摘要: 链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805106325700608 暴力判素数故意卡i*i<=x 代码: #include<bits/stdc++.h> using namespace std; bool 阅读全文
posted @ 2021-04-21 16:50 黒川川 阅读(114) 评论(2) 推荐(0)
摘要: 链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805081289900032 思路:首先理解清楚题意:给队员分座位,保证同一个学校的队员不挨着,如果前一个座位的同学是自己学校的,那么隔一个去坐(意思等同于文中,最后剩 阅读全文
posted @ 2021-04-21 16:42 黒川川 阅读(128) 评论(0) 推荐(0)
摘要: 链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805082313310208 矩阵乘法: for(int i=1;i<=a;i++) for(int j=1;j<=y;j++) for(int k=1;k<=b;k+ 阅读全文
posted @ 2021-04-20 22:18 黒川川 阅读(79) 评论(0) 推荐(0)
摘要: 链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805084284633088 思路: 思路1:模拟乘法,计算为了使当前位为1,应该乘的数为几,需要搜索,程序编写麻烦;//没写出来 思路2:模拟除法, 思路参考链接:h 阅读全文
posted @ 2021-04-20 21:46 黒川川 阅读(51) 评论(0) 推荐(0)
摘要: 链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805117167976448 反思:这个题中每个人的名称是五位的数字,但是用int类型存储的话只能得到15分,最后两个测试数据过不去;也就是测试数据中可能存在整数值相同 阅读全文
posted @ 2021-04-20 11:19 黒川川 阅读(151) 评论(0) 推荐(0)
摘要: 链接:https://www.acwing.com/problem/content/1115/ 代码: bfs: #include<iostream> #include<algorithm> #include<queue> using namespace std; char s[25][25]; i 阅读全文
posted @ 2021-04-15 10:49 黒川川 阅读(66) 评论(0) 推荐(0)
摘要: 链接:https://www.acwing.com/problem/content/1103/ 代码: #include<bits/stdc++.h> using namespace std; using PII=pair<int,int>; int dx[]={0,-1,0,1}; int dy[ 阅读全文
posted @ 2021-04-15 10:44 黒川川 阅读(80) 评论(0) 推荐(0)
摘要: 链接:https://www.acwing.com/problem/content/1098/ 思路:1:三维bfs:可以分为当前层数内的二维内偏移和层数的一维偏移 代码: #include<iostream> #include<queue> #include<string> #include<cs 阅读全文
posted @ 2021-04-15 10:42 黒川川 阅读(54) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 15 下一页