OJ刷刷刷
小白狐狸
一只懒狐狸,做梦都想着“奇点”来临后的美好世界,为此奋斗。
展开
-
[PAT乙级]1013 数素数 (20 分)
题目链接:https://pintia.cn/problem-sets/994805260223102976/problems/994805309963354112关键词:判断素数#include <iostream>#include <vector>using namespace std;bool isprime(int a){ for(int i=2...原创 2019-03-11 23:38:58 · 114 阅读 · 0 评论 -
[PAT甲级]1003 Emergency (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805523835109376关键词:无向图、Dijkstra算法#include <iostream>#include <algorithm>#define maxnum 510using namespace std;int n...原创 2019-03-11 23:42:24 · 110 阅读 · 0 评论 -
《剑指Offer》(ing)
第一题:数组原创 2019-03-18 23:35:35 · 107 阅读 · 0 评论 -
LeetCode 2. Add Two Numbers(M)
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...原创 2019-09-09 13:33:14 · 216 阅读 · 0 评论 -
LeetCode 1.两数之和
题目:链接给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]解答:...原创 2019-09-15 18:15:38 · 447 阅读 · 1 评论