暂无个人介绍
#include #include #include using namespace std; /* 题目大意:对结构体进行排序 分析:建立结构体数组,按照从首地址开始的顺序(直到-1)遍历一遍整个链表, */ ...
#include using namespace std; /* 题目大意:求两个链表的首个共同结点的地址。如果没有,就输出-1 分析: 用结构体数组存储,node[i]表示地址为i的结点 key表示值,next为...
#include #include #include using namespace std; struct node { int address, data, next; }; const int NUM...
//题目大意:给出栈的最大容量 数列的长度 测试样例的数量 判断每个测试序列是否能够由该栈得到 //思路: //1.使用stl中的stack stack的size按照题设条件确定 (1)按顺序将数字入栈 (2)栈顶元素等于当前出栈序列元素时 将栈中元素出栈 (3)当不相等时入栈 //2.
#include #include #include using namespace std; //思路: 用结构体存储月饼 里面存储 月饼的数量 价格 和单价 //将月饼的单价进行排序 //根据月饼的需求 依次卖...
#include #include #include using namespace std; //思路: 用结构体存储月饼 里面存储 月饼的数量 价格 和单价 //将月饼的单价进行排序 //根据月饼的需求 依次卖...
//题意:按 平均成绩 c语言 数学 英语 中排名最高的排名输出 并输出是哪门课的排名 如果没有该id 输出 N/A //思路:用结构题存储 a, c, m, e; ra, rc, rm, re; 用ma记录是否存在 //注...
#include #include #include #include using namespace std; int main() { int n; cin >> n; vector ...
#include #include #include using namespace std; bool cmp(int &a, int &b){ return a > b; } int main() { ...
#include #include #include #include using namespace std; bool e[201][201]; int main(){ int n, m; ci...
#include #include #include #include using namespace std; int main(){ int n, m; string a, b; cin...
#include #include #include using namespace std; vector v; vector visit; int cnt = 0;//cnt != n判断不是连通图 void df...
#include #include #include using namespace std; int main(){ int n; cin >> n; vector v(n); fo...
来源 #include #include #include using namespace std; struct student { long long int no; int score, fin...
In the big cities, the subway systems always look so complex to the visitors.
//a[-1]就跟*(a-1)一样 不影响本程序结果 Given a syntax tree (binary), you are supposed to output the corresponding infix e...
#include #include #include using namespace std; string n1, n2; long long get_num(char &c){ if(isdigit(c)...
Recommendation system predicts the preference that a user would give to an item.
There is a kind of balanced binary search tree named red-black tree in the data structure.
A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set.
Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear ...
Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years.
#include #include #include using namespace std; int n; vector pre, in, post; struct node{ int data; nod...
https://github.com/uiiuiiu/PAT/tree/master/Advanced
For a student taking the online course "Data Structures" on China University MOOC (http://www.
#include #include #include #include using namespace std; int father[1001]; int hobby[1001]; int gnum[1001];...
#include #include #include using namespace std; int n, maxnum, maxdepth = 0, root = 0; double p, r; vector ...
#include #include #include #include using namespace std; vector v[100001]; vector amount[100001]; int n; d...
#include #include #include using namespace std; int n, mindepth = 9999999, minnum = 0; double p, r; vector v...
#include #include #include using namespace std; int n, k, p, maxFacSum = -1; // n 和 k 几个数字 p阶数 vector v, ...
#include #include #include using namespace std; string s, s0; void add(string &s, string &s0){ int h = 0; for (int i = (int)s.
The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.
Scientific notation is the way that scientists easily handle very large numbers or very small numbers.
The Japanese language is notorious for its sentence ending particles.
#include using namespace std; long gcd(long a, long b){ while (a) { long t = a; a = b % ...
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.
For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.
#include using namespace std; int main(int argc, const char * argv[]) { // insert code here.
#include #include using namespace std; int main(int argc, const char * argv[]) { int n; int a[10000...
#include #include using namespace std; string mars0[14] = {"tret", "jan", "feb", "mar", "apr", "may", "jun"...
#include #include #include using namespace std; int main() { int k; string s; map ma; map mb; cin >> k >> s; for(int i = 1; i < s.
Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence.
#include #include #include #include #include using namespace std; //sscanf() – 从一个字符串中读进与指定格式相符的数据 //sprintf() – 字符串格式化命令,主要功能是把格式化的数据写入某个字符串中。
"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University.
#include #include #include #include using namespace std; //题目大意 给出n个数字 将其每一位加起来sum 输出不同sum的个数 按sum 大小 //...
John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -...
The "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other.
Cutting an integer means to cut a K digits long integer Z into two integers of (K/2) digits long integers A and B.
#include #include using namespace std; bool compare(char a, char b){ return a > b;} int main(int argc, cons...
Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.