ZOJ 1003 Crashing Balloon】的更多相关文章

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3 题目大意:给你a,b两个数,问当b由约数1到100组成时,a能否由其它约数也在1到100的组成 就是dfs先枚举b的乘积组合,再看a有没有组合能够乘出来.. 代码: #include <cstdio> #include <cstdlib> #include <string> #include <iostream> #includ…
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; int n,m; int flag1,flag2; void dfs(int a,int b,int x) { ) { flag2=; ) flag1=; } if(flag1&&flag2) return; ) return; ) dfs(a/x,b,x-);…
ZOJ Problem Set - 1003 Crashing Balloon Time Limit: 2 Seconds      Memory Limit: 65536 KB On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV.   The rule is very simple.  On the ground there are 100 labeled…
考察DFS的应用,判断两个数的因子. #include <stdio.h> int f1,f2; void DFS(int m,int n,int k){ ){ f2=; ) f1=; } ) return; ) DFS(m/k,n,k-); ) DFS(m,n/k,k-); DFS(m,n,k-); } int main(){ int a,b,temp; ){ if(a<b){ temp=a; a=b; b=temp; } f1=f2=; DFS(a,b,); temp=(!f1&am…
Crashing Balloon Time Limit: 2 Seconds      Memory Limit: 65536 KB On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV.   The rule is very simple.  On the ground there are 100 labeled balloons, with the num…
Crashing Balloon Time Limit: 2 Seconds      Memory Limit: 65536 KB On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV.   The rule is very simple.  On the ground there are 100 labeled balloons, with the num…
题目概述:Crashing Balloon On every  June 1st, the Children's Day, there will be a game named "crashing balloon" on  TV.   The rule is very simple.  On the ground there are 100 labeled balloons,  with the numbers 1 to 100. After the referee shouts &q…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3 题意(难以描述):A,B两个人从1~100选数乘起来比谁的大(不能选重复的或者对方选的).数小的人如果发现数大的人在撒谎,则他可以获胜.(当然都没撒谎大数赢,都撒谎了也是大数赢233)而他判断大数撒谎的方法就是找到自己选的一个数,是构成大数所必须的./*给你两个数,由1~100选取不重复的数乘起来得到的.如果小的那个数包含了某个大数必须包含的因子,则*/ 题解:从1到100…
题目链接 题意 有n支队在m个位置上做题,有一个机器人位置1到位置m再到位置1循环走派发气球,当队伍a在时间b做完了一道题目的时候,假如机器人走到队伍a的位置的时间为c,那么这个队伍的不开心值就是c-b.现在让你决定机器人的起始位置,使得所有队伍的不开心值总和最小. 思路 假设初始机器人从位置1开始,计算做完每道题总共有多少不开心值. 将不开心值从小到大排序. 然后枚举每一道题作为起点时候的情况. 对于第i道题目,因为位置往后走,后面的题目的时间就会减少 tid[i],前面的题目的时间就会增加…
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  1027   Human Gene Functions   简单题  1037   Gridland            简单题  1052   Algernon s Noxious Emissions 简单题  1409   Commun…