- 博客(37)
- 资源 (8)
- 收藏
- 关注
原创 在Chrome中实现百度网盘在线倍速播放
这里用的是Chrome浏览器!步骤:更多工具 —》开发者工具—》console-》添加一行代码videojs.getPlayers("video-player").html5player.tech_.setPlaybackRate(倍速)比如我想1.5倍速播放videojs.getPlayers("video-player").html5player.tech_.setPl...
2019-02-06 22:01:22 16297 5
原创 PAT (Advanced Level) Practice — 1039 Course List for Student (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805447855292416Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the course...
2019-02-28 22:55:25 196
原创 PAT (Advanced Level) Practice — 1149 Dangerous Goods Packaging (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/1038429908921778176When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same contai...
2019-02-28 20:36:35 150
原创 PAT (Advanced Level) Practice — 1154 Vertex Coloring (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/1071785301894295552Aproper vertex coloringis a labeling of the graph's vertices with colors such that no two vertices sharing the sa...
2019-02-27 21:46:53 199
原创 STL—— set
set<int> a;//set定义 set<node> st;//node是结构体类型set<int> a[100]; //set数组 #include<cstdio>#include<set>using namespace std;int main(){ set<int> st; st.inser...
2019-02-27 21:44:42 143
原创 PAT (Advanced Level) Practice — 1140 Look-and-say Sequence (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805344490864640Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...whe...
2019-02-27 19:56:03 140
原创 PAT (Advanced Level) Practice — 1153 Decode Registration Card of PAT (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/1071785190929788928A registration card number of PAT consists of 4 parts:the 1st letter represents the test level, namely,Tfor the...
2019-02-27 19:44:36 210
原创 PAT (Advanced Level) Practice — 1152 Google Recruitment (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/1071785055080476672In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) f...
2019-02-27 09:22:33 440
原创 PAT (Advanced Level) Practice — 1144 The Missing Number (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805343463260160Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Speci...
2019-02-27 08:50:38 124
原创 PAT (Advanced Level) Practice — 1136 A Delayed Palindrome (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805345732378624Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0≤ai<...
2019-02-27 08:01:37 144
原创 在Dev中使用c++11特性的函数
在Dev里使用C++11特性的函数,例如stoi、to_string等,会出现错误,这时需要让dev支持c++11工具——编译选项——编译器——编译:加入这个命令"-std=c++11"...
2019-02-26 19:36:52 450
原创 PAT (Advanced Level) Practice — 1132 Cut Integer (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805347145859072Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. F...
2019-02-26 19:31:30 164
原创 PAT (Advanced Level) Practice — 1128 N Queens Puzzle (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805348915855360The "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens th...
2019-02-26 18:40:18 152
原创 PAT (Advanced Level) Practice — 1124 Raffle for Weibo Followers (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805350803292160John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that...
2019-02-26 17:12:34 116
原创 PAT (Advanced Level) Practice — 1120 Friend Numbers (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805352925609984Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID...
2019-02-26 15:33:40 127
原创 PAT (Advanced Level) Practice — 1116 Come on! Let's C (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805355358306304"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejian...
2019-02-26 11:36:44 166
原创 PAT (Advanced Level) Practice — 1112 Stucked Keyboard (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805357933608960On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters correspon...
2019-02-26 10:23:09 143
原创 PAT (Advanced Level) Practice — 1108 Finding Average (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805360777347072The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it compl...
2019-02-24 19:29:37 181
原创 STL——vector
一.vector的定义1. 单独定义一个vector:vector<typename> name;typename可以是int、double、char、结构体等,也可以是STL标准容器,但要注意在>>符号之间加空格,否则会被视为移位操作,导致编译错误。vector<char> name;vector<int> name;vec...
2019-02-24 16:52:20 116
原创 查找——静态查找_插值查找
假如要在集合[1,100](分布不一定均匀)中查找10,我们下意识中肯定是看靠前的部分,而不是先看中间的部分。查单词也类似,如果在字典中查找“apple”,我们一般都是先翻到字典相对靠前的部分比对,而不是一开始就翻到正中间去比对,这就是插值查找的来源。插值查找在增长均匀的元素序列中效率最高(比折半查找高),在增长差异大的元素序列中效率最差(比折半查找低)。二分查找中查找点计算如下:mid=...
2019-02-19 17:13:45 197
原创 查找——静态查找_斐波那契查找
二分查找每次查找时会在查找范围上限的中点处比较,而斐波那契查找则在查找范围上限的一个斐波那契分割点上进行查找。斐波那契查找的优点是在确定下一个比对元素时,仅用加、减就可以计算得出,比二分查找的除法要节省时间。第一,计算并保存一个斐波那契序列的数组,fib[1]=1,fib[2]=1,fib[3]=2,fib[4]=3,fib[5]=5。 第二,将有序数组的长度扩充到 n=fib[k]-1...
2019-02-19 16:56:04 242
原创 高数常见的符号及其读法
大写 小写 英文注音 国际音标注音 中文注音 Α α alpha alfa 阿耳法 Β β beta beta 贝塔 Γ γ gamma...
2019-02-18 15:46:31 32772 1
原创 查找——静态查找_二分查找
int BinarySearch(STable ST,int k){ int left,right,mid; left=1; right=ST.length; while(left<=right){ mid=(left+right)/2; if(k<ST.elem[mid]){ right=mid-1; }else if(k>ST.elem...
2019-02-17 21:29:42 374
原创 查找——静态查找_顺序查找
顺序查找://在elem[1]~elem[n]中查找关键字为k的数据元素 int SequentialSearch(SSTable ST,char k){ ST.elem[0]=k;//哨兵 int i; for(i=ST.length;ST.elem[i]!=k;i--);//从后往前找 return i;} #include<stdio.h>...
2019-02-17 16:17:42 315
原创 线索二叉树
线索二叉树:将指向空链域的左指针指向其前驱,右指针指向其后继。通过中序遍历对二叉树线索化的递归算法 通过中序遍历建立中序线索化二叉树(含头结点) 中序遍历建立中序线索化二叉树(不含头结点) 中序遍历二叉线索树的非递归算法#include<stdio.h>#include<stdlib.h>typedef struct ThreadNode{ cha...
2019-02-17 15:11:34 1065
原创 二叉树的顺序存储(数组实现)
递归方式实现:ABCDE^F^^G————————————————————————————△深度和长度此时T的长度为:10,深度为:4————————————————————————————△层序遍历A B C D E F G————————————————————————————△前序遍历A B D E G C F————————————————————————————△中序遍...
2019-02-14 22:30:56 2730
原创 二叉链表存储(先序、后序、中序、层次遍历)
非递归解法如下:输入:ABD^^EG^^^C^F^^△前序遍历 A B D E G C F△中序遍历 D B G E A C F△后序遍历 D G E B F C A△层次遍历 A B C D E F G #include<stdio.h>#include<stdlib.h> #include<stack>#include<...
2019-02-14 22:28:27 4789
原创 二叉树的遍历(图示+详细代码)递归与非递归解法
先序遍历(NLR):根结点 - 左子树 - 右子树中序遍历(LNR):左子树 - 根结点 - 右子树后序遍历(LRN):左子树 - 右子树 - 根结点输入:ABD^^EG^^^C^F^^△前序遍历 A B D E G C F△中序遍历 D B G E A C F△后序遍历 D G E B F C A△层次遍历 A B C D E F G 递归实现:(一)数组...
2019-02-13 19:29:18 552
原创 PAT (Advanced Level) Practice — 1100 Mars Numbers (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805367156883456People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Ea...
2019-02-13 09:39:24 222
原创 PAT (Advanced Level) Practice — 1104 Sum of Number Segments (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805363914686464Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the s...
2019-02-07 22:34:52 180
原创 PAT (Advanced Level) Practice — 1096 Consecutive Factors (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805370650738688Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be ...
2019-02-06 21:30:57 172
原创 PAT (Advanced Level) Practice — 1093 Count PAT's (25 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805373582557184The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th charact...
2019-02-02 16:36:15 239
原创 PAT (Advanced Level) Practice — 1092 To Buy or Not to Buy (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805374509498368Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. The...
2019-02-01 21:00:16 124
原创 PAT (Advanced Level) Practice — 1088 Rational Arithmetic (20 分)
题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805378443755520For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, differen...
2019-02-01 17:20:49 193
原创 【算法笔记】— 数学问题之分数的四则运算
1.分数的表示struct Fraction{ int up;//分子 int down;//分母 };①分数的表示形式为假分数②如果分数为负数,则让分子为负数,分母为正数③如果分数恰为0,则让分子为0,分母为1④分数要求最简(即分子和分母没有除了1以外的公约数)2.分数的化简Fraction reduction(Fraction res){ if(res.do...
2019-02-01 15:02:28 697
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人