CodeForces 822A I'm bored with life
来源:互联网 发布:温度控制pid算法c程序 编辑:程序博客网 时间:2024/04/29 14:06
题目链接:http://codeforces.com/contest/822/problem/A
题意:给你两个数a,b,让你求gcd(a!,b!)
解析:很明显gcd(a!,b!)=min(a,b)!,而且题目说明了min(a,b)<=12,所以直接去最小值,然后求一下阶乘就可以了
#include <bits/stdc++.h>using namespace std;int main(void){ int a,b; scanf("%d %d",&a,&b); int tt = min(a,b); int ans = 1; for(int i=1;i<=tt;i++) ans*=i; printf("%d\n",ans); return 0;}
阅读全文
0 0
- codeforces 822 A I'm bored with life
- CodeForces 822A I'm bored with life
- codeforces 822A(I'm bored with life) Java
- Codeforces 822A I'm bored with life
- I'm bored with life (Codeforces 822A)
- codeforces 822A I'm bored with life
- Codeforces Round #422 A. I'm bored with life
- Codeforces822 A I'm bored with life
- A. I'm bored with life
- A. I'm bored with life
- I'm bored with life
- I'm bored with life
- Codeforces Round #422 (Div. 2) A I'm bored with life
- Codeforces Round #422 (Div. 2) A. I'm bored with life
- 0706 CF#822A-I'm bored with life #822B-Crossword solving
- I'm bored~~~
- I found a bug with CCParticleSystem.m
- What the fuck life I'm going
- spring之再学习(1)
- javascript学习(十)— 高阶函数:map/reduce,filter,sort
- MySQL调整max_allowed_packet的大小
- 从零开始学git 速成
- FreeRTOS介绍
- CodeForces 822A I'm bored with life
- Python数据分析包——NumPy(Numerical Python)
- shell 命令管理tomcat
- Linux-Flash驱动(4)-MTD系统架构
- good job
- 自定义view之圆形进度条
- Windows下MSYS2中编译OpenBLAS过程记录
- [lintcode]二叉树的最大深度
- osg坐标系理解