哈利波特 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描写叙述 Harry 新学了三种魔法.他能够用第一种魔法把 a 克的沙子变成 b 克金属,能够用另外一种魔法把 c 克金属变成 d 克金子,能够用第三种魔法把 e 克金子变成 f 克沙子.Harry 的两个好朋友Ron和Hermione知道了很高兴,可是Ron和Hermione有个分歧,Ron认为Harry能够用这三种魔法获得无限的金子,Hermione认为不能获得无限多的.Harry想知道究竟谁是对的 输入 输入…
D. Ability To Convert time limit per test 1 second Cmemory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English le…
第一次做交互真有趣……:挺好的细节思维题 This is an interactive problem. In good old times dwarves tried to develop extrasensory abilities: Exactly n dwarves entered completely dark cave. Each dwarf received a hat — white or black. While in cave, none of the dwarves was…
Problem 1609 - Han Move Time Limit: 1000MS Memory Limit: 65536KB Total Submit: 620 Accepted: 162 Special Judge: No Description Cyy and Fzz are Han Move lovers. One day, they gather together to run. They choose a circular track whose length is…
http://poj.org/problem?id=2826 An Easy Problem?! Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10505 Accepted: 1584 Description It's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two woode…
像这样细节老是打挂不行啊…… A plane is flying at a constant height of hh meters above the ground surface. Let's consider that it is flying from the point (−109,h)(−109,h) to the point (109,h)(109,h) parallel with OxOx axis. A glider is inside the plane, ready to…
Game 问题描述 XY在玩一个游戏:有N根柱子排成一排,编号为1到N,每个柱子上面有一块宝石,现在XY站在第S根柱子上,出口在第T跟柱子上,XY需要拿到所有宝石后从出口离开.每次XY可以走到相邻的柱子上,也可以使用超能力跳到第一根柱子或者第N根柱子上,如果离开了柱子之后再也不能到达这里.为了节省能量,XY想用最少次数超能力通关. 输入描述 输入有多组数据,不超过1000组. 每组数据输入一行包含3个整数,N,S和T.(1\leq N\leq10000,1\leq S,T\leq N )(1…
思路好想,细节多的令人发指.. /* 反着判断:走完每个点=走过的路程=n*m-k 然后暴力判每行每列的目的地 每次走都能使走的范围缩小一行或者一列 */ #include<bits/stdc++.h> #include<vector> using namespace std; #define N 200005 #define ll long long vector<int>R[N],C[N];//每一行|列内的障碍 ll tot,n,m,k; int main(){…
蚂蚁(ant)[题目描述] 小 R 种了一棵苹果树,这棵树上有 n 个节点(标号从 0 到 n-1),有 n-1 条树枝连接这 n 个节点,这 n 个节点相互连通.每条树枝的长度为 1. 苹果树上的每一个节点上生长着一个苹果,这个苹果散发着香味.在 0 时刻,第 i 个 节点的苹果散发香味的浓郁度为 s[i],以后每过一个单位时间,香味的浓郁度就会增加 a[i]. 苹果树上还有一只蚂蚁,在 0 时刻时,这只蚂蚁在 0 号节点,在第 i 时刻,它会朝着 第 i 时刻时香味最浓郁的节点方…
A. Snacktower time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output According to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. S…
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:691 解决:412 题目描述: Starting from point (0,0) on a plane, we have written all non-negative integers 0,1,2, ... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively…
畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) http://acm.hdu.edu.cn/showproblem.php?pid=1232 Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇.省政府"畅通工程"的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间…