天天看點

CSU 1639 隊長,我想進集訓隊!

Description

“隊長,我想進集訓隊!”這是小A内心的願望,然而進集訓隊是有一定要求的,小A現在隻知道自己的情況,請你幫他/她判斷一下是否可以進入集訓隊。

已知進入集訓隊的條件如下:

以下所有成績累加,男生達到 90 分,女生達到 60 分。

(1) COJ

入門題 1分/題
基礎題 2分/題
進階題 5分/題

(2)2015年度中南大學第九屆大學生程式設計競賽

一等獎 20分
二等獎 10分
三等獎 5分

(3)選拔賽(共兩場,取加分較高者)

名次前15%,四舍五入 20分
名次前30%,四舍五入 10分
名次前45%,四舍五入 5分

請你根據小A的條件,判斷能不能小A能不能如願進入集訓隊。

Input

       多組資料,第一行有一個整數

T

,表示有

T

組資料。(

T<=100

以下每組資料第一行有

一個字母s,s為“m”表示小A為男性,s為“f”則為女性。

第二行有五

個整數

X1,X2,X3,

N和M

。X1、X2、X3依次分别

表示

小A完成的

入門題

基礎題

進階題

的數量,

N和M表示小A在兩場比賽中獲得的加分

(

<=

X1、X2、X3

<=

3

,0

<=

N、M

<=

2

0)

每組資料單獨一行。如果小A能進入集訓隊,輸出“Welcome”,如果不能,輸出小A離達到标準還需要的分數。

2
m
10 10 9 5 5
f
15 10 3 5 5      
5
Welcome      
水題      
#include<cstdio>
#include<cstring>
#include<iostream>
#include<queue>
#include<vector>
#include<map>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn = 100005;
int T, n, m, x1, x2, x3, tot;
char s[10];

int main()
{
	while (cin >> T)
	{
		while (T--)
		{
			scanf("%s%d%d%d%d%d", s, &x1, &x2, &x3, &n, &m);
			tot = x1 + 2 * x2 + 5 * x3 + n + m;
			if (s[0] == 'm')
			{
				if (tot >= 90) printf("Welcome\n");
				else printf("%d\n", 90 - tot);
			}
			else
			{
				if (tot >= 60) printf("Welcome\n");
				else printf("%d\n", 60 - tot);
			}
		}
	}
	return 0;
}