- 博客(7)
- 资源 (2)
- 收藏
- 关注
原创 A - Chtholly's request CodeForces - 897B
A - Chtholly’s request CodeForces - 897B — Thanks a lot for today. — I experienced so many great things.— You gave me memories like dreams… But I have to leave now…— One last request, can you…— Help m
2017-12-27 01:48:21 230
原创 小知识点之回文数(三种方法)
由于时间关系,再次先列出其中一种最为常见的判断回文数的方法。 之后会慢慢补上,并根据学习状况进行拓展~~(只要求对称的位置值相等就可以了)。#include<iostream>#include<string>#include<stdio.h>#include<math.h>using namespace std;string a;int main(){ int i,flag=
2017-12-27 01:02:40 529
原创 最大公约数和最小公倍数
公式:最大公约数*最小公倍数=两数之积 最大公约数三种方法:辗转相除,辗转相减法,穷举法。//辗转相除法#include<iostream>using namespace std;int main(){ int m,n,q; cin>>n>>m; while(n%m!=0){ q=n%m; n=m; m=q; }
2017-12-24 00:37:09 206
原创 B - Beautiful Divisors CodeForces - 893B
Recently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called beautiful iff its binary representation consists of k + 1 consecutive ones, and then k conse
2017-12-23 18:16:05 331
原创 m进制数转十进制数和十进制数转m进制数(m小于等于16)
m进制数转十进制数(乘权取余法)#include<iostream>#include<cmath>using namespace std;int main(){ int n,m; int ans=0; cin>>n>>m; for(int i=6;i>=0;i--){ int a=n/pow(10,i); //1式 int b
2017-12-21 17:36:43 2024
原创 CodeForces 893B Beautiful Divisors
C - Matrix Power Series Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.Input The input contains exactly one test case. The first line of input contains three
2017-12-14 13:15:59 191
原创 快速幂算法详解
/*快速幂*/int pow(int a, int b) { int ans = 1, base = a; while (b != 0) { if (b & 1 != 0) ans *= base; base *= base; b >>= 1; } return ans;/*常规求
2017-12-01 00:04:55 689
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人