华华对月月的忠诚

华华对月月的忠诚

http://www.nowcoder.com/questionTerminal/647d45470c63407db0152d3ebb407fa3

想一下求最大公约数的辗转相除法,如果用在斐波那契数列上,就会得到,直接求前两个数字就行了

# include <cstdio>
# include <cstring>
# include <cctype>
# include <cmath>
# include <cstdlib>
# include <climits>
# include <iostream>
# include <iomanip>
# include <set>
# include <map>
# include <vector>
# include <stack>
# include <queue>
# include <algorithm>
using namespace std;


const int debug = 1;
const int size  = 5000 + 10;
const int INF = INT_MAX>>1;
typedef long long ll;

int main()
{
    // std::ios::sync_with_stdio(false);cin.tie(0);
    ll a, b, n;
    cin >> a >> b >> n;
    cout << __gcd(a, b) << endl;
    return 0;
}
全部评论

相关推荐

不亏是提前批,神仙打架,鼠鼠不配了
站队站对牛:现在92都报工艺岗了
投递韶音科技等公司7个岗位
点赞 评论 收藏
分享
我是没经验的毕业生,这啥情况啊会不会是hr在刷kpi
JamesGosli...:字节boss属于是群发了,我都快入职字节了,其他部门还在和我boss打招呼
点赞 评论 收藏
分享
Lorn的意义:你这种岗位在中国现在要么牛马天天加班,要么关系户进去好吃好喝,8年时间,真的天翻地覆了,对于资本来说你就说一头体力更好的牛马,哎,退伍没有包分配你真的亏了。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务