摘要: 原题 错误代码: #include<bits/stdc++.h> using namespace std; long long math(int a) { if(a <= 2){ return 1; } long long f0 = 1,f1 = 1,f2; for(int i = 3;i <= a 阅读全文
posted @ 2023-12-06 23:44 Qwehhh 阅读(10) 评论(0) 推荐(0)
摘要: 拓展gcd 求形如ax+by=gcd(a,b)的问题 代码如下: #include <bits/stdc++.h> using namespace std; // ax+by=gcd(a,b) void exgcd(int a,int b,int &x,int &y) { if(b == 0){ x = 1; 阅读全文
posted @ 2023-12-06 23:42 Qwehhh 阅读(15) 评论(0) 推荐(0)