01 2014 档案

摘要:题目:http://codeforces.com/contest/382AKsenia and Pan Scales一个求天平是否能够平衡的题目。。。水题,注意一下结果的输出就行。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 int main() 9 {10 int i,len;11 int L,R,x,sum;12 char a[10000],b[10000];13 while(~scanf("%s",a))14 {... 阅读全文
posted @ 2014-01-18 10:49 水门 阅读(229) 评论(0) 推荐(0)
摘要:题目:http://poj.org/problem?id=3393一道题目挺长的模拟题,参考了网上大神的题解。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int Month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; 8 int Lmonth[13]={0,31,29,31,30,31,30,31,31,30,31,30,31}; 9 10 int check(int year) 11 { 12 if(year1... 阅读全文
posted @ 2014-01-17 23:05 水门 阅读(211) 评论(0) 推荐(0)
摘要:二分查找递归算法 1 #include 2 #include 3 #include 4 using namespace std; 5 #define MAXL 10000 6 7 int a[MAXL],key; 8 int BinarySearch(int low,int high) 9 ... 阅读全文
posted @ 2014-01-17 19:50 水门 阅读(258) 评论(0) 推荐(0)
摘要:插入排序 1 #include 2 #include 3 #include 4 using namespace std; 5 #define MAXL 10000 6 7 void InsertSort(int a[],int n) 8 { 9 int i,j,temp;10 ... 阅读全文
posted @ 2014-01-17 19:47 水门 阅读(320) 评论(0) 推荐(0)
摘要:上几次的一道cf题。题目:http://codeforces.com/contest/376/problem/C性质:(4)a与b的和除以c的余数(a、b两数除以c在没有余数的情况下除外),等于a,b分别除以c的余数之和(或这个和除以c的余数)。例如,23,16除以5的余数分别是3和1,所以(23+16)除以5的余数等于3+1=4。注意:当余数之和大于除数时,所求余数等于余数之和再除以c的余数。例如,23,19除以5的余数分别是3和4,所以(23+19)除以5的余数等于(3+4)除以5的余数。(5)a与b的乘积除以c的余数,等于a,b分别除以c的余数之积(或这个积除以c的余数)。例如,23,1 阅读全文
posted @ 2014-01-04 13:35 水门 阅读(237) 评论(0) 推荐(0)