B . Medal Ranking -UCF Local Programming Contest 2015

https://nanti.jisuanke.com/t/43387

题意

  奥运会,分别给出RU和US两国的 金牌 银牌 铜牌 数目

    优先度 金牌>银牌>铜牌,其中一种相同则比较下一种,多的一方在color上获胜

    总的奖牌数多的一方在count上获胜

  判断US能在哪种方式上获胜

  水题

代码

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<deque>
#include<iomanip>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include <vector>
#include <iterator>
#include <utility>
#include <sstream>
#include <limits>
#include <numeric>
#include <functional>
using namespace std;
#define gc getchar()
#define mem(a) memset(a,0,sizeof(a))
//#define sort(a,n,int) sort(a,a+n,less<int>())

#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef char ch;
typedef double db;

const double PI=acos(-1.0);
const double eps=1e-6;
const ll mod=1e9+7;
const int inf=0x3f3f3f3f;
const int maxn=1e5+10;
const int maxm=100+10;


bool compare(int a, int b)
{
	return a < b;//升序
}


int a[6] = {0};
int main(){
	int n = 0;
	cin >> n;
	bool num = 0;
	bool color = 0;
	while(n--)
	{
		num = 0;
		color = 0;
		for(int i = 0;i<6;i++)
		{
			cin >>a[i];
		}
		for(int i = 0;i<6;i++)
		{
			cout <<a[i];
			if(i<5)cout<<" ";
		}
		if((a[0]+a[1]+a[2])>(a[3]+a[4]+a[5]))
		{
			num = 1;
		}
		if(a[0]>a[3])
		{
			color = 1;
		}
		else if(a[0]==a[3] && a[1]>a[4])
		{
			color = 1;
		}
		else if(a[0]==a[3] && a[1]==a[4] && a[2]>a[5])
		{
			color = 1;
		}
		cout<<endl;
		if(num)
		{
			if(color)
				cout<<"both"<<endl;
			else
				cout<<"count"<<endl;
		}
		else
		{
			if(color)
				cout<<"color"<<endl;
			else
				cout<<"none"<<endl;
		}
		cout<<endl;
	}
	
    return 0;
}

  

猜你喜欢

转载自www.cnblogs.com/SutsuharaYuki/p/12443392.html