I am Nexus Master!(虽然只是个模拟题。。。但仍想了很久!)

I am Nexus Master!  The 13th Zhejiang University Programming Contest

参见:http://www.bnuoj.com/bnuoj/problem_show.php?pid=29137

题意就理解错了!!!

之后乱搞就也错了!!!

Current Server Time: 2013-08-30 23:29:55

I am Nexus Master!

2000ms
65536KB
 
This problem will be judged on ZJU. Original ID: 3704
64-bit integer IO format: %lld      Java class name: Main
Font Size:  
Type:  

NexusHD.org is a popular PT (Private Tracker) site in Zhejiang University aiming to provide high quality stuff. In order to encourage users to unload more stuff, the administrators make the following rules to classified users into different classes by the uploaded/downloaded ratio and register time. Users with higher ranks will enjoy more privileges while users in the lowest class(Peasant) would be banned if they couldn't promote from this class for a certain period.

The detail rules are as follows, referring to the FAQ page from NexusHD.org with some modification.

Class Title
 
Description
  Peasant   User would be demoted to this class under any of the following circumstances:
1.Downloaded at least 50 GB and with ratio below 0.4
2.Downloaded at least 100 GB and with ratio below 0.5
3.Downloaded at least 200 GB and with ratio below 0.6
4.Downloaded at least 400 GB and with ratio below 0.7
5.Downloaded at least 800 GB and with ratio below 0.8
  User   Default class.
  Power_User   Been a member for at least 4 weeks, have downloaded at least 50GB and have a ratio at or above 1.05, and will be demoted from this status if ratio drops below 0.95.
  Elite_User   Been a member for at least 8 weeks, have downloaded at least 120GB and have a ratio at or above 1.55, and will be demoted from this status if ratio drops below 1.45.
  Crazy_User   Been a member for at least 15 weeks, have downloaded at least 300GB and have a ratio at or above 2.05, and will be demoted from this status if ratio drops below 1.95.
  Insane_User   Been a member for at least 25 weeks, have downloaded at least 500GB and have a ratio at or above 2.55, and will be demoted from this status if ratio drops below 2.45.
  Veteran_User   Been a member for at least 40 weeks, have downloaded at least 750GB and have a ratio at or above 3.05, and will be demoted from this status if ratio drops below 2.95.
  Extreme_User   Been a member for at least 60 weeks, have downloaded at least 1TB and have a ratio at or above 3.55, and will be demoted from this status if ratio drops below 3.45.
  Ultimate_User   Been a member for at least 80 weeks, have downloaded at least 1.5TB and have a ratio at or above 4.05, and will be demoted from this status if ratio drops below 3.95.
  Nexus_Master   Been a member for at least 100 weeks, have downloaded at least 3TB and have a ratio at or above 4.55, and will be demoted from this status if ratio drops below 4.45.

I am Nexus_Master, the highest class. And you, a young programmer, are asked to implement a small procedure to decide which class the user belongs to according to the above rules. And this procedure will be invoked by main loop from time to time to modify the title of users. Maybe you will be gift a title after finishing this task.

The procedure would take four parameters of a single user as input: current class title, registration time, total downloaded, and total uploaded, and return a string as the new class title of the user.

Input

The first line contains a single integer T (T ≤ 10000), indicating there are T cases in total.

There will be 4 parameters in each of the following T lines, as mentioned in the previous description :

  • Current class title: one of the 10 titles in the detail rules;
  • Register time: an non-negative integer representing the time span from the register moment to now, in unit of weeks;
  • Total downloaded: a non-negative decimal number with 2 decimal digits after the decimal point, in unit of GBs;
  • Total uploaded: a non-negative decimal number with 2 decimal digits after the decimal point, in unit of GBs.
Parameters are separated by a single space. All numerical parameters would not be greater than 106.

Outout

For each case, output the new class title of the user in a single line. Note that the tile should be one of the 10 titles in the above table.

Sample Input

3
Crazy_User 15 800.00 639.99
Veteran_User 45 1000.00 3000.00
Insane_User 45 1000.00 3000.00

Sample Output

