摘要: ##边集数组核心思想使用结构体存储图的起来点终点以及边权,同时也是用了深度搜索。 点击查看代码 ``` #include using namespace std; const int N=100; int m,n,a,b,c; int vis[N]; struct en{ int u,v,w; }e 阅读全文
posted @ 2023-08-16 10:52 ttyy392415 阅读(29) 评论(0) 推荐(1)
摘要: ![image](https://img2023.cnblogs.com/blog/3245044/202308/3245044-20230816100654756-1565941597.png) ###跟着思路敲了一遍,感觉清晰多了,但是还得多复习。就是利用了深度搜索,很奇妙。 点击查看代码 `` 阅读全文
posted @ 2023-08-16 10:09 ttyy392415 阅读(23) 评论(0) 推荐(1)
摘要: [题目>>](http://https://atcoder.jp/contests/abc231/tasks/abc231_c?lang=en "题目>>") ##题意:给出10^5个人的身高(1 -- 10^9),并进行10^5次询问。每次询问高于指定身高的人数。 #思路:做题时想到用二分了,但是 阅读全文
posted @ 2023-08-10 10:49 ttyy392415 阅读(19) 评论(0) 推荐(1)
摘要: #题意:起点在(1,1),每次只可以向右或者向上移动一格。要求到达(i,j)且i*j=N.给出N。 ##思路:遍历sqrt(N),i和j都是N的因子,找出最短路径。 点击查看代码 ``` #include using namespace std; #define ll long long #defi 阅读全文
posted @ 2023-08-10 10:33 ttyy392415 阅读(30) 评论(0) 推荐(1)
摘要: template inline T read() { T num = 0; int neg = 0; char c = getchar(); while (!isdigit(c) and c != '-') { c = getchar(); } if (c == '-') neg = 1; else 阅读全文
posted @ 2023-08-09 15:56 ttyy392415 阅读(54) 评论(0) 推荐(1)