
简单题
Samson_Ho
Desire for the better.
展开
-
【SCU】Carries
#includeusing namespace std;long long carries;const int MAXN=100010;int a[MAXN],b[MAXN];int main(void){ int n; while(~scanf("%d",&n)) { carries=0; for(int i = 0; i <转载 2017-07-11 10:56:33 · 318 阅读 · 0 评论 -
(Floyd)【UVA - 10048】Audiophobia
题目链接:https://vjudge.net/problem/UVA-10048题意:水题。给c个点s条边的无向图,q次询问,求两点之间最大权值最小的路径。Floyd跑一遍出结果。/** @Author: SamsonHo* @Date: 2018-10-16-22.37.25* @URL:*/#include<bits/stdc++.h>#define IN...原创 2018-10-17 00:00:11 · 201 阅读 · 0 评论 -
(Floyd)【UVA - 247】Calling Circles
题目链接:https://vjudge.net/problem/UVA-247水题,Floyd跑一遍,找双向联通的直接输出就好。 /** @Author: SamsonHo* @Date: 2018-10-16-21.46.03* @URL:https://vjudge.net/problem/UVA-247*/#include<bits/stdc++.h>...原创 2018-10-16 22:22:52 · 145 阅读 · 0 评论 -
(BFS)【UVA - 11624】Fire!
题目链接:https://vjudge.net/problem/uva-11624两遍BFS,第一遍把每个点着火的时间记录下来存在t数组里,然后第二遍BFS就是搜索解了。好像暑假集训网络赛遇到个类似的题目,当时没做出来。/** @Author: SamsonHo* @Date: 2018-10-06-23.49* @URL:https://vjudge.net/problem/...原创 2018-10-08 08:49:37 · 123 阅读 · 0 评论 -
(贪心)【UVA - 11729 】Commando War
题目链接:https://vjudge.net/problem/UVA-11729跟看电视节目那个基本的贪心一样,就把执行时间最长的先交代了,这样就能保证最优解。大白书上有解析这样的正确性。没有初始化状态v搞得WA了四发。。。/** @Author: SamsonHo* @Date: 2018-09-19-20.10.23* @URL:https://vjudge.net/pr...原创 2018-09-19 20:38:24 · 159 阅读 · 0 评论 -
【UVA - 11292】Dragon of Loowater
题目链接:https://vjudge.net/problem/uva-11292简单思维题,自增提前加了WA了两三发。/** @Author: SamsonHo* @Date: 2018-09-17-15.00.14* @URL:https://vjudge.net/problem/uva-11292*/#include<bits/stdc++.h>#def...原创 2018-09-18 22:52:57 · 133 阅读 · 0 评论 -
(拓扑排序)【HDU 4857】逃生
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4857典型的拓扑排序,注意使用优先队列将编号大的放后面,反向排序就行。#include<bits/stdc++.h>#define INF 0x3f3f3f3fusing namespace std;const int MAXN = 1e5+10;int out[MAX...原创 2018-07-26 09:29:55 · 223 阅读 · 0 评论 -
(递归)【UVA 839】Not so Mobile
题目链接:https://vjudge.net/problem/UVA-839简单递归,参考了刘汝佳的代码。#include<bits/stdc++.h>#define INF 0x3f3f3f3fusing namespace std;const int MAXN = 1000+10;bool solve(int& w){ int w1,d1,w2,d2;...原创 2018-06-08 18:12:54 · 122 阅读 · 0 评论 -
(prim)【HDU 1233】还是畅通工程
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1233裸模板题,我都敲了好久。。。/** @Author: Samson* @Date: 2018-06-14 16:12:07* @Last Modified by: Samson* @Last Modified time: 2018-06-14 17:38:25*/// @U...原创 2018-06-14 17:39:04 · 121 阅读 · 0 评论 -
(单源最短路径 Dijkstra)【AOJ】Graph II - Single Source Shortest Path
题目链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_12_B/** @Author: Samson* @Date: 2018-06-14 09:42:05* @Last Modified by: Samson* @Last Modified time: 2018-06-14 10:11:15*/...原创 2018-06-14 15:19:59 · 270 阅读 · 0 评论 -
(prim)【ALDS1_12_A】Graph II - Minimum Spanning Tree
题目链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_12_A简单模板题,总算开始搞图论了,效率十分低。。/** @Author: Samson* @Date: 2018-06-12 18:24:44* @Last Modified by: Samson* @Last Modified time: 2...原创 2018-06-13 12:55:46 · 151 阅读 · 0 评论 -
(Floyd)【HDU 1217】Arbitrage
ArbitrageTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8653 Accepted Submission(s): 3989Problem DescriptionArbitrage is the原创 2017-09-17 17:40:34 · 150 阅读 · 0 评论 -
【链表】Broken Keyboard (a.k.a. Beiju Text)
You’re typing a long text with a broken keyboard. Well it’s not so badly broken. The only problemwith the keyboard is that sometimes the “home” key or the “end” key gets automatically pressed(inte原创 2017-07-16 08:34:46 · 430 阅读 · 0 评论 -
1343: C语言提高篇:第6题(蛇形填数)
题目描述在n*n方陈里填入1,2,...,n*n,要求填成蛇形。例如n=4时方陈为:10 11 12 19 16 13 28 15 14 37 6 5 4输入直接输入方陈的维数,即n的值。(n输出输出结果是蛇形方陈。样例输入3样例输出7 8 16 9 25 4 3#includeint row(int原创 2017-03-27 22:20:56 · 289 阅读 · 0 评论 -
(模拟)【UVA-11995】I Can Guess the Data Structure!
水一发,主要是要判断一下queue和stack是不是空的,不是空的再执行pop操作,虽然想到了但是没改,RE了一下才写。/** @Author: SamsonHo* @Date: 2019-02-23-00.15* @URL:https://vjudge.net/problem/UVA-11995* @Note:*/#include<bits/stdc++.h>...原创 2019-02-23 00:58:55 · 154 阅读 · 0 评论