自己的usaco代码---PROB Calf Flac

原创代码

仅供参考

欢迎评论O(∩_∩)O~

//多行字符串读入 
/*
ID: 输你自己的
PROG: calfflac
LANG: C++
*/
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
char aa[300000];
char aaa[300][82];
struct ss{char a;int b;};
ss s[22000];
int k=0;
int find(int qq){
	int tmp=1;
	int l,r;
	l=qq-1;r=qq+1;
	while((s[l].a==s[r].a||s[l].a+32==s[r].a||s[l].a-32==s[r].a)&&(l>=1&&r<=k))
	{
		l--;
		r++;
		tmp+=2;
	}
	return tmp;
}

int find2(int qq){
	int tmp=0;
	int l,r;
	l=qq-1;r=qq;
	while((s[l].a==s[r].a||s[l].a+32==s[r].a||s[l].a==s[r].a+32)&&(l>=1&&r<=k))
	{
		l--;
		r++;
		tmp+=2;
	}
	return tmp;
}
int main()
{
	freopen("calfflac.in","r",stdin);
	freopen("calfflac.out","w",stdout);
	
	int re=-1;
	while(gets(aaa[++k]));
	for(int i=1;i<=k;i++){
	  for(int j=0;j

ps:这道题有很多坑---

1)有多行输入,特别是第五个,是一份代码

2)卡二维暴搜

自己也遇到一个问题

子程序中判断不够,导致s[0].a的比较出现,卡第八个数据

你可能感兴趣的:(usaco)