摘要:
地址:http://codeforces.com/contest/237/problem/A想服务所有顾客,要多少cash,同时来的肯定不能在同一台cash上这题我错了好多次才AC...... 1 #include<stdio.h> 2 3 int a,b,c,d,n; 4 5 int main() 6 { 7 int i,count=1,ans=0; 8 scanf("%d",&n); 9 for(i=0;i<n;i++)10 {11 scanf("%d %d",&c,&d);12 if(i==0)13 {1. 阅读全文
posted @ 2013-01-21 01:38
tjsuhst
阅读(159)
评论(0)
推荐(0)
摘要:
地址:http://codeforces.com/contest/236/problem/A要求统计一串字符中出现了多少个字母 1 #include<stdio.h> 2 3 int a[26]; 4 5 int main() 6 { 7 int count=0; 8 char in; 9 in=getchar();10 while(in-'a'>=0 && in-'a'<26)11 {12 if(0==a[in-'a'])13 {14 count++;15 a[in-'... 阅读全文
posted @ 2013-01-21 01:20
tjsuhst
阅读(132)
评论(0)
推荐(0)
摘要:
地址:http://www.rqnoj.cn/Problem_53.html其实每种状态只与两个因素有关:栈里元素的个数,未入栈的元素个数 1 #include<stdio.h> 2 3 int n,a[20][20]; 4 5 int search(int keng,int right) 6 { 7 if(a[keng][right]!=0) return a[keng][right]; 8 if(right==0 && keng!=0) return 1; 9 else if(right!=0 && keng==0) return a[keng] 阅读全文
posted @ 2013-01-21 00:45
tjsuhst
阅读(181)
评论(0)
推荐(0)

浙公网安备 33010602011771号