zoj 3867 Earthstone: Easy Version(模拟)

#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<vector>
#include<algorithm>
#define LL long long
using namespace std;
const int MAXN=10;
const int INF=0x3f3f3f3f;
const double eps=1e-9;
int a[120];
int main()
{
    int kase,a1,h1,a2,h2;
    int lh1,lh2;
    scanf("%d",&kase);
    while(kase--)
    {
        scanf("%d %d %d %d",&a1,&h1,&a2,&h2);
        if(a1==0)
        {
            printf("Invalid\n");
            continue;
        }
        else
        {
            lh1=h1-a2;
            lh2=h2-a1;
            //printf("lh1%d lh2%d\n",lh1,lh2);
            if(lh1<=0)
            {
                printf("Discard ");
            }
            else
            {
                printf("%d %d ",a1,lh1);
            }
            if(lh2<=0)
            {
                printf("Discard\n");
            }
            else
            {
                printf("%d %d\n",a2,lh2);
            }
        }
    }
    return 0;
}

  

时间: 2024-10-04 12:21:51

zoj 3867 Earthstone: Easy Version(模拟)的相关文章

ZOJ 3867 Earthstone: Easy Version

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3867 题意:跟炉石游戏里的规则也差不多.给你两个小兵 有生命和攻击,问你第一个去攻击第二个的结果. 1 #include <iostream> 2 #include <cstring> 3 #include <string> 4 #include <cstdio> 5 #include <vector> 6 #i

2016 省热身赛 Earthstone: Easy Version

Earthstone: Easy Version Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Description Earthstone is a famous online card game created by Lizard Entertainment. It is a collectible card game that revolves around turn-based mat

ZOJ3867:Earthstone: Easy Version

Earthstone is a famous online card game created by Lizard Entertainment. It is a collectible card game that revolves around turn-based matches between two opponents. Players start the game with a substantial collection of basic cards, but can gain ra

zoj 3791 An Easy Game dp

An Easy Game Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Edward and Flandre play a game. Flandre will show two 01-strings s1 and s2, the lengths of two strings are n. Then, Edward must move exact k steps. In each step, Edward should ch

05-图2. Saving James Bond - Easy Version (25)

05-图2. Saving James Bond - Easy Version (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was capture

ZOJ 3791 An easy game DP+组合数

给定两个01序列,每次操作可以任意改变其中的m个数字 0变 1  1 变 0,正好要变化k次,问有多少种变法 dp模型为dp[i][j],表示进行到第i次变化,A,B序列有j个不同的 变法总和. 循环k次,每次针对m,向那j个不同 分1-j个即可,不过要用到组合数,因为对每个数操作不同都不一样 最后结果就是 dp[k][0] #include <iostream> #include <cstdio> #include <cstring> #include <alg

05-2. Saving James Bond - Easy Version (25)

05-2. Saving James Bond - Easy Version (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured

ZOJ 1111 Poker Hands --复杂模拟

昨天晚上写的,写了一个多小时,9000+B,居然1A了,爽. 题意:玩扑克,比大小.规则如下: 题意很简单,看过赌神的人都知道,每人手中5张排,比牌面大小,牌面由大到小分别是(这里花色无大小),级别从高到低依次为:1.同花顺:牌面一样,只比较最大的看谁大,一样大则平手2.四条:四个一样的,看这四个一样的中谁大谁赢3.葫芦:三条+一对,看三条中谁的牌面大4.同花:都是同花就按从大到小比较,看谁的更大5.顺子:都是顺子看最大的谁大,一样则平手6.三条:三条看三条中谁的牌面大7.两对: 两对就看谁的对

pat05-图2. Saving James Bond - Easy Version (25)

05-图2. Saving James Bond - Easy Version (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was capture