上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 33 下一页
摘要: 题目:https://www.nowcoder.com/pat/2/problem/249 阅读全文
posted @ 2017-12-26 16:39 ouyang_wsgwz 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 typedef long long LL; 6 const int maxn = 10000 + 5; 7 int a[maxn]; 8 LL sum[maxn]; 9 10 int main(){ 11 std::ios::sync_with_s... 阅读全文
posted @ 2017-12-20 17:24 ouyang_wsgwz 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #define ll long long 4 using namespace std; 5 6 void dfs(ll a, ll b, ll c[]) 7 { 8 ll n = a / 10, m = a % 10, t = n; 9 for (int i = 0; i > a >> b; 29 ... 阅读全文
posted @ 2017-12-20 17:06 ouyang_wsgwz 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 如果将第二位看成第一位,那么 k * (k+1) / 2都是1,k >= 1,那么其他位都是 0 所以如果n-1=k*(k+1)/2 (n>1),则该位就是1 阅读全文
posted @ 2017-12-08 19:47 ouyang_wsgwz 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 具体题解发一下大佬的分析http://blog.csdn.net/wyg1997/article/details/52169036 阅读全文
posted @ 2017-12-07 21:34 ouyang_wsgwz 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #define MAXN 510 4 using namespace std; 5 int f[MAXN][MAXN], dp[MAXN][MAXN];// 数字塔数组和dp数组 6 int main() { 7 int n; 8 scanf("%d", &n); 9 for (int i = 1;... 阅读全文
posted @ 2017-11-30 20:46 ouyang_wsgwz 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int prime[40]; 7 int c1[151]; 8 int c2[151]; 9 int num[151]; 10 int l; 11 void init() 12 { 13 int i,j; 14 num[0]=1; 15... 阅读全文
posted @ 2017-11-30 20:15 ouyang_wsgwz 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 在C++中,const 这个关键字用法非常灵活,导致我总会搞不清作用是干啥的。灵活使用const会大大改善程序。 const 是C++的一种类型修饰符,是不可改变的不能被更新的。 1.const 修饰成员变量 const int a = 1; 此时的a在后面的操作中不能被改变,否则会报错 2.con 阅读全文
posted @ 2017-11-22 21:49 ouyang_wsgwz 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 在进行并的时候不能瞎jb并,比如(x, y)就必须把x并给y ,即fa[x] = y 阅读全文
posted @ 2017-11-19 21:41 ouyang_wsgwz 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 const int maxn = 50005; 6 int f[maxn], rank[maxn]; 7 int n, m; 8 9 void init(){ 10 for (int i = 0; i <= n; ++i){ 11 f[i] = i; 1... 阅读全文
posted @ 2017-11-19 21:07 ouyang_wsgwz 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 33 下一页