上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 24 下一页
摘要: 这么水的题,唉,三种方法花式过,考的是思维吧?滑稽 1 #include <iostream> 2 using namespace std; 3 int dp[10][10]; 4 int f(int x,int y){ 5 if(x==1||y==1)return 1; 6 return f(x- 阅读全文
posted @ 2020-03-02 19:17 墨鳌 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 bool vis[15]; 4 bool check(long long a,long long b){ 5 memset(vis,0,sizeof(vis)); 6 while(a) 7 if( 阅读全文
posted @ 2020-03-02 16:44 墨鳌 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 bool Check(int y){return (y%4==0&&y%100)||(y%400==0);} 4 void calc(int Y,int M,int D,int x){ 5 int 阅读全文
posted @ 2020-03-02 16:27 墨鳌 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 3 购物清单 4 5 小明刚刚找到工作,老板人很好,只是老板夫人很爱购物。 6 老板忙的时候经常让小明帮忙到商场代为购物。 7 小明很厌烦,但又不好推辞。 8 9 这不,XX大促销又来了!老板夫人开出了长长的购物单,都是有打折优惠的。 10 小明也有个怪癖,不到万不得已,从不刷卡,直接 阅读全文
posted @ 2020-03-02 13:23 墨鳌 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 1 #include <cstdio> 2 int a[10],copy[10],cnt,ans,flag; 3 bool check(){ 4 int sum=a[1]+a[2]+a[3]; 5 if(sum!=a[4]+a[5]+a[6])return false; 6 if(sum!=a[1] 阅读全文
posted @ 2020-03-02 11:09 墨鳌 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 呵呵,题目都这么明确了,题解什么的,就不需要了吧! 和上一篇poj2104的题意一模一样,数据范围*2了而已,可以直接复制代码过去a掉 但是我还是兢兢业业的重新敲了一遍,种树这种事情要勤奋嘛! 介于昨天刚学,自是不能领悟Insert操作的精妙之处 故今天写代码时先建了一颗nlogn的空树,方便查找( 阅读全文
posted @ 2020-03-01 12:59 墨鳌 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 主席树,大家这么叫的,也不知道为什么? 算法思路: 1.先排序,离散化 2.按排名插入n个版本的线段树 3.没有修改,查询即可 由于维护的是权值的区间和, 因此只要查询版本r和l-1,做差比较即可 1 #include <cstdio> 2 #include <algorithm> 3 using 阅读全文
posted @ 2020-02-29 22:22 墨鳌 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1 #include <queue> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 int vis[305][305]; 6 int trun[8][2]={{1,2},{2,1},{1,-2},{-2,1},{- 阅读全文
posted @ 2020-02-29 15:02 墨鳌 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1 #include <cstdio> 2 #include <string> 3 #include <cstring> 4 #include <iostream> 5 using namespace std; 6 typedef long long ll; 7 ll num,k=10,ans;in 阅读全文
posted @ 2020-02-28 16:26 墨鳌 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 忘了改矩阵的大小居然还有33分,我醉了 1 #include <cstdio> 2 const int N=35; 3 struct Matrix{int a[N][N];}; 4 int n,m; 5 Matrix A,O,I; 6 Matrix Mul(Matrix A,Matrix B){ 7 阅读全文
posted @ 2020-02-27 22:16 墨鳌 阅读(376) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 24 下一页