![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pat
Togyu
这个作者很懒,什么都没留下…
展开
-
1085 Perfect Sequence (25分)(二分,two points)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-27 16:23:46 · 167 阅读 · 0 评论 -
1048 Find Coins (25分) (二分、散列)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-27 14:29:06 · 176 阅读 · 0 评论 -
1061 Dating (20分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-25 16:27:40 · 147 阅读 · 0 评论 -
1011 World Cup Betting (20分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-21 23:22:18 · 133 阅读 · 0 评论 -
1062 Talent and Virtue (25分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-19 22:50:33 · 103 阅读 · 0 评论 -
1046 Shortest Distance (20分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-19 21:32:41 · 122 阅读 · 0 评论 -
1042 Shuffling Machine (20分
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-18 23:31:17 · 123 阅读 · 0 评论 -
1030 Travel Plan (30 分) (DFS + Dijtras 模板)
#include <cstdio>#include <vector>#include<queue>#include<algorithm>using namespace std;const int maxv = 1010,INF = 0x3fffffff;bool vis[maxv]{false};int n,m,c1,c2;int ...原创 2019-09-25 22:57:38 · 140 阅读 · 0 评论 -
1003 Emergency (25分) Dijkstra
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <set>#include <map>using namespace std原创 2020-05-17 22:58:38 · 128 阅读 · 0 评论 -
1034 Head of a Gang (30分) (DFS 图)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <map>using namespace std;const int maxn = 20原创 2020-05-14 20:52:38 · 101 阅读 · 0 评论 -
1107 并查集
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <map>using namespace std;const int maxn = 10原创 2020-05-11 22:39:48 · 107 阅读 · 0 评论 -
AVL树建立 1066
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#include <map>using namespace std;struct node //建立节原创 2020-05-11 10:16:36 · 166 阅读 · 0 评论 -
1043 Is It a Binary Search Tree (25分) (BST)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#incl...原创 2020-05-06 00:08:36 · 145 阅读 · 0 评论 -
1053 Path of Equal Weight (30分) (树的静态写法,先根排序,DFS)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#incl...原创 2020-04-25 10:52:05 · 137 阅读 · 0 评论 -
1020 Tree Traversals (25分)(后序和中序确定二叉树)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#incl...原创 2020-02-04 21:46:16 · 151 阅读 · 0 评论 -
1052 Linked List Sorting (25分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#incl...原创 2020-01-31 20:45:59 · 131 阅读 · 0 评论 -
1032 Sharing (25分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#incl...原创 2020-01-31 16:22:26 · 122 阅读 · 0 评论 -
1056 Mice and Rice (25分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#incl...原创 2020-01-29 20:16:03 · 136 阅读 · 0 评论 -
1051 Pop Sequence (25分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <stack>#include <queue>#incl...原创 2020-01-29 17:04:33 · 131 阅读 · 0 评论 -
高精度整数(大整数)四则运算模板
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>using namespace std;const int Maxn = 100010;stru...原创 2020-01-28 15:19:03 · 309 阅读 · 0 评论 -
求质因子模板and求素数筛法and1059题解
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>using namespace std;const int Maxn = 100010; //int...原创 2020-01-27 16:29:43 · 2617 阅读 · 0 评论 -
素数判断总结(筛法***)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>using namespace std;const int Maxn = 11;int prime...原创 2020-01-27 01:08:16 · 249 阅读 · 0 评论 -
最大公约数、最小公倍数和分数四则运算模板
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;const int Maxn = 2020;int gcd(int a,int b) //最大公约数模...原创 2020-01-25 20:58:58 · 249 阅读 · 0 评论 -
1069 The Black Hole of Numbers (20分)
//代码每次提交分数都不一样。。。原因不明,偶尔满分#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;const int Maxn = 2020;bo...原创 2020-01-25 20:45:17 · 230 阅读 · 0 评论 -
1016 Phone Bills (25分)(待续。。,没有真实通话记录的不应该输出的问题没解决)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;const int Maxn = 2020;int toll[40];int oneday = 0...原创 2020-01-25 18:44:48 · 224 阅读 · 0 评论 -
1012 The Best Rank (25分)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;const int Maxn = 2020;typedef struct record{ i...原创 2020-01-22 21:35:46 · 176 阅读 · 0 评论 -
1044 Shopping in Mars (25分)
#include <iostream> //二分法寻找元素的方法#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;const int Maxn = 10011;int n,m,dim[Maxn...原创 2020-01-22 15:26:00 · 154 阅读 · 0 评论 -
1010 Radix (25分)(进制转换,二分法,溢出)
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;const int Maxn = 1001;typedef long long LL;LL INF=...原创 2020-01-21 14:30:35 · 193 阅读 · 0 评论 -
7.3 1032 Sharing (25 分) (***)
#include <iostream>#include <cstdio>#include <map>#include <string>#include <stack>#include <queue>using namespace std;int p,g,order[1010];struct Node{ ...原创 2019-08-11 13:56:42 · 91 阅读 · 0 评论 -
5.4 素数1015 Reversible Primes (20 分)(未AC***)(看错题目)(进制转化***)
do { d[index]=n%radix; index++; n/=radix; }while(n>0); for(int i = 0;i<index;i++) { ...原创 2019-07-03 20:44:18 · 103 阅读 · 0 评论 -
1043 Is It a Binary Search Tree (25 分)(******)
#include <cstdio>#include <iostream>#include <vector>using namespace std;struct node{ int data; node* l; node* r;};node* root = NULL;void insertT(node* &root...原创 2019-09-06 22:04:29 · 74 阅读 · 0 评论 -
8.2 1091 Acute Stroke (30 分)(********)
#include <cstdio>#include <queue>using namespace std;struct node{ int x; int y; int z;}Node;int n,m,l,t;int matrix[1290][130][65];bool inq[1290][130][65] = {false};int...原创 2019-08-18 15:36:36 · 90 阅读 · 0 评论 -
5.5 1096 Consecutive Factors (20 分)(***)
#include <cstdio>#include <cmath>typedef long long LL;struct node{ int x; int cnt;}fac[110];int main(){ LL fn; int ansF,ansLen=0; scanf("%lld",&fn); ...原创 2019-07-05 19:46:07 · 133 阅读 · 0 评论 -
5.5 1059 Prime Factors (25 分)
错一个点23分#include <cstdio>#include <cmath>struct node{ int x; int cnt;}fac[110];bool isPrime(int n){ if(n<=1) return false; for(int i = 2;i<=sqrt(n);i++) {...原创 2019-07-05 16:20:39 · 115 阅读 · 0 评论 -
5.3 1088 Rational Arithmetic (20 分)
#include <cstdio>#include <cmath>#include <algorithm>using namespace std;typedef long long ll;typedef struct Fraction{ ll up; ll down;}F;int gcd(ll a,ll b){ if...原创 2019-06-29 15:00:03 · 95 阅读 · 0 评论 -
5.3 1081 Rational Sum (20 分)
#include <cstdio>#include <cmath>#include <algorithm>using namespace std;typedef long long ll;typedef struct Fraction{ ll up; ll down;}F;int gcd(ll a,ll b){ if...原创 2019-06-29 14:15:15 · 176 阅读 · 0 评论 -
5.4 素数1078 Hashing (25 分)(*题意理解)
Quadratic probing (with positive increments only) is used to solve the collisions.(哈希表)用二次方探测法来解决矛盾(此题只需要考虑正向);二次方探测法证明,只需要算到步长为止,如果超过步长还是冲突则之后也是一样摘自《算法笔记》主要是题目没读懂,读懂了这道题难度一般#include <cstdio&...原创 2019-07-04 11:50:42 · 149 阅读 · 0 评论 -
1060 Are They Equal (25 分)(******)
感觉陷入了死局。。。对string理解不够,越写越烦,可以做出来但是时间花的太久,用了2个小时得了7分。。。#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <iostream>using namespace std...原创 2019-07-12 21:16:00 · 62 阅读 · 0 评论 -
5.1 1049 Counting Ones (30 分)(******)
主要是考虑每一个位数上可以为1的可能来思考#include <cstdio>#include <cmath>#include <algorithm>using namespace std;const int N = 100010;int main(){ int n,temp,ans=0; scanf("%d",&n);...原创 2019-06-28 12:41:40 · 94 阅读 · 0 评论 -
5.1 1008 Elevator (20 分)
#include <cstdio>#include <algorithm>using namespace std;const int N = 100010;int main(){ int n,s[N]={0},ans=0; scanf("%d",&n); s[0]=0; for(int i = 1;i<=n;i+...原创 2019-06-28 10:55:41 · 88 阅读 · 0 评论