codeforces #294(Div 2) A、B、C

题目A: A and B and chess

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define LL long long 
using namespace std;
int main()
{
	char ch;
	int w = 0, b = 0;
	for(int i=1;i<=8;i++)
	{
		for(int j=1;j<=8;j++)
		{
			cin>>ch;
			if(ch == 'Q') w += 9;
			else if(ch == 'R') w += 5;
			else if(ch == 'B') w += 3;
			else if(ch == 'N') w += 3;
			else if(ch == 'P') w += 1;
			else if(ch =='q') b += 9;
			else if(ch == 'r') b += 5;
			else if(ch == 'b') b += 3;
			else if(ch == 'n') b += 3;
			else if(ch == 'p') b += 1;
		}
	}
	if(w > b) cout<<"White"<
题目B : A and B and Compilation errors

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define LL long long 
using namespace std;
const int MAXN = 100000 + 10;
mapmm1,mm2,mm3;
int N;
int A[MAXN];
int main()
{
	scanf("%d", &N);
	for(int i=1;i<=N;i++) 
	{
		scanf("%d", &A[i]);
		mm1[A[i]]++;
	}
	int x;
	for(int i=1;i<=N-1;i++)
	{
		scanf("%d", &x);
		mm2[x]++;
	}
	for(int i=1;i<=N-2;i++)
	{
		scanf("%d", &x);
		mm3[x]++;
	}
	for(int i=1;i<=N;i++) if(mm1[A[i]] != mm2[A[i]])
	{
		printf("%d\n", A[i]);
		break;
	}
	for(int i=1;i<=N;i++) if(mm2[A[i]] != mm3[A[i]])
	{
		printf("%d\n", A[i]);
		break;
	}
	return 0;
}
题目C A and B and Team Trainning

#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
int main()
{
	int n , m;
	cin>>n>>m;
	cout<


你可能感兴趣的:(Codeforces)