HDU-5238 Calculator】的更多相关文章

Calculator Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 521    Accepted Submission(s): 170 Problem Description Sakura has invented a new kind of calculator that can evaluate expressions. T…
题意: 给一个计算器,有一系列计算步骤,只有加,乘,幂三种运算. 有一种查询操作:查询初始值为\(x\)的时候,最终运算结果模\(29393\)的值. 有一种修改操作:可以修改第\(p\)个运算的运算符和运算数. 分析: 分解一下,\(29393=7 \times 13 \times 17 \times 19\). 所以我们可以维护\(4\)棵线段树,区间维护的信息就是初始值为\(x\)经过这段区间最终得到的值. 然后就用中国剩余定理整合一下. #include <cstdio> #inclu…
2192: hzk又在打人 Time Limit: 12 Sec Memory Limit: 512 MB Submit: 52 Solved: 1 [Submit][Status][Web Board] Description hzk又要打人了,他让我们做一个cpu能够计算一些简单的指令,首先他有n条指令,指令形如"c x",其中c ={+,^,*},x是一个非负整数. + a , * a , ^ a分别代表加,乘,乘方.假设我们现在有+ 2 , * 3, ^ 2 三个指令那么对于输…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5475 Problem 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, X = 1. This calculator only supports two types…
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,…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1335 Problem Description The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company t…
http://acm.hdu.edu.cn/showproblem.php?pid=1221 114 92 31 95 13 96 3 这题只需要判断圆和矩形是否相交,然后在里面是不算相交的. 那么就有好几种情况了. 1.整个矩形在圆形里,NO,(我的做法是所有点到圆心距离小于半径) 2.整个圆在矩形里,NO,一个圆选出5个点,圆心,和最上下左右,如果这些点都在,则不行.我的做法直接PointInPolygon. 3.否则,只要有公共点,就直接YES.然后,如果圆那5个点有一个在矩形,或者矩形的…
Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7194    Accepted Submission(s): 3345 Problem Description 话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了.显然,作为多年拼搏的商人,XHD不会坐以待毙的.  一天,当他正在苦思冥想解困良策的…
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should truncate toward zero. You may assume that the given ex…