摘要:
Two arrays:NC[],NP[]Supposed that two points (l1 and r1)start from the head and the tail of the array of NC seperately,in a similar way,exists two points(l2 and r2)points to the the head and end of the array of NP.l1 and l2 move to the right step by step guaranted that nc[l1]0 and np[r2]>0,otherw 阅读全文
摘要:
// 1019. General Palindromic Number.cpp: 主项目文件。 #include "stdafx.h"
#include bool isPalindromic(int *arr, int length){ for(int i=0,j=length-1;i=0;i--){ if(i!=cnt-1) printf(" "); printf("%d",aa[i]); } printf("\n"); return 0;
} 阅读全文
摘要:
// 1012. The Best Rank.cpp: 主项目文件。 #include "stdafx.h"
#include #include #include using std::sort; const int N=10003;
typedef struct Stu{ char id[8]; int A,C,M,E; int rank[4];
}Stu;
Stu stu[N];
int n,version; bool cmp(Stu m1,Stu m2){ if(version==0) return m1.A>m2.A; else if(version==1)
阅读全文
摘要:
// 1011. World Cup Betting.cpp: 主项目文件。 #include "stdafx.h"
#include char getKey(int pos){ if(pos==0) return 'W'; else if(pos==1) return 'T'; else return 'L';
} int main()
{ double res=1.0; for(int i=0;imax) max=temp,maxf=j; } printf("%c ",getKey(maxf)); re 阅读全文
摘要:
// 1008. Elevator.cpp: 主项目文件。 #include "stdafx.h"
#include int main()
{ int n; scanf("%d",&n); int sum=sum=5*n,pre=0; for(int i=0;ipre) sum+=6*(temp-pre); else sum+=4*(pre-temp); pre=temp; } printf("%d\n",sum); return 0;
} 阅读全文