[欢乐水池]

发布于 2017-10-17  28 次阅读


T1 王♂之困惑

#include<cstdio>
#include<cstring>
using namespace std;
char s[1100];
int s1,s2;
int cout()
{
	int len=strlen(s),cnt=0;
	for(int i=0;i<=len;i++)
	{
		if(s[i]=='1') cnt++;
	}
	return cnt;
}
int main()
{
	freopen("input.txt","r",stdin);
	freopen("output.out","w",stdout);
	int t;
	scanf(
	while(t--)
	{
		scanf(
		s1=cout();
		scanf(
		s2=cout();
		if(s1&1)
		{
			if(s1+1>=s2) printf("YES\n");
			else printf("NO\n");
		}
		else
		{
			if(s1>=s2) printf("YES");
			else printf("NO");
		}
	}
	return 0;
}

T2 我的魔法栈

#include <iostream>
#include <cstdio>
using namespace std;
const int maxn=10008;
char in[maxn];
int s[108],cnt=0;
int n,ans=0;
int pow(int a,int b)
{
	if(a==0) return 0;
	int ans=1;
	while(b)
	{
		if(b&1) ans*=a;
		b>>=1;
		a*=a;
	}
	return ans;
}
void in_stack(int n)
{
	cnt=0;
	for(int i=0;i<n;i++)
	{
		if(in[i]=='W')
		{
			cnt++;
			s[cnt]=i+1;
		}
	}
}
int main()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	int t;
	scanf(
	while(t--)
	{
		ans=0;
		scanf(
		in_stack(n);
		for(int i=1;i<=cnt;i++)
		{
			ans+=pow(2,s[i])-1;
		}
		printf(
	}
	return 0;
}

T3 The King♂ and King♂ boss

这题我就算做不来,骗分都能A
Vingying:你不知道鸽巢原理吗233

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	int t;
	scanf(
	while(t--) printf("Yes\n");
    return 0;
}