HDOJ 5475 An easy problem】的更多相关文章

题目传送门 题意:一个计算器,两种操作,乘上x,或者除掉之前的某个x,结果取模输出 分析:因为取模不支持除法,然后比赛时想到用逆元,结果发现MOD需要与b互质,结果一直苦苦寻找求逆元的其它方法.后来队友用暴力方法竟然水过,具体操作是记录每次乘的x,如果除的话,将对应的x 改为1,然后一个一个乘.当然正解应该用线段树,树的底部每个点表示每一次操作的x,pushup的是区间的乘积,如果是除把对应的x变为1,发现其实就是暴力的优化.... /******************************…
http://acm.hdu.edu.cn/showproblem.php?pid=5475 An easy problem Time Limit: 8000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 755 Accepted Submission(s): 431 Problem Description One day, a useless calculator was…
An easy problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5475 Description One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first,…
Problem Description we define f(A) = 1, f(a) = -1, f(B) = 2, f(b) = -2, - f(Z) = 26, f(z) = -26; Give you a letter x and a number y , you should output the result of y+f(x). Input On the first line, contains a number T.then T lines follow, each line…
题意就不说了 思路:线段树,维护区间乘积.2操作就将要除的点更新为1. #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<queue> #include<vector> #include<set> #include<string> #define inf…
http://acm.hdu.edu.cn/showproblem.php?pid=5475 An easy problem Time Limit: 8000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1146    Accepted Submission(s): 560 Problem Description One day, a useless calculat…
Problem Description We once did a lot of recursional problem . I think some of them is easy for you and some if hard for you. Now there is a very easy problem . I think you can AC it. We can define sum(n) as follow: if i can be divided exactly by 3 s…
An easy problem Time Limit: 8000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 467    Accepted Submission(s): 258 Problem Description One day, a useless calculator was being built by Kuros. Let's assume that…
Problem E Easy Problem from Rujia Liu? Though Rujia Liu usually sets hard problems for contests (for example, regional contests like Xi'an 2006, Beijing 2007 and Wuhan 2009, or UVa OJ contests like Rujia Liu's Presents 1 and 2), he occasionally sets…
An easy problem Time Limit:3000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description When Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1 cup of water plus 1 pile of d…