ssfc / PAT

program for PAT
0 stars 0 forks source link

PATNote #42

Open ssfc opened 5 years ago

ssfc commented 5 years ago

PATNote.zip

ssfc commented 5 years ago

1.Find the most popular program language, VS 2010; (2018-4-7) 2.Install VS 2010, done; (2018-4-9) 3.1002: 4.K is the number of nonzero terms in the polynomial 5.1 <= K <= 10 6.Ni (exponents) and aNi(coefficients) (i=1, 2, ..., K) are the exponents and coefficients 7.0 <= NK < ... < N2 < N1 <=1000 8.Get input, done; (2018-4-9) 9.Change first, done; change second, done; change output; (2018-4-9) 10.----------------------------------------------------------------------------------- 11.Download java jdk, done; install; download Eclipse, done; (2018-4-10) 12.1002 难点在于消除末尾空格; (2018-4-10) 13.the first line contains 4 positive integers: 5 6 0 2 14.N (<= 500) - the number of cities (and the cities are numbered from 0 to N-1) 5 15.M - the number of roads 6 16.C1 and C2 - the cities that you are currently in and that you must save, respectively. 0, 2; 17.The next line contains N integers, where the i-th integer is the number of rescue teams in the i-th city. 1个 2个 1个 5个 3个 18.Initialize one road; (2018-4-10) 19.26 + (3-2)6 + (3-1)*4 20.-------------------------------------------------------------------------------------------------- 21.= 12 + 6 + 8 = 26 22.Move compare out as a function, give up; (2018-4-12) 23.Getline(cin, first_string); (2018-4-12) 24.100ms are all hash table; (2018-4-12) 25.First, find out common character, done; (2018-4-14) 26.Update apps in the cell phone; (2018-4-14) 27.$ dpkg --print-architecture; display whether your Debian/Ubuntu operating system is 32-bit or 64-bit; (2018-4-14) 28.Change 1015 to vector; (2018-4-14) 29.-5 % 3 = -2; (2018-4-15) 30.--------------------------------------------------------------------------------------------------- 31.Rewirte 1002, done; (2018-4-15) 32.Use class to modify 1002; replace first.num; replace second.num; done; (2018-4-16) 33.Combine tag 1 and tag 2, done; (2018-4-16) 34.Install resilio-sync on ubuntu; done; (2018-4-18) 35.Download resilio sync for linux, done; (2018-4-18) 36.Update java, done; (2018-4-18) 37.Modify cross-hour function, done; modify cross-day function, done; (2018-4-18) 38.类不能用来做二维数组; (2018-4-26) 39.Try to use gcc to compile program, the answer is g++; (2018-4-26) 40.----------------------------------------------------------------------------------------------------- 41.G++ 1001; 1002; 1004; done; (2018-4-27) 42.Modify earth_to_mar to deal with zero; done; modify mar_to_earth to deal with zero, done; (2018-4-27) 43.Store binary search tree; done; (2018-4-28) 44.we need vector insert; done; (2018-4-28) 45.中序遍历得到从小到大; done; (2018-4-29) 46.全局变量在类结构体之下, 函数之上; (2018-5-1) 47.中医数字化,以穴位作为标签;找出相似穴位;定位穴位功能;(2018-5-3) 48.Try to use strcmp; give up; (2018-5-5) 49.Change exponent to int; done; change dishu to radix, done; (2018-5-5) 50.-------------------------------------------------------------------------------------------------- 51.Get kuaidi package; (2018-5-5) 52.User id is not string, user id is int; (2018-5-6) 53.Install proxychains; configure proxychains, socks5 127.0.0.1 1080; (2018-5-10) 54.Change password of Dropbox so that it is strong as usual; (2018-5-10) 55.Try to install lantern history version, give up; (2018-5-11) 56.Change google account to current cell phone; done; (2018-5-11) 57.Problem: glib-error, fail to allocate 13421728 bytes; guess the server is too small, add a big one; register a 2G server; solved; (2018-5-11) 58.Install resilio sync: install tsocks; conf file is configure; learn how to use ubuntu to add public key; (2018-5-12) 59.Resilio begin to synchronize; find destination folder; (2018-5-12) 60.-------------------------------------------------------------------------------------------------- 61.Ubuntu’s version name is animal; (2018-5-13) 62.Download ubuntu 1404; copy to sync desktop; (2018-5-13) 63.Install shadowsocks; install pip; (2018-5-13) 64.Ubuntu chinese is really Chinese; (2018-5-13) 65.Uninstall firefox; install latest firefox; (2018-5-13) 66.Install wps community on small computer; Install wps; download; done; (2018-5-13) 67.Try to install lantern on linux; download from git; give up; (2018-5-13) 68.Order English book on Tianmao; (2018-5-15) 69.Ubuntu Chinese is too bad; change back to English; (2018-5-17) 70.-------------------------------------------------------------------------------------------------- 71.Fix Chinese input; (2018-5-17) 72.Finally install Dropbox to ubuntu; move dropbox away from resilio sync; (2018-5-17) 73.Find old PAT test on the web; (2018-5-18) 74.Convert capital to lower case; done; (2018-5-19) 75.Use hash table to describe, done; (2018-5-20) 76.We notice that what change is next, address is stable; (2018-5-20) 77.Learn how to swap element in linklist; give up; (2018-5-21) 78.Add location to linklist, done; (2018-5-21) 79.Add prev in the linklist; prev should be added in the process of traversal; done; (2018-5-21) 80.------------------------------------------------------------------------------------------------- 81.Move previous; consider first; (2018-5-22) 82.Hamiltonian Cycle is a NP problem; (2018-5-22) 83.Edge must belong to the set; cross every point once; (2018-5-24) 84.Add clear function to vba, done; (2018-5-24) 85.1127: 希望用静态链表, 动态链表经常出错; (2018-5-25) 86.Learn how to traversal map; print map; done; (2018-5-28) 87.Rename inorder as post_order; (2018-5-28) 88.Ubuntu 1604 is so pretty; (2018-5-30) 89.Delete -1 in 1002.cpp; give up; it is useful; (2018-5-30) 90.--------------------------------------------------------------------------------------------------- 91.DFS of a graph, done; (2018-5-30) 92.Modify 1017.cpp; done; (2018-6-1) 93.Generate preorder from postorder and inorder; (2018-6-2) 94.Generate post order from preorder and inorder; (2018-6-2) 95.Change first_addr to head; change data to key; use while to replace for; done; (2018-6-7) 96.Change rank to level, done; (2018-6-9) 97.Sort sequence according to their value; done; (2018-6-21) 98.Add tree leaf to tree; modify get_height to get distance; done; (2018-6-24) 99.Learn how to initialize vector; vector post, in, level(100000, -1); (2018-6-25) 100.--------------------------------------------------------------------------------------------------- 101.Change name to key; change to inStart and inEnd; done; (2018-6-26) 102.Use C++ struct to replace c, done; replace scanf with cin, done; replace printf with cout, done; (2018-6-26) 103.Replace 1020 with build_tree; done; (2018-6-26) 104.Change post to post_order, done; change middle to in_order, done; (2018-6-26) 105.Use vector to replace queue in 1020, done; replace data with key, done; (2018-6-26) 106.Read WeChat; (2018-6-27) 107.Hold yinyang; (2018-6-27) 108.Replace midStart with inStart, done; replace midEnd with inEnd, done; (2018-6-28) 109.Modify pre_in_order; replace int name with int key, done; delete binary, done; (2018-6-28) 110.-------------------------------------------------------------------------------------------------- 111.Calculate height for each node; (2018-6-29) 112.Change amount of bool leaf; done; (2018-6-30) 113.Hold we chat; (2018-6-30) 114.Modify 1099 with 1102; done; (2018-6-30) 115.Check snow women second skill; (2018-6-30) 116.Hold yinyang; (2018-6-30) 117.Replace save with linklist_origin, done; (2018-7-3) 118.Replace cnt with counter, done; (2018-7-3) 119.Replace flag with bool, done; (2018-7-3) 120.------------------------------------------------------------------------------------------------------ 121.Delete printf, done; replace n with N, done; replace scanf with cin, done; (2018-7-3) 122.Replace de with virtue, done; replace cai with talent, done; replace num with ID, done; (2018-7-3) 123.Replace low with L, done; replace hight with H, done; (2018-7-3) 124.replace scanf with cin, not successful; (2018-7-3) 125.replace printf with cout, not sucessful; (2018-7-3) 126.Use vector to describe 2d array, give up; (2018-7-4) 127.Use resize to modify vector, done; (2018-7-4) 128.First decide whether it is a clique or not, done; (2018-7-4) 129.Move K out, done; move vector cluster out, done; move cluster out as a function, done; (2018-7-6) 130.------------------------------------------------------------------------------------------------------- 131.back, get last element of vector, done; (2018-7-6) 132.If previous is push, then current node is left child of previous child, done; (2018-7-6) 133.The problem is, node is not 1 2 3 4, but 4 digit number; use static link list to solve the problem; give up; (2018-7-7) 134.Resize is good; done; (2018-7-7) 135.Replace DFS with BFS, done; (2018-7-8) 136.Delete declaration of function; (2018-7-11) 137.Delete so many struct, done; (2018-7-11) 138.Change result type from int to node, done; (2018-7-12) 139.Change int_to_string, string_to_int, done; (2018-7-12) 140.--------------------------------------------------------------------------------------------------- 141.Replace N with width, done; (2018-7-12) 142.Change adjacent matrix type to int, and store length; done; (2018-7-12) 143.Change tongfen to plus, done; (2018-7-17) 144.Separate string_to_node, done; (2018-7-17) 145.Separate node_to_string, done; (2018-7-17) 146.Find code of d algorithm, done; (2018-7-17) 147.Replace V with num_v, done; (2018-7-17) 148.take dist[v] out, done; take sptSet out, done; take graph out, done; (2018-7-17) 149.Replace graph with adjacency matrix, done; (2018-7-17) 150.---------------------------------------------------------------------------------------------------- 151.Take print solution out, done; (2018-7-18) 152.Add previous to shortest path, done; print path from source to node, done; (2018-7-18) 153.Try to change source for shortest path, done; (2018-7-18) 154.It is not dfs of tree, but dfs of graph; (2018-7-19) 155.Delete previous in 1087, done; (2018-7-20) 156.Find code of merge sort, done; (2018-7-21) 157.Delete arr in parameter, done; (2018-7-21) 158.Delete n in print, done; delete n in merge sort, done; (2018-7-21) 159.Change merge vector into 1089’s vector, done; (2018-7-22) 160.------------------------------------------------------------------------------------------------------ 161.Change linklist_origin to linklist_first, done; (2018-7-29) 162.Replace val with value; replace wt with weight; (2018-8-1) 163.Use struct to replace two vectors; done; (2018-8-2) 164.Change start from 1 to 0, done; (2018-8-2) 165.Replace printf with cout; done; (2018-8-19) 166.Change adjacent matrix into two dimensional, give up, not robust; (2018-8-21) 167.Change midStart to inStart, done; change midEnd to inEnd, done; (2018-8-29) 168.Change findFather to find_father, done; (2018-9-2) 169.Change minDistance to min_index, done; change 0 to INT_MAX, done; (2018-9-2) 170.------------------------------------------------------------------------------------------------------- 171.Directly cin, done; (2018-9-4) 172.Print ID card, done; (2018-9-5) 173.Download mingw, done; install mingw, done; (2018-9-5) 174.Set path for mingw, done; done; (2018-9-5) 175.Dowload eclispe, done; Install eclipse, done; (2018-9-6) 176.Run command, win+R; (2018-9-6) 177.Update windows; done; (2018-9-8) 178.Download dev-cpp, done; (2018-9-8) 179.Move function out; move print out, done; move insert last out, give up; (2018-9-15) 180.Considering head, done; (2018-9-16) 181.Move print out, done; (2018-9-17) 182. 183. 184. 185. 186. 187. 188.中北大学: 潘广贞, 13934621825@139.com 189.Dev-Cpp 5.4.0 MinGW 4.7.2; Eclipse-win32; jdk-7u15-windows-i586; 190. 191. 192. 193. 194.root->key = post_order[postEnd];
195.root->left = build_tree(inStart , position-1, postStart, postStart-inStart+position-1);
196.root->right = build_tree(position+1, inEnd, postStart-inStart+position, postEnd-1); 197. 198.root->key = pre_order[preStart];

  1. root->left = build_tree(inStart, position-1, preStart+1, preStart-inStart+position);
  2. root->right = build_tree(position+1, inEnd, preStart-inStart+position+1, preEnd);
  3. 211.-