Description   Your new company is building a robot that can hold small lightweight objects. The robot will have the intelligence to determine if an object is light enough to hold. It does this by taking pictures of the object from the 6 cardinal dire…
Description Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy that she will fall asleep if no customer comes to buy b…
Description   Programming contests became so popular in the year 2397 that the governor of New Earck -- the largest human-inhabited planet of the galaxy -- opened a special Alley of Contestant Memories (ACM) at the local graveyard. The ACM encircles…
Description Let S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways: q By an integer sequence P = p1 p2...pn where pi is the number of left parentheses before the ith right parenthesis in S (P-sequence). q B…
"One thing is for certain: there is no stopping them;the ants will soon be here. And I, for one, welcome ournew insect overlords." Kent Brockman Piotr likes playing with ants. He has n of them on a horizontal pole L cm long. Each ant is facing e…
Description Have you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In this game, you and your friend play in turn. You need to pick a word and draw a picture for this word. Then your f…
Very often, especially in programming contests, we treat a sequence of non-whitespace characters as a string. But sometimes, a string may contain whitespace characters or even be empty. We can have such strings quoted and escaped to handle these case…
Description   话说孙悟饭与小林正在与刚造访地球的赛亚人贝吉塔交战,因为连贝吉塔的手下纳巴的实力也远在他俩之上,由于差距悬殊,小林不得不设脱离战场,去寻找正在修炼中的悟空求救,而赛亚人一伙岂能让他们轻易逃脱,于是贝吉塔让纳巴去追小林而着手对付孙悟饭.    假设小林的速度是vp 每秒,纳巴速度 vd每秒,他俩与贝吉塔当时处在同一地点(无视孙悟饭),当纳巴觉察到小林逃跑这一举动需要t秒反应时间,小林会在此间全速离开,虽然看起来小林毫无胜算,但是他有一招叫做太阳拳的绝招,一旦纳巴超越自己…
Description ycc 喜欢古典音乐是一个 ZJUTACM 集训队中大家都知道的事情.为了更方便地聆听音乐,最近 ycc 特意把他的家搬到了爱乐大街(德语Philharmoniker-Straße).在爱乐大街上,依次坐落着N座跟音乐有关的建筑,比如音乐厅.歌剧院等建筑.走在爱乐大街的路上,ycc 感到非常满意.过了一会儿,ycc 开始对这些建筑的门牌号产生了兴趣,这 N 个建筑各自有唯一的门牌号,范围从 1 到 N .不过大概住在爱乐大街上的人都比较文艺,不喜欢循规蹈矩,他发现爱乐大街…
Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D implies that A < B, B < C and C < D.…
Description Willy the spider used to live in the chemistry laboratory of Dr. Petro. He used to wander about the lab pipes and sometimes inside empty ones. One night while he was in a pipe, he fell asleep. The next morning, Dr. Petro came to the lab.…
  Updating a Dictionary  In this problem, a dictionary is collection of key-value pairs, where keys are lower-case letters, and values are non-negative integers. Given an old dictionary and a new dictionary, find out what were changed. Each dictionar…
  Robot Instructions  You have a robot standing on the origin of x axis. The robot will be given some instructions. Your task is to predict its position after executing all the instructions. LEFT: move one unit left (decrease p by 1, where p is the p…
Problem Description The three hands of the clock are rotating every second and meeting each other many times everyday. Finally, they get bored of this and each of them would like to stay away from the other two. A hand is happy if it is at least D de…
题目链接:https://vjudge.net/problem/UVALive-2995 这道题的主要难点在于三维坐标系的建立,然后在坐标系中进行迭代更新. 注意用宏定义来简化代码. AC代码: #include<cstdio> #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #define rep(i,n) for(int i=0;i<n;i…
有一个 n * n * n 的立方体,其中一些单位立方体已经缺失(剩下部分不一定连通).每个单位立方体重 1 克,且被涂上单一的颜色(即 6 个面的一颜色相同).给出前.左.后.右.顶.底 6 个视图,你的任务是判断这个屋里剩下的最大的重量. 看完这题之后,我满头雾水,不知道从何下手.后来模拟了一下数据,才知道怎么解决. 首先,一个单位立方体只有一种颜色,如果从不同的视图看到这个立方体的颜色不同,那么就删除这个立方体.通过这样循环删除,到最后所有的小立方体都符合题目所要求,就是最大的立方体数目,…
题目链接:http://codeforces.com/contest/677/problem/B 题意:n个土豆,每个土豆高ai.现在有个加工机,最高能放h,每次能加工k.问需要多少次才能把土豆全加工完. 模拟就行了,加工次数用相除的结果,一个一个来会TLE /* ━━━━━┒ギリギリ♂ eye! ┓┏┓┏┓┃キリキリ♂ mind! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┃┃┃┃┃…
Climbing Worm Time Limit: 2 Seconds      Memory Limit:65536 KB An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest, it slips…
http://codeforces.com/problemset/problem/586/C 题意:1~n个孩子排成一排看病.有这么一个模型:孩子听到前面的哭声自信心就会减弱:第i个孩子看病时会发出v[i]的叫声,他后面的那个人的自信心(不是p[i+1])会减少v[i],再后面一个会减少v[i]-1,如此下去直到声音减弱为0.若某个人的自信心小于0,则他哭着跑回家,他身后的所有人会减掉d[i] 的自信. 题解:直接模拟很困难,有一个想法是将逃跑的孩子的声音和将他吓跑的(正在接诊的)声音叠加成s,…
题目大意: 给定a,n(\(a \le 1e9, n\le30\)),求有多少\(b(1 \le b \le 2^n)\)满足:\(a^b \equiv b^a(mod 2^n)\). 题目分析: 数学被吊打. 打表发现a为奇数时,b只有1种. a为偶数时,b一定为偶数. 对于\(b < n\)的部分,直接暴力快速幂(不要脑抽加快速乘). 对于\(b \ge n\)的部分,\(a^b \equiv 0 (mod 2^n)\),\(b^a \equiv 0 (mod 2^n)\),设\(b=2^x…
题目原文: 豆豆还是觉得自己智商太低了,就又去做数学题了.一看到题,他就觉得自己可能真的一点智商都没有.便哭着跑来像 dalao 求教:如果存在正整数 A,B ,满足 A3 - B3 = x ,则称质数 x 为立方数.现在给你一个质数 x ,请判断是不是立方数,如果是请输出 "YES" ,否则输出 "NO" . [数据范围] 对于 40% 的数据,如果有解 A 在 10000 以内: 对于 100% 的数据,T≤1000:1≤x≤1012. [思考] 如果是以下数据…
1006: 1.2.2 Transformations 方块转换 时间限制: 1 Sec  内存限制: 128 MB提交: 10  解决: 7[提交] [状态] [讨论版] [命题人:外部导入] 题目描述 1.2.2 Transformations 方块转换 (transform.pas/c/cpp) 一块N x N(1<=N<=10)正方形的黑白瓦片的图案要被转换成新的正方形图案.写一个程序来找出将原始图案按照以下列转换方法转换成新图案的最小方式: 1:转90度:图案按顺时针转90度. 2:…
Description We are given a figure consisting of only horizontal and vertical line segments. Our goal is to count the number of all different rectangles formed by these segments. As an example, the number of rectangles in the Figures 1 and 2 are 5 and…
题目链接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=996 题意: 有一个n∗n∗n个不同颜色的单位正方体(每个单位正方体六个面颜色相同)组成的大正方体,现在其中一些单位正方体已经缺失,给定该大正方体的六视图,求这个物体剩下的最大正方体个数. 分析: 首先我们假设这个大正方体是满的,然后根据六视图找到对应的立方体块的颜…
数论基础 专题测试  命题人:清华大学 王赢绪 /* 水题 答案为C(n-k,m-1) 预处理阶乘和逆元,O(1)算答案 开始读错题了!!!朱一乐!!! */ #include<iostream> #include<cstdio> #include<cstring> #define N 1000003 #define mod 1000000007 #define ll long long using namespace std; ll fac[N]={,},inv[N]…
111-分数加减法 内存限制:64MB 时间限制:1000ms 特判: No 通过数:20 提交数:54 难度:2 题目描述: 编写一个C程序,实现两个分数的加减法 输入描述: 输入包含多行数据 每行数据是一个字符串,格式是"a/boc/d". 其中a, b, c, d是一个0-9的整数.o是运算符"+"或者"-". 数据以EOF结束 输入数据保证合法 输出描述: 对于输入数据的每一行输出两个分数的运算结果. 注意结果应符合书写习惯,没有多余的符…
下载地址:https://www.jianguoyun.com/p/DZPN6ocQ2siRBhihnx8 弹道计算是游戏里常见的问题,其中关于击中移动目标的自动计算提前量的话题,看似简单,其实还是挺复杂的数学.网上这方面的资料还真不多,而且都是写的含含糊糊.抽空总结一下自己的方法. 讨论的前提是,假设目标是在3D空间里以匀速直线方式运动. 1.直线弹道在不考虑重力和空气阻力影响的情况下,子弹的弹道呈直线运动.这种情况下,其实是个纯平面几何空间的问题,不需要微积分和线代知识.分析的情况如下图: …
1.老老实实把课本上的题目做完.其实说科大的课本难,我以为这话不完整.科大的教材,就数学系而言还是讲得挺清楚的,难的是后面的习题.事实上做1道难题的收获是做10道简单题所不能比的. 2.每门数学必修课至少要看一本参考书,尽量做一本习题集. 3.数学分析别做吉米,除非你太无聊,推荐北大方企勤的习题集.此外注意一下有套波兰的数学分析习题集,是不是搞得到中文或英文版. 4.线性代数推荐普罗斯库列科夫的<<线性代数习题集>>和法捷耶夫的<<高等代数习题集>>.莫斯科…
萨德系统是麻省理工学院的林肯实验室牵头开发的.林肯实验室可以说是美军方手中的一张王牌.二个反导系统(末段高空区域导弹防御(THAAD)系统,和 国家导弹防御系统(NMD))均由实验室牵头.它既是技术支撑方,同时又是关键技术的研制方,例如THAAD地基雷达(GBR),实验室负责任务书的拟定,并负责雷达的验收,而其中的目标识别算法等又是实验室提供并负责试验数据的录取和分析. 对于在韩国部署萨德的意义和目的,著名导弹专家.美国麻省理工学院终身教授泊斯托尔曾一针见血地指出:萨德对于防范朝鲜的劳动导弹并不…
如果要得到pose视图,除非有精密的测量方法,否则进行大量的样本采集时很耗时耗力的.可以采取一些取巧的方法,正如A Survey on Partial of 3d shapes,描述的,可以利用已得到的3D模型,利用投影的方法 (page10-透视投影或者正射投影),自动得到精确的3D单向视图. 其中的遇到了好几个难题:透视投影的视角问题:单侧面的曲面补全问题(曲面插值问题):pose特征的描述性问题. 一篇文章看完视觉及相关通略. 先普及一下基础知识: 一:图像处理.计算机图形学.计算机视觉和…