zoukankan      html  css  js  c++  java
  • bnuoj 4207 台风(模拟题)

    http://www.bnuoj.com/bnuoj/problem_show.php?pid=4207

    【题意】:中文题,略

    【题解】:模拟

    【code】:

      1 #include <iostream>
      2 #include <stdio.h>
      3 #include <algorithm>
      4 
      5 using namespace std;
      6 
      7 struct Nod
      8 {
      9     int t,sh;
     10 }node[3][10];
     11 
     12 void init()
     13 {
     14     //XsugarX
     15     node[0][0].t = 15;
     16     node[0][0].sh = 650;
     17 
     18     node[0][1].t = 19;
     19     node[0][1].sh = 450;
     20 
     21     node[0][2].t = 46;
     22     node[0][2].sh = 1100;
     23 
     24     //temperlsyer
     25     node[1][0].t = 9;
     26     node[1][0].sh = 200;
     27 
     28     node[1][1].t = 9;
     29     node[1][1].sh = 200;
     30 
     31     node[1][2].t = 10;
     32     node[1][2].sh = 400;
     33 
     34     node[1][3].t = 10;
     35     node[1][3].sh = 500;
     36 
     37     node[1][4].t = 45;
     38     node[1][4].sh = 850;
     39 }
     40 
     41 int main()
     42 {
     43     int t;
     44     init();
     45     scanf("%d",&t);
     46     while(t--)
     47     {
     48         int time,p1,p2;
     49         scanf("%d%d%d",&time,&p1,&p2);
     50         int i,atk[3]={0};
     51         int next0=node[0][0].t,next1=node[1][0].t;
     52         int add0=0,add1=0,cnt0=0,cnt1=0;
     53         for(i=0;i<=time;i++)
     54         {
     55             int flag0=0,flag1=0;
     56             if(next0==i)
     57             {
     58                 p2-=node[0][cnt0].sh;
     59                 cnt0=(cnt0+1)%3;
     60                 flag0=1;
     61 
     62             }
     63             if(next1==i)
     64             {
     65                 p1-=node[1][cnt1].sh;
     66                 cnt1=(cnt1+1)%5;
     67                 flag1=1;
     68             }
     69             if(flag0)
     70             {
     71                 next1+=2;
     72                 next0+=node[0][cnt0].t;
     73             }
     74             if(flag1)
     75             {
     76                 next1+=node[1][cnt1].t;
     77                 next0+=2;
     78             }
     79             if(flag0||flag1)
     80             {
     81 
     82                 if(p1<=0||p2<=0)
     83                 {
     84                     break;
     85                 }
     86             }
     87         }
     88         if((p1<=0&&p2<=0)||(p1==p2))
     89         {
     90             puts("DRAW");
     91         }
     92         else if(p1>p2)
     93         {
     94             printf("XsugarX %d
    ",p1);
     95         }
     96         else if(p1<p2)
     97         {
     98             printf("temperlsyer %d
    ",p2);
     99         }
    100     }
    101     return 0;
    102 }
  • 相关阅读:
    灌水专栏
    工程控制基础相关指标识图与记忆
    材料力学典型习题
    材料力学大学慕课汇总
    机械工程控制基础线性系统时域分析
    ccaa
    在电脑上使用听写,以说话代替打字
    李さんは森さんより若いです
    机械制造工艺基础
    大学慕课材料力学总结
  • 原文地址:https://www.cnblogs.com/crazyapple/p/3362024.html
Copyright © 2011-2022 走看看