考察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&&f2)?b:a;
         printf("%d\n",temp);
     }
     ;
 }

1003 Crashing Balloon的更多相关文章

  1. [ZJU 1003] Crashing Balloon

    ZOJ Problem Set - 1003 Crashing Balloon Time Limit: 2 Seconds      Memory Limit: 65536 KB On every J ...

  2. [ZOJ 1003] Crashing Balloon (dfs搜索)

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3 题目大意:给你a,b两个数,问当b由约数1到100组成时,a能否由其 ...

  3. ZOJ 1003 Crashing Balloon

    #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using ...

  4. ZOJ1003 Crashing Balloon

    Crashing Balloon Time Limit: 2 Seconds      Memory Limit: 65536 KB On every June 1st, the Children's ...

  5. 【ZOJ1003】Crashing Balloon(DFS)

    Crashing Balloon Time Limit: 2 Seconds      Memory Limit: 65536 KB On every June 1st, the Children's ...

  6. 【Acm】算法之美—Crashing Balloon

    题目概述:Crashing Balloon On every  June 1st, the Children's Day, there will be a game named "crash ...

  7. ZJU-1003 Crashing Balloon dfs,

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3 题意(难以描述):A,B两个人从1~100选数乘起来比谁的大(不能选重复的或者 ...

  8. POJ题目细究

    acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  102 ...

  9. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

随机推荐

  1. Python模块的介绍

    Python模块的学习: 1.os模块: 下面只对os模块中几个比较常用的方法做一些简单的示例: os.system():这个方法在shell中体现的比较多,在dos命令行中也可以执行,下面就以在do ...

  2. Oracle Trunc

    http://www.cnblogs.com/xiaoyudz/archive/2011/03/18/1988467.html

  3. Calendar中add函数和roll函数的用法及区别

    Calendar中add()和roll()函数的用法一.取某个时间点后的整点时刻.例如1984年7月7日15:23:05后的整点时刻即为1984-07-07 16:00:00.实现如下:Calenda ...

  4. 《how to design programs》12章函数复合

    我们写代码时要学会适应辅助函数.作者提出了一个问题,如何对一个表排序.排序函数读取一个表,产生另一个表.排序函数的合约和用途如下: (sort empty) ;; expected value: em ...

  5. case then 的用法 貌似case then不支持别名

    set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo ALTER PROC [dbo].[usp_SRV_GetALLRelativeProject]@Service ...

  6. 配置VirtualBox Linux系统与Windows共享文件

    手动方式配置VirtualBox Linux系统与Windows共享文件 首先,要安装VirtualBox自带的扩展工具,这个ISO可以在虚拟主机安装目录下找到. 将这个文件Copy到你的Linux主 ...

  7. openstack configure

    <一,nova.conf配置文件配置 hypervisors compute_driver = 值> 1,kvm/qemu Hypervisor OpenStack nova comput ...

  8. FWA winner | Car Visualizer WebGL

    FWA winner | Car Visualizer WebGL Car Visualizer made in WebGL using ThreeJS. It requires a modern b ...

  9. 【转】HDMI控制与组态剖析

    HDMI能够称霸为王者之尊吗?目前消费者陷入的困境就是Audio/Video的连接线数量过度庞大,而HDMI最大卖点之一就是可使用单一的连接线完全取代众多的影音连接线,简洁又方便.缺点是技术版本变动太 ...

  10. django 启动和请求

    Django运行方式 调试模式 直接 python manage.py runserver python manage.py runserver python manage.py runserver ...