- 博客(138)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 2018_初试 400+_浙大计算机考研经验
初试各科:政治 65+,英语 85+,数学 130+,专业课 125+ 。跨考党。以下经验方法,大家作个参考,根据具体效果决定是否采纳哈。(1,大家有问题的话,也可以在这篇博客下留言。能力所及的范围内 会回答的)(2,更新的内容(少量)放在文章末尾) 政治:所用资料:肖秀荣1000题,风中劲草核心考点,肖四,肖八1, 开始复习时间。我个人属于看书偏慢的,政治复习开始比...
2018-03-26 17:38:55
37383
82
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 PAT 甲级 目录
A1001 A1002 A1003 A1004 A1005A1006 A1007 A1008 A1009 A1010A1011 A1012 A1013 A1014 A1015A1016 A1017 A1018 A1019 A1020A1021 A1022 A1023 A1024 ...
2018-01-03 16:44:16
1201
原创 LeetCode 481 Magical String/神奇字符串
def magicalString(self, n: int) -> int: ans,i = [1],0 for i in range(n): if ans[i]==2: ans.append(ans[-1]) ans.append(ans[-1]^3) ret...
2019-10-09 12:07:27
192
原创 LeetCode 457 Circular Array Loop
def circularArrayLoop(self, nums: List[int]) -> bool: visited = [0] * len(nums) c = 0 for i in range(len(nums)): if visited[i]: continue ...
2019-09-24 11:39:04
168
原创 Leetcode 205 Isomorphic Strings
bool isIsomorphic(string s, string t) { int c1=0,c2=0; string f1=convert(s,c1),f2=convert(t,c2); if(c1==c2&&f1==f2) return true; else return false; } s...
2019-03-29 11:54:45
163
原创 Leetcode 228. Summary Ranges
vector<string> summaryRanges(vector<int>& nums) { vector<string> ans; nums.push_back(INT_MAX); for(int i=0,j=0;j<nums.size();){ if((long l...
2019-03-06 20:11:49
139
原创 Leetcode 084 Largest Rectangle in Histogram
class Solution {public: int largestRectangleArea(vector<int>& heights) { if(heights.size()==0) return 0; vector<int> lnum(heights.size(),0),rnum(heights.size(),0)...
2018-09-05 18:15:25
148
原创 Leetcode 065 Valid Number
特殊情况:1,符号处理:"+" "-" "e" ".";2,空格处理;3,前导零处理。class Solution {public: bool isNumber(string s) { if(s.empty()) return false; while(!s.empty()&&s[0]==' ') s.erase(s.begin())...
2018-08-20 17:10:37
133
原创 PAT A1130
#include <iostream>struct node{ int lchild,rchild; char data[15];}no[50];int notroot[50]={0},N,root;void inorder(int r){ if(r==-1) return; if(r!=root&&(no[r].lchild!=-1||no[r].rc...
2018-04-08 17:34:07
486
原创 PAT A1129
#include <iostream>#include <algorithm>using namespace std;struct record{ int freq; bool inrec; record(){ freq=0; inrec=false; }}re[50015];int ans[20]={0},ansindex=0,N,K;bool...
2018-04-08 17:33:17
428
原创 PAT A1128
#include <iostream>#include <algorithm>using namespace std;int seq[1020],vis[1020];bool judge(int N){ fill(vis,vis+1020,0); for(int i=1;i<=N;i++){ if(vis[seq[i]]) return false;...
2018-04-08 17:31:15
359
原创 PAT A1127
#include <iostream>#include <stack>using namespace std;struct node{ int lchild,rchild,data;}no[50];int N,in[50],post[50],nodeindex=0;int createtree(int inL,int inR,int postL,int pos...
2018-04-08 17:30:25
339
原创 PAT A1126
#include <iostream>#include <vector>using namespace std;const int maxn=520;int numver,numedge,countodd=0;vector<int> child[maxn];bool vis[maxn]={0};void DFS(int s){ if(child[...
2018-04-08 17:29:20
342
原创 PAT A1125
#include <iostream>#include <algorithm>using namespace std;int N,seq[10010];int main(){ scanf("%d",&N); for(int i=0;i<N;i++) scanf("%d",&seq[i]); sort(seq,seq+N); doub...
2018-04-08 17:28:12
201
原创 PAT A1124
#include <iostream>#include <string>#include <map>using namespace std;map<string,int> mp;int main(){ int N,skip,award; scanf("%d%d%d",&N,&skip,&award); bool..
2018-04-08 17:27:06
321
原创 PAT A1123
#include <iostream>#include <queue>using namespace std;struct node{ int data; node *lchild,*rchild;};int N;int geth(node *root){ if(root==NULL) return 0; return 1+max(geth(root-&...
2018-04-01 20:41:44
495
原创 PAT A1122
#include <iostream>#include <vector>#include <algorithm>using namespace std;const int maxn=220;bool edge[maxn][maxn]={0},vis[maxn]={0};int main(){ int N,M,K; scanf("%d%d",&am...
2018-04-01 20:40:35
529
原创 PAT A1121
#include <iostream>#include <algorithm>#include <vector>using namespace std;const int maxn=1000010;int couple[maxn],seq[10010];bool joined[maxn]={0};vector<int> ans;int...
2018-04-01 20:27:25
391
原创 PAT A1120
#include <iostream>#include <vector>#include <algorithm>using namespace std;vector<int> ans;bool vis[100]={0};void getid(int x){ int temp=x,sum=0; while(temp){ sum+=(...
2018-04-01 20:26:45
257
原创 PAT A1119
#include <iostream>struct node{ int data; node *lchild,*rchild;};int pre[30],post[30],N;bool ans=true;node* createtree(int prel,int prer,int postl,int postr){ if(prel>prer) return NUL...
2018-03-31 09:41:52
354
原创 PAT A1118
#include <iostream>const int maxn=10010;int father[maxn];int findfather(int x){ int a=x; while(x!=father[x]) x=father[x]; while(a!=father[a]){ int temp=father[a]; father[a]=x; a=te...
2018-03-31 09:40:44
248
原创 PAT A1117
#include <iostream>#include <algorithm>using namespace std;int seq[100010];int main(){ int N,ans=0; scanf("%d",&N); for(int i=0;i<N;i++) scanf("%d",&seq[i]); sort(seq,...
2018-03-31 09:39:20
302
原创 PAT A1116
#include <iostream>const int maxn=10010;int rank[maxn]={0};bool checked[maxn]={0};bool isPrime(int x){ if(x<=1) return false; for(int i=2;i*i<=x;i++) if(x%i==0) return false; retu...
2018-03-31 09:37:54
163
原创 PAT A1115
#include <iostream>#include <queue>using namespace std;struct node{ int data,layer; node *lchild,*rchild;};node* createnode(int x){ node* root=new node; root->data=x; root->...
2018-03-30 16:28:44
236
原创 PAT A1114
#include <iostream>#include <algorithm>#include <vector>#include <queue>using namespace std;const int maxn=10010;struct people{ int numset,area; vector<int> relat...
2018-03-30 16:27:37
231
原创 PAT A1113
#include <iostream>#include <algorithm>using namespace std;int seq[100010];int main(){ //freopen("g:\\in.txt","r",stdin); int N,sum1=0,sum=0; scanf("%d",&N); for(int i=0;i<N..
2018-03-30 16:26:08
216
原创 PAT A1112
#include <iostream>#include <string>using namespace std;string s;int K,status[200]={0};bool print[200]={0};void judge(int &pos){ bool stucked=true; for(int i=pos+1;i<pos+K;i...
2018-03-28 17:58:43
269
原创 PAT A1111
#include <iostream>#include <vector>#include <algorithm>using namespace std;const int maxn=520;const int INF=100000000;int N,M,catime[maxn],dis[maxn],source,desti;int tpre[max...
2018-03-28 17:57:31
309
原创 PAT A1110
#include <iostream>#include <string.h>#include <queue>using namespace std;struct node{ int lchild,rchild;}no[30];int N,root;bool notroot[30]={0};int convert(char s[]){ if(s...
2018-03-28 17:55:35
311
原创 PAT A1109
#include <iostream>#include <string.h>#include <algorithm>using namespace std;struct student{ char name[10]; int height;}st[10010];bool cmp(student a,student b){ if(a.height...
2018-03-28 17:53:08
285
原创 PAT A1108
写得又臭又长。。。有时间再来更。。。#include <iostream>#include <string.h>double ans=0;int count=0;bool check(char s[]){ int i=0,tag=0; if(s[0]=='-'){ tag=1; i++; } int len=strlen(s); ...
2018-03-28 17:51:35
270
原创 PAT A1107
#include <iostream>#include <vector>#include <algorithm>using namespace std;int hobby[1010]={0},father[1010],cluster[1010]={0},cindex=0,cnum=0;int findfather(int x){ int a=x; ...
2018-03-05 19:36:47
189
原创 PAT A1106
#include <iostream>#include <vector>#include <queue>using namespace std;const int maxn=100010;double price[maxn],increment,minprice=100000000.0;int N,minnum;vector<int> ...
2018-03-05 19:35:05
185
原创 PAT A1101
#include <iostream>#include <vector>#include <algorithm>using namespace std;const int maxn=100010;const int INF=1000000010;int initial[maxn],maxv[maxn],minv[maxn],N;vector<...
2018-03-01 15:11:57
334
原创 PAT A1044
#include <iostream>#include <map>using namespace std;int sum[100010]={0};map<int,int> ans;int binarys(int left,int right,int x){ while(left<right){ int mid=(left+right)/2;...
2018-02-21 21:22:46
197
原创 PAT A1017
注意点:1,只要在17:00点前到达,即使因为排队等至17点后,也会被服务;#include <iostream>#include <queue>#include <algorithm>using namespace std;const int maxn=10010;struct client{ int atime,ptime;}cl[maxn];...
2018-02-21 21:08:47
377
原创 PAT A1049
#include <iostream>int pow(int a,int x){ int sum=1; for(int i=0;i<x;i++) sum=a*sum; return sum;}int main(){ int N,sum=0,numdigit=0,a[50]; scanf("%d",&N); int temp=N; while(tem...
2018-02-19 22:13:29
186
原创 PAT A1080
#include <iostream>#include <algorithm>#include <vector>using namespace std;const int maxn=40010;struct student{ int ge,gi,school[6],rank,index;}st[maxn];int N,M,K,quota[150]...
2018-02-11 21:36:29
376
原创 PAT A1026
#include <iostream>#include <algorithm>#include <queue>#include <math.h>using namespace std;const int maxn=10010;const int INF=22*3600;struct record{ int atime,stime,pt...
2018-02-10 22:06:02
269
原创 PAT A1105
#include #include using namespace std;int seq[10010]={0},N,row,column;bool cmp(int a,int b){ return a>b;}int index=0,matrix[150][150];bool vis[150][150]={0};int main(){ scanf("%d",&N); for(
2018-01-29 10:41:49
281
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人