摘要:
地址:http://codeforces.com/contest/263/problem/B给出n个正方形的顶点(与(0,0)在同一对角线上),要求找到一个点包含在k个正方形内n<k则无法找到n>=k时,读入数据后排序输出从右数第k个顶点的坐标即可 1 #include <iostream> 2 #include <algorithm> 3 using namespace std; 4 5 int n,k,a[55]; 6 7 bool cmp(int a,int b) 8 {return a<b;} 9 10 int main()11 {12 int 阅读全文
posted @ 2013-01-23 18:15
tjsuhst
阅读(197)
评论(0)
推荐(0)
摘要:
地址:http://hustoj.sinaapp.com/problem.php?id=1826快排(用了两次,一次升序,一次降序,其实都用降序就行了)将牛棚间间隔最大的那几个减去即可,注意所需木板的最小总长应该是有牛的牛棚的个数,就这一点让我错了好多次 1 #include <iostream> 2 #include <algorithm> 3 using namespace std; 4 5 int m,s,c,st[200]; 6 7 bool cmp1(int a,int b) 8 { 9 return a>b;10 }11 12 bool cmp2(in 阅读全文
posted @ 2013-01-23 15:49
tjsuhst
阅读(210)
评论(0)
推荐(0)
摘要:
地址:http://codeforces.com/contest/266/problem/C这题比赛时没做出来这还是看了dys的题解才写出来...... 1 #include<stdio.h> 2 3 int n,m[1000][2],result[10000][3]; 4 5 int main() 6 { 7 int i,j,count=0; 8 scanf("%d",&n); 9 for(i=0;i<n-1;i++)10 {11 scanf("%d %d",&m[i][0],&m[i][1]);12 }13 阅读全文
posted @ 2013-01-23 15:24
tjsuhst
阅读(214)
评论(0)
推荐(0)
摘要:
地址:http://codeforces.com/contest/266/problem/B时间一秒一秒的减,没有人换位或是时间到就停止#include<stdio.h>int n,t;char in[55];int main(){ int i,flag=0; scanf("%d %d",&n,&t); scanf("%s",in); while(t>0) { flag=0; for(i=0;i<n-1;) { if(in[i]=='B' && in[i+1]=='G' 阅读全文
posted @ 2013-01-23 15:22
tjsuhst
阅读(167)
评论(0)
推荐(0)
摘要:
地址:http://codeforces.com/contest/266/problem/A可以看作是记录连续重复序列的长度和 1 #include<stdio.h> 2 3 int n; 4 char in[55]; 5 6 int main() 7 { 8 int i,count=0; 9 scanf("%d",&n);10 scanf("%s",in);11 for(i=0;i<n-1;i++)12 {13 if(in[i]==in[i+1])14 {15 count++;16 ... 阅读全文
posted @ 2013-01-23 15:17
tjsuhst
阅读(148)
评论(0)
推荐(0)

浙公网安备 33010602011771号