Peasant
Veteran_User
Insane_User

Hint

1 TB = 1024 GB.

Source

Author

WANG, Yelei

主要是一个地方!(题目红色字)

这个Default class

指的是前面那个除外。。。

下面的User中最小的!!!(这里被人误导了!)

 1 #include<iostream>
 2 #include<algorithm>
 3 #include<stdio.h>
 4 #include<string.h>
 5 using namespace std;
 6 int main()
 7 {
 8     int t,n;
 9     char a[20];
10     double b1,b2;
11     scanf("%d",&t);
12     while(t--)
13     {
14         scanf("%s %d %lf %lf",a,&n,&b1,&b2);
15         if((b1>=800.00&&b2/b1<0.8)||(b1>=400.00&&b2/b1<0.7)||(b1>=200.00&&b2/b1<0.6)||(b1>=100.00&&b2/b1<0.5)||(b1>=50.00&&b2/b1<0.4))
16         {
17              printf("Peasant
");
18              continue;
19         }//这个必须先判断!!
20         if(a[0]=='N'&&a[1]=='e')//判断是否降级
21         {
22             if(n>=100&&b1>=3072.00&&b2/b1>=4.45)
23                 {printf("Nexus_Master
");
24             continue;}
25         }
26         if(a[0]=='U'&&a[1]=='l')
27         {
28             if(n>=80&&b1>=1536.00&&b2/b1>=3.95&&b2/b1<=4.05)
29                 {printf("Ultimate_User
");
30             continue;}
31         }
32         if(a[0]=='E'&&a[1]=='x')
33         {
34             if(n>=60&&b1>=1024.00&&b2/b1>=3.45&&b2/b1<=3.55)
35                 {printf("Extreme_User
");
36             continue;}
37         }
38         if(a[0]=='V'&&a[1]=='e')
39         {
40             if(n>=40&&b1>=750.00&&b2/b1>=2.95&&b2/b1<=3.05)
41                 {printf("Veteran_User
");
42             continue;}
43         }
44         if(a[0]=='I'&&a[1]=='n')
45         {
46             if(n>=25&&b1>=500.00&&b2/b1>=2.45&&b2/b1<=2.55)
47                 {printf("Insane_User
");
48             continue;}
49         }
50         if(a[0]=='C'&&a[1]=='r')
51         {
52             if(n>=15&&b1>=300.00&&b2/b1>=1.95&&b2/b1<=2.05)
53                 {printf("Crazy_User
");
54             continue;}
55         }
56         if(a[0]=='E'&&a[1]=='l')
57         {
58             if(n>=8&&b1>=120.00&&b2/b1>=1.45&&b2/b1<=1.55)
59                 {printf("Elite_User
");
60             continue;}
61         }
62         if(a[0]=='P'&&a[1]=='o')
63         {
64             if(n>=4&&b1>=50.00&&b2/b1>=0.95&&b2/b1<=1.05)
65                 {printf("Power_User
");
66             continue;}
67         }
68         if(n>=100&&b1>=3072.00&&b2/b1>=4.55)//排除其他情况后,最后依次判断
69             printf("Nexus_Master
");
70         else if(n>=80&&b1>=1536.00&&b2/b1>=4.05)
71             printf("Ultimate_User
");
72         else if(n>=60&&b1>=1024.00&&b2/b1>=3.55)
73             printf("Extreme_User
");
74          else if(n>=40&&b1>=750.00&&b2/b1>=3.05)
75             printf("Veteran_User
");
76         else if(n>=25&&b1>=500.00&&b2/b1>=2.55)
77             printf("Insane_User
");
78         else if(n>=15&&b1>=300.00&&b2/b1>=2.05)
79             printf("Crazy_User
");
80         else if(n>=8&&b1>=120.00&&b2/b1>=1.55)
81             printf("Elite_User
");
82         else if(n>=4&&b1>=50.00&&b2/b1>=1.05)
83             printf("Power_User
");
84         else
85             printf("User
");
86     }
87     return 0;
88 }
原文地址:https://www.cnblogs.com/tt123/p/3292670.html