LeetCode Two Sum
摘要:链接: https://oj.leetcode.com/problems/two-sum/在一个数组中找出两个值,使得他们的和等于 target; 返回相应的下标+1依次查找是存在值等于 target-numbers[i]class Solution{ public: vector twoSum(...
阅读全文
HDU 1879 继续畅通工程
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1879并查集+优先队列...用cin会超时...TLE了好几次#include #include#include#define MAX_N 105using namespace std;class rode{...
阅读全文
NYOJ 113 字符串替换
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=113直接用string类里的fin()和replace()成员函数即可#include #includeusing namespace std;int main(){ string dat...
阅读全文
NYOJ 4 ASCII码排序
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=4水题#include #includeusing namespace std;int main(){ int n; cin>>n; char data[5]; while...
阅读全文
BNUOJ 1013 YC大牛的判题任务
摘要:链接:http://www.bnuoj.com/bnuoj/problem_show.php?pid=1013水题..用结构体二级排序即可..#include #include using namespace std;typedef struct{ int num; int time;}pro;pr...
阅读全文
NYOJ 86 找球号(一)
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=86用数组标记法爆内存,暴力搜索超时....有一种方法是 快排+二分查找.可以过,但是有点慢.. #include #include #include using namespace std;in...
阅读全文