当前位置: 首页 > news >正文

做网站内容管理器要吗济南网站seo优化

做网站内容管理器要吗,济南网站seo优化,wordpress查询次数,有什么网站做悬赏的 能挣钱题目 Sheng bill有着惊人的心算能力#xff0c;甚至能用大脑计算出两个巨大的数的GCD#xff08;最大公约 数#xff09;#xff01;因此他经常和别人比 赛计算GCD。有一天Sheng bill很嚣张地找到了你#xff0c;并要求和你比 赛#xff0c;但是输给Sheng bill岂不是很丢… 题目 Sheng bill有着惊人的心算能力甚至能用大脑计算出两个巨大的数的GCD最大公约 数因此他经常和别人比 赛计算GCD。有一天Sheng bill很嚣张地找到了你并要求和你比 赛但是输给Sheng bill岂不是很丢脸所以你 决定写一个程序来教训他。 输入格式 共两行 第一行一个数A。 第二行一个数B。 0 A , B ≤ 10 ^ 10000。 输出格式 一行表示A和B的最大公约数。 输入样例 12 54 输出样例 6 题解 时隔大半年我回来A这道题啦【当初写的太BUG了】 求GCD很容一想到辗转相除而高精不好操作取模这就用到了辗转相除法的本质更相减损法 GCD(a,b) GCD(a,a-b) 【a 】 然而这样会T所以我们还要优化 GCD(a,b) 2*GCD(a/2,b/2) 【2|a且2|b】 GCD(a,b) GCD(a/2,b) 【2|a】 GCD(a,b) GCD(a,b/2) 【2|b】 GCD(a,b) GCD(a,a-b) 【a 】 加上个压位高精【高精减法高精除低精高精乘低精高精比较】 就可以A了 #includeiostream #includecstdio #includecstring #includestring #includealgorithm #define LL long long int #define REP(i,n) for (int i 1; i (n); i) using namespace std; const int maxn 10005,B 4,Base 10000,maxm 100005,INF 1000000000; struct NUM{int s[maxn],len;NUM() {memset(s,0,sizeof(s)); len 0;} }; istream operator (istream in,NUM a){string s;ins;int temp 0,t 1;for (int i s.length() - 1; i 0; i--){temp temp t * (s[i] - 0);if (t * 10 Base) a.s[a.len] temp,temp 0,t 1;else t * 10;}if (temp) a.s[a.len] temp;return in; } ostream operator (ostream out,const NUM a){if (!a.len) out0;else {printf(%d,a.s[a.len]);for (int i a.len - 1; i 0; i--) printf(%04d,a.s[i]);}return out; } bool check(const NUM a){return !(a.s[1] 1);} bool equal(const NUM a,const NUM b){if (a.len ! b.len) return false;REP(i,a.len) if (a.s[i] ! b.s[i]) return false;return true; } bool operator (const NUM a,const NUM b){if (a.len b.len) return true;if (a.len b.len) return false;for (int i a.len; i 0; i--){if (a.s[i] b.s[i]) return true;if (a.s[i] b.s[i]) return false;}return false; } void Half(NUM a){int carry 0,temp;for (int i a.len; i 0; i--){temp (a.s[i] carry * Base) / 2;carry a.s[i] carry * Base - temp * 2;a.s[i] temp;}while (!a.s[a.len]) a.len--; } void Twice(NUM a){int carry 0,temp;for (int i 1; i a.len; i){temp a.s[i] * 2 carry;a.s[i] temp % Base;carry temp / Base;}while (carry) a.s[a.len] carry % Base,carry / Base; } NUM operator -(const NUM a,const NUM b){NUM c; c.len a.len;int carry 0,temp;for (int i 1; i a.len; i){temp a.s[i] - b.s[i] carry;if (temp 0) carry -1,temp Base;else carry 0;c.s[i] temp;}while (!c.s[c.len]) c.len--;return c; } int main(){NUM A,B; int cnt 0;cinAB;while (!equal(A,B)){if (check(A) check(B)) Half(A),Half(B),cnt;else if (check(A)) Half(A);else if (check(B)) Half(B);else {if (B A) swap(A,B);B B - A;}}while (cnt--) Twice(A);coutAendl;return 0; }转载于:https://www.cnblogs.com/Mychael/p/8282745.html
http://www.pierceye.com/news/578292/

相关文章:

  • 网站建设哪谷歌浏览器安卓版下载
  • 中国建设银行上海市分行网站天津工程建设信息网站
  • 怎么做好网站开发、设计中国站长网站
  • 沈阳网站建设tlmh室内设计装修案例
  • 网站 linux 服务器配置长沙企业网站建设价格
  • 低价网站制作企业智慧团建官网登录口手机版
  • 临沂网站制作专业如何 做网站
  • 旅游景区网站开发的政策可行性天翼云电脑免费领取
  • 企业网站建设报价做网站要实名认证吗
  • 设计网站得多少钱ui设计师个人简历
  • 彩票网站建设基本流程wordpress上篇下篇代码
  • 一站式服务的优点无锡网站搜索优化
  • 怎么做地区网站烟台网站建设首推企汇互联见效付款
  • 杭州网站优化服务网站内容方案
  • 大气手机网站模板免费下载军事网站模板下载
  • 大兴德艺网站建设wordpress上传的gif图不会动
  • 三门峡住房和建设局网站房产主题wordpress
  • 网站改版 权重php做网站脑图
  • 交易网站建设需要学什么网店装修
  • 青岛市城市建设档案馆网站东莞网络推广优化排名
  • 成交型网站做网站优化的价格
  • 后台网站设计烟台优化网站公司
  • 网站开发中涉及的侵权行为软件开发案例展示
  • 网站开发u盘128够吗网络服务器是指什么
  • 网站空间试用百度搜索引擎关键词优化
  • 中山品牌网站设计阿里云企业网站怎么建设
  • 做网站推广广告房地产行业网站开发
  • 济宁网站建设 企业谷wordpress手机 不适应
  • 如何用php做网站合肥专业手机网站哪家好
  • 如何推广自己的网站和产品如何用dw做网站地图