不要让昨天 占据你的今天 夏午晴天

夏午晴天

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页

2017年4月1日

巴什博弈

摘要: 1 #include <iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 int n, m, c; 8 cin >> c; 9 while(c--){ 10 cin >> n >> m; 11 if(n%(m+1)){ 12 cout < 阅读全文

posted @ 2017-04-01 12:44 夏晴天 阅读(202) 评论(0) 推荐(0) 编辑

2017年3月29日

778A String Game

摘要: A. String Game time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output A. String Game time limit 阅读全文

posted @ 2017-03-29 18:07 夏晴天 阅读(647) 评论(0) 推荐(0) 编辑

2017年3月28日

787A The Monster

摘要: A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, .... 阅读全文

posted @ 2017-03-28 09:13 夏晴天 阅读(591) 评论(0) 推荐(0) 编辑

2017年3月27日

758B Blown Garland

摘要: B. Blown Garland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Blown Garland time li 阅读全文

posted @ 2017-03-27 22:08 夏晴天 阅读(178) 评论(0) 推荐(0) 编辑

2017年3月26日

gcd(欧几里得算法)

摘要: 基础 1 int gcd(int a,int b) 2 { 3 int r; 4 while(b>0) 5 { 6 r=a%b; 7 a=b; 8 b=r; 9 } 10 return a; 11 } 递归 1 int gcd(int a,int b) 2 { 3 return (b>0)?gcd( 阅读全文

posted @ 2017-03-26 14:21 夏晴天 阅读(105) 评论(0) 推荐(0) 编辑

欧拉函数

摘要: 其中p1, p2……pn为x的所有质因数,x是不为0的整数。 1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 5 int euler(int n){ 6 int ans = n; 7 for(int i = 2;i 阅读全文

posted @ 2017-03-26 12:06 夏晴天 阅读(112) 评论(0) 推荐(0) 编辑

快速幂

摘要: & 和 >> & 运算通常用于二进制取位操作,例如一个数 & 1 的结果就是取二进制的最末位。还可以判断奇偶x&1==0为偶,x&1==1为奇。 >> 运算比较单纯, 二进制去掉最后一位 1 LL get_pow(LL x, LL n)快速幂 2 { 3 LL ans = 1; 4 while(n) 阅读全文

posted @ 2017-03-26 09:02 夏晴天 阅读(112) 评论(0) 推荐(0) 编辑

2017年3月25日

HDU_2136

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 // hdu 2136 7 /* 8 0 1 2 3 4 5 6 7 8 9 10 11 9 1 0 1 1 1 1 1 10 1 0 1 2 1 2 1 2 1 11 1 0 1 2 1 3 2 1 ... 阅读全文

posted @ 2017-03-25 17:23 夏晴天 阅读(84) 评论(0) 推荐(0) 编辑

最大质因子

摘要: 1 #include 2 3 using namespace std; 4 #define ll long long 5 6 ll get_max_prime(ll n){ 7 ll cmp = 0; 8 for(ll i = 2; i 1 && n > cmp) 15 cmp = n; 16 return cmp; 17 } 18... 阅读全文

posted @ 2017-03-25 16:23 夏晴天 阅读(271) 评论(0) 推荐(0) 编辑

素数筛

摘要: 筛选0 - 100 素数 1 #include 2 3 using namespace std; 4 #define MAXN 100 5 //筛选0 - 100 素数 6 int prime[MAXN]; 7 /* 8 0 1 2 3 4 5 6 7 8 9 10 11 12 13 9 1.1. 1 1 1 1 1 10 ... 阅读全文

posted @ 2017-03-25 15:18 夏晴天 阅读(95) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页

导航

Live2D