摘要: #include<bits/stdc++.h> using namespace std; int main(){ int a, b; scanf("%d%d",&a, &b); int k = 0; while(k = a % b) { a = b; b = k; } printf("%d",b); 阅读全文
posted @ 2024-02-05 15:13 _yuen 阅读(7) 评论(0) 推荐(1) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int b ,p ,k; //蒙哥马利取模运算 求 a^b mod c int Montgomery(int a, int b, int c){ int ans = 1; a = a % c; while(b 阅读全文
posted @ 2024-02-05 14:59 _yuen 阅读(6) 评论(0) 推荐(1) 编辑