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!
64-bit integer IO format: %lld Java class name: Main
None
Graph Theory
2-SAT
Articulation/Bridge/Biconnected Component
Cycles/Topological Sorting/Strongly Connected Component
Shortest Path
Bellman Ford
Dijkstra/Floyd Warshall
Euler Trail/Circuit
Heavy-Light Decomposition
Minimum Spanning Tree
Stable Marriage Problem
Trees
Directed Minimum Spanning Tree
Flow/Matching
Graph Matching
Bipartite Matching
Hopcroft–Karp Bipartite Matching
Weighted Bipartite Matching/Hungarian Algorithm
Flow
Max Flow/Min Cut
Min Cost Max Flow
DFS-like
Backtracking with Pruning/Branch and Bound
Basic Recursion
IDA* Search
Parsing/Grammar
Breadth First Search/Depth First Search
Advanced Search Techniques
Binary Search/Bisection
Ternary Search
Geometry
Basic Geometry
Computational Geometry
Convex Hull
Pick's Theorem
Game Theory
Green Hackenbush/Colon Principle/Fusion Principle
Nim
Sprague-Grundy Number
Matrix
Gaussian Elimination
Matrix Exponentiation
Data Structures
Basic Data Structures
Binary Indexed Tree
Binary Search Tree
Hashing
Orthogonal Range Search
Range Minimum Query/Lowest Common Ancestor
Segment Tree/Interval Tree
Trie Tree
Sorting
Disjoint Set
String
Aho Corasick
Knuth-Morris-Pratt
Suffix Array/Suffix Tree
Math
Basic Math
Big Integer Arithmetic
Number Theory
Chinese Remainder Theorem
Extended Euclid
Inclusion/Exclusion
Modular Arithmetic
Combinatorics
Group Theory/Burnside's lemma
Counting
Probability/Expected Value
Others
Tricky
Hardest
Unusual
Brute Force
Implementation
Constructive Algorithms
Two Pointer
Bitmask
Beginner
Discrete Logarithm/Shank's Baby-step Giant-step Algorithm
Greedy
Divide and Conquer
Dynamic Programming
Tag it!
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
主要是一个地方!(题目红色字)
这个Default class
指的是前面那个除外。。。
下面的User中最小的!!!(这里被人误导了!)
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
int t,n;
char a[];
double b1,b2;
scanf("%d",&t);
while(t--)
{
scanf("%s %d %lf %lf",a,&n,&b1,&b2);
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))
{
printf("Peasant\n");
continue;
}//这个必须先判断!!
if(a[]=='N'&&a[]=='e')//判断是否降级
{
if(n>=&&b1>=3072.00&&b2/b1>=4.45)
{printf("Nexus_Master\n");
continue;}
}
if(a[]=='U'&&a[]=='l')
{
if(n>=&&b1>=1536.00&&b2/b1>=3.95&&b2/b1<=4.05)
{printf("Ultimate_User\n");
continue;}
}
if(a[]=='E'&&a[]=='x')
{
if(n>=&&b1>=1024.00&&b2/b1>=3.45&&b2/b1<=3.55)
{printf("Extreme_User\n");
continue;}
}
if(a[]=='V'&&a[]=='e')
{
if(n>=&&b1>=750.00&&b2/b1>=2.95&&b2/b1<=3.05)
{printf("Veteran_User\n");
continue;}
}
if(a[]=='I'&&a[]=='n')
{
if(n>=&&b1>=500.00&&b2/b1>=2.45&&b2/b1<=2.55)
{printf("Insane_User\n");
continue;}
}
if(a[]=='C'&&a[]=='r')
{
if(n>=&&b1>=300.00&&b2/b1>=1.95&&b2/b1<=2.05)
{printf("Crazy_User\n");
continue;}
}
if(a[]=='E'&&a[]=='l')
{
if(n>=&&b1>=120.00&&b2/b1>=1.45&&b2/b1<=1.55)
{printf("Elite_User\n");
continue;}
}
if(a[]=='P'&&a[]=='o')
{
if(n>=&&b1>=50.00&&b2/b1>=0.95&&b2/b1<=1.05)
{printf("Power_User\n");
continue;}
}
if(n>=&&b1>=3072.00&&b2/b1>=4.55)//排除其他情况后,最后依次判断
printf("Nexus_Master\n");
else if(n>=&&b1>=1536.00&&b2/b1>=4.05)
printf("Ultimate_User\n");
else if(n>=&&b1>=1024.00&&b2/b1>=3.55)
printf("Extreme_User\n");
else if(n>=&&b1>=750.00&&b2/b1>=3.05)
printf("Veteran_User\n");
else if(n>=&&b1>=500.00&&b2/b1>=2.55)
printf("Insane_User\n");
else if(n>=&&b1>=300.00&&b2/b1>=2.05)
printf("Crazy_User\n");
else if(n>=&&b1>=120.00&&b2/b1>=1.55)
printf("Elite_User\n");
else if(n>=&&b1>=50.00&&b2/b1>=1.05)
printf("Power_User\n");
else
printf("User\n");
}
return ;
}
I am Nexus Master!(虽然只是个模拟题。。。但仍想了很久!)的更多相关文章
- POJ 模拟题集合
http://www.cppblog.com/Uriel/articles/101592.html 感觉这个暑假没有去年有激情啊,,,还没到状态就已经块上学了,,, 真是弱暴了,,,找几道模拟题刷刷. ...
- ZOJ3704 I am Nexus Master! 2017-04-06 23:36 56人阅读 评论(0) 收藏
I am Nexus Master! Time Limit: 2 Seconds Memory Limit: 65536 KB NexusHD.org is a popular PT (Pr ...
- URAL 1993 This cheeseburger you don't need 模拟题
This cheeseburger you don't need 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=1993 Descrip ...
- poj 1008:Maya Calendar(模拟题,玛雅日历转换)
Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 64795 Accepted: 19978 D ...
- poj 1888 Crossword Answers 模拟题
Crossword Answers Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 869 Accepted: 405 D ...
- CodeForces - 427B (模拟题)
Prison Transfer Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Sub ...
- sdut 2162:The Android University ACM Team Selection Contest(第二届山东省省赛原题,模拟题)
The Android University ACM Team Selection Contest Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里 ...
- 全国信息学奥林匹克联赛 ( NOIP2014) 复赛 模拟题 Day1 长乐一中
题目名称 正确答案 序列问题 长途旅行 英文名称 answer sequence travel 输入文件名 answer.in sequence.in travel.in 输出文件名 answer. ...
- UVALive 4222 Dance 模拟题
Dance 题目连接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&pag ...
随机推荐
- flash中网页跳转总结
浏览器中,程序同时跳转两个网页地址,第一个地址不会跳转,只会跳转第二个地址,如果第二个地址做延时,则第一个正常跳转,第二个地址会被拦截: 浏览器中,接口返回事件的函数中不能程序跳转网页地址. 这两条结 ...
- SpringAOP详解(转载大神的)
AOP(Aspect-Oriented Programming)这个东西,名字与 OOP 仅差一个字母,其实它是对 OOP 编程方式的一种补充,并非是取而代之.翻译过来就是"面向方面编程&q ...
- [转]java.lang.OutOfMemoryError:GC overhead limit exceeded
我遇到这样的问题,本地部署时抛出异常java.lang.OutOfMemoryError:GC overhead limit exceeded导致服务起不来,查看日志发现加载了太多资源到内存,本地的性 ...
- 深入浅出Node.js(一):什么是Node.js
Node.js从2009年诞生至今,已经发展了两年有余,其成长的速度有目共睹.从在github的访问量超过Rails,到去年底Node.jsS创始人Ryan Dalh加盟Joyent获得企业资助,再到 ...
- win2008 IIS与php整合
首先安装好IIS 安装的时候 要注意三个地方打得勾 注: CGI 会在IIS+PHP的环境中用到 php.ini default_socket_timeout = 60extension_dir ...
- 插入排序 - C语言
插入排序的思想: 以现有的已排序元素为基础,下一个元素添加到正确的位置,则最终会完成排序. 第一个元素本身是已经排序好的.从第二个开始排. void insertSort(int arr[], int ...
- prism4 StockTrader RI 项目分析一些体会
StockTrader RI 代码分析也有一段时间了 刚从codeplex获取到源代码的时候,看得一头雾水,不知所云(因为之前没做过wpf的项目,看文档也静不下那心来看) 后来就想了个笨办法,模拟项目 ...
- Linux下Hadoop2.6.0集群环境的搭建
本文旨在提供最基本的,可以用于在生产环境进行Hadoop.HDFS分布式环境的搭建,对自己是个总结和整理,也能方便新人学习使用. 基础环境 JDK的安装与配置 现在直接到Oracle官网(http:/ ...
- Ajax Step By Step3
第三[.$.getScript()和$.getJSON()] jQuery 提供了一组用于特定异步加载的方法:$.getScript(),用于加载特定的 JS 文件: $.getJSON(),用于专门 ...
- js 常见混乱
slice(begin.end) 复制出一个新的数组或是一个新的字符串,其中end 不包括end本身 splice(begin,howmany,item1....itemn) 更改原先的array 会 ...