03 2016 档案
摘要:来自http://blog.csdn.net/tiantangrenjian/article/details/16868399 set_intersection 交集 set_union 并集 set集合没有重复数字
阅读全文
摘要:#include #include #include using namespace std; int n; string c[100]; string res; int fir=1; int ok=0; string line; int main() { cin>>n; getline(cin,line); for(int i=0;i=0&&q>=0){ if(res[p]...
阅读全文
摘要:#include using namespace std; string a; int expo; int dotPos; int expoPos; int i; int main(){ cin>>a; if(a[0]=='+'||a[0]=='-'){ if(a[0]=='-'){cout0){ if((expoPos-dotPos)<=(expo+1)){ cout<<b...
阅读全文
摘要:#include #include #include using namespace std; int nc,np; vector vc,vp; int tmp; int i,j; int total; int main(){ cin>>nc; for(i=0;i>tmp; vc.push_back(tmp); } cin>>np; for(int i=0;i>tmp; ...
阅读全文
摘要:#include #include using namespace std; int n,m; map imgMap; int maxV=0; int v; int main(){ cin>>n>>m; for(int i=0;i>tmp; imgMap[tmp]++; if(imgMap[tmp]>maxV){ maxV=imgMap[tmp]; v=tmp...
阅读全文
摘要:#include #include using namespace std; int sizeMax,n,k; stack sta; int queueNum; int num; int j;int flag=0; int main(){ cin>>sizeMax>>n>>k; while(k--){ while(!sta.empty()){sta.pop();} queueNu...
阅读全文
摘要:#include #include using namespace std; int n; string card[54]={"S1","S2","S3","S4","S5","S6","S7","S8","S9","S10","S11","S12","S13", "H1","H2","H
阅读全文
摘要:#include #include #include using namespace std; struct Student{ string name; string gender; string id; int grade; int idd; }; int n; bool cmp(Student a,Student b){ return a.grade studentSet;...
阅读全文
摘要:之前不知道怎么判断是不是树,参考了 http://blog.csdn.net/eli850934234/article/details/8926263 但是最后有一个测试点有超时,在bfs里我用了数组拷贝,所以简化成直接访问超时就没有了。
阅读全文
摘要:#include using namespace std; int ag,as,ak; int bg,bs,bk; int cg,cs,ck; int main(){ scanf("%d.%d.%d",&ag,&as,&ak); scanf("%d.%d.%d",&bg,&bs,&bk); int c1=(ak+bk)/29; ck=(ak+bk)%29; int c2=(as+b...
阅读全文
摘要:#include #include #include using namespace std; int n,m,s,d; int cityMap[500][500]; int costMap[500][500]; #define INF numeric_limits::max() int dp[500]; int vis[500]; int costDp[500]; vector rout...
阅读全文
摘要:id用int,避免了id的strcmp,不然用string就超时。
阅读全文
摘要:两个坑。 一个是一直用的malloc不行了。因为malloc分配的是固定大小,之前做的题没遇到过是因为一般string都不长(malloc分配string为24个Byte),这次直接报段错误,呢们了半天。 第二个很无语,就是ID会有0,当int处理的时候把0消掉了,会有两个case不通过。
阅读全文
摘要:#include #include #include using namespace std; string a; string b; bool cmp(char a,char b){ return a>a; b=a; int num;int c=0; for(int i=a.length()-1;i>=0;i--){ num=(a[i]-'0')*2+c; c=num/1...
阅读全文
摘要:#include using namespace std; string tbl="0123456789ABC"; int main() { int a,b,c; cin>>a>>b>>c; int al=a%13,ah=a/13; int bl=b%13,bh=b/13; int cl=c%13,ch=c/13; cout<<"#"; cout<<tbl[ah]<<tbl[a...
阅读全文
摘要:输入即为回文的情况要考虑
阅读全文

浙公网安备 33010602011771号