XTU—1190 Game of Wuxing

纯模拟

http://202.197.224.59/OnlineJudge2/index.php/Problem/read/id/1190

#include<cstdio>
int main()
{
    //freopen("in.txt","r",stdin);
    int k,i,a,b,sum1,sum2;
    char x,y;
    scanf("%d",&k);
    getchar();
    while(k--)
    {
        sum1=sum2=0;
        for(i=1;i<=5;i++)
        {
            scanf("%c%d",&x,&a);
             //printf("%c%d",x,a);
            getchar();
            scanf("%c%d",&y,&b);
            //printf("%c%d",y,b);
            if(x==y)
            {
                sum1+=a;
                sum2+=b;
            }
            else if((x=='J'&&y=='T')||(x=='S'&&y=='J')||(x=='M'&&y=='S')||(x=='H'&&y=='M')||(x=='T'&&y=='H'))
                sum1+=a+b;
            else if((x=='T'&&y=='J')||(x=='J'&&y=='S')||(x=='S'&&y=='M')||(x=='M'&&y=='H')||(x=='H'&&y=='T'))
                sum2+=a+b;
            else if((x=='J'&&y=='M')||(x=='S'&&y=='H')||(x=='M'&&y=='T')||(x=='H'&&y=='J')||(x=='T'&&y=='S'))
            {
            if(a>b) sum1+=a-b;
            else sum1+=b-a;
            }
             else if((x=='M'&&y=='J')||(x=='H'&&y=='S')||(x=='T'&&y=='M')||(x=='J'&&y=='H')||(x=='S'&&y=='T'))
            {
            if(a>b) sum2+=a-b;
            else sum2+=b-a;
            }
            getchar();
        }
        if(sum1>sum2) printf("Jia\n");
        else if(sum1<sum2) printf("Yi\n");
        else printf("Ping\n");
        }
    return 0;
}
时间: 2024-10-21 15:00:35

XTU—1190 Game of Wuxing的相关文章

hihocoder #1190 : 连通性&#183;四 点双联通分量

http://hihocoder.com/problemset/problem/1190?sid=1051696 先抄袭一下 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho从约翰家回到学校时,网络所的老师又找到了小Hi和小Ho. 老师告诉小Hi和小Ho:之前的分组出了点问题,当服务器(上次是连接)发生宕机的时候,在同一组的服务器有可能连接不上,所以他们希望重新进行一次分组.这一次老师希望对连接进行分组,并把一个组内的所有连接关联的服务器也视为这个组内

xtu summer individual 6 B - Number Busters

Number Busters Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 382B64-bit integer IO format: %I64d      Java class name: (Any) Arthur and Alexander are number busters. Today they've got a competition.

xtu DP Training C.炮兵阵地

炮兵阵地 Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on PKU. Original ID: 118564-bit integer IO format: %lld      Java class name: Main 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队.一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表

xtu summer individual 1 E - Palindromic Numbers

E - Palindromic Numbers Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Description A palindromic number or numeral palindrome is a 'symmetrical' number like 16461 that remains the same when its digits are reversed. In this

xtu summer individual 6 D - Checkposts

Checkposts Time Limit: 2000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 427C64-bit integer IO format: %I64d      Java class name: (Any) Your city has n junctions. There are m one-way roads between the junctions. A

xtu summer individual 5 D - Subsequence

Subsequence Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 353064-bit integer IO format: %I64d      Java class name: Main There is a sequence of integers. Your task is to find the longest subsequence that sa

xtu summer individual 1 A - An interesting mobile game

An interesting mobile game Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 329564-bit integer IO format: %I64d      Java class name: Main XQ,one of the three Sailormoon girls,is usually playing mobile games o

xtu summer individual 2 C - Hometask

Hometask Time Limit: 2000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 154A64-bit integer IO format: %I64d      Java class name: (Any) Sergey attends lessons of the N-ish language. Each lesson he receives a hometas

XTU 二分图和网络流 练习题 C. 方格取数(1)

C. 方格取数(1) Time Limit: 5000ms Memory Limit: 32768KB 64-bit integer IO format: %I64d      Java class name: Main 给你一个n*n的格子的棋盘,每个格子里面有一个非负数.从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大. Input 包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20) Output 对