SDNU1089拓扑排序(有向图的存储)
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e3+10;
int dp[maxn][maxn];
bool vis[maxn];
queue<int>que;
int n,m,a,b;
bool judge(int x)
{
for(int i=1; i<=n; ++i)
if(dp[i][x]==1)
return false;
return true;
}
SDNU1045(1048)石子合并(动态规划问题)
参考大佬博客:https://blog.csdn.net/sunshine_yg/article/details/47209299 代码1045:
#include<bits/stdc++.h>
using namespace std;
const int maxn=2e2+10;
const int inf=0x3f3f3f3f;
int dp[maxn][maxn];
int num[maxn];
int sum[maxn];
int n;
void solve()
{
int
SDNU1204水题(找规律)
首先:n为奇数时:f(2k+1)=f(2k) 其次:n为偶数时,可以将n的划分分为两部分,一部分含有1,划分数等于f(2k-1) 另一部分没有1全为2或者2的倍数,提取公因子2恰好是f(k) 因此:n为偶数时f(2k)=f(2k-1)+f(k)
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
const int mod=1e9;
int num[maxn];
int n;
void init()
{
SDNU1068(矩阵快速幂模板)
#include<bits/stdc++.h>
using namespace std;
const int maxn=3;
const int mod=1000000007;
struct mat
{
long long int m[maxn][maxn];
} ans;
mat mul(mat A,mat B)
{
mat tmp;
for(int i=0; i<maxn; ++i)
for(int j=0; j<maxn; ++j)
LightOJ - 1259(素数打表)
题目链接:https://vjudge.net/problem/LightOJ-1259
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e7+5;
const int maxx=5e6+10;
bool vis[maxn];
int num[maxx];
map<int,int>mapp;
int t;
int top=0;
void prime()
{
memset(vis,0,sizeof(vis));
程序员的你想跳槽了?谨记:哪里都不好混!
朋友忽然有一天问出这个让你为难的问题:我想跳槽去干嘛干嘛,你觉得怎么样?举个极端点的例子,老曹一个学生的妈妈,专业换工作四十年,还是跨度特别大的跳槽,比如关了生意不好做的小书店,转而去考了导游证,当了两年导游觉得也不是拿钱玩乐这么简单,于是又想去做别的……按照那个学生的话说,就是:每次放学回去发现我妈在家,就担心她又改行了。从人类诞生开始,大概对自己的处境就心怀各种不满,所以经过数千年的智慧积累,
SDNU1522.陆历川学数学(素数筛求最大因子)
算法思想:每次遇到质数,都将所有以该数字为因子的数的最大编号更新。 【1-1e6】中的所有数字最终更新完毕 线性筛的时间复杂度是O(n)
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
int n;
bool vis[maxn];
int num[maxn];
int top;
void prime(int x)
{
memset(vis,0,sizeof(vis));
int top=0;
SDNU1085.爬楼梯再加强版(矩阵快速幂+矩阵关系推导)
#include<bits/stdc++.h>
using namespace std;
const int maxn=3;
const int mod=1e9+7;
struct mat
{
long long int m[maxn][maxn];
} ans;
mat mul(mat A,mat B)
{
mat tmp;
for(int i=0; i<maxn; ++i)
for(int j=0; j<maxn; ++j)
CodeForces - 628B【C - New Skateboard】(子串问题+被4整除)
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
long long ans = 0;
for (int i = 0; i < s.size(); i++)
if ( (s[i] - '0') % 4 == 0 )
ans++;
for (int i = 1; i < s.size(); i++)
UVA11384(I - Help is needed for Dexter )
AC代码如下:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3+10;
int n,top;
int main()
{
while(~scanf("%d",&n))
{
top = 31;
while((n>>top) == 0)
top--;
printf("%d\n",top+1);
}
ret
HDU5929(双端队列+与非的性质+模拟找规律)
最新学习双端队列的用法。
#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5+10;
int num[maxn*2];
int l,r,t,cas;
deque<int>que;
int flag;
char str[15];
void init()
{
l = maxn;
r = maxn-1;
flag = 1;
que.clear();
}
void push(int x
POJ1088(动态规划+搜索)
题目链接:https://vjudge.net/contest/49759#problem/E
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
const int maxn = 1e2+10;
const int inf = 0x3f3f3f3f;
int n,m;
int num[maxn][maxn];
bool vis[maxn][
windows ffmpeg 的安装
本文我们要安装的是 windows 下的 ffmpeg 命令行工具,安装的步骤十分简单,分为:下载、解压、配置环境变量。 下载,进入 http://ffmpeg.org/download.html#build-windows,下载页面,点击 windows 对应的图标,进入 windows 下的 ffmpeg 下载界面 http://ffmpeg.zeranoe.com/builds/,点击 download 按钮, 解压 ffmpeg-20190212-a84af76-win64-stati
windows 安装Neo4j
Neo4j 简介: Neo4j 是目前最流行的图形数据库,支持完整的事务,在属性图中,图是由顶点(Vertex),边(Edge)和属性(Property)组成的,顶点和边都可以设置属性,顶点也称作节点,边也称作关系,每个节点和关系都可以由一个或多个属性。Neo4j创建的图是用顶点和边构建一个有向图,其查询语言cypher已经成为事实上的标准。 下载Neo4j安装文件 从Neo4j官网下载最新版本Neo4j 3.2 社区(Community)版本 “nneo4j-community-3.4.6.
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
本文转自:https://blog.csdn.net/q258523454/article/details/84555847 mysql连数据库的时候报错: 1251 client does not support authentication protocol requested by server;consider upgrading Mysql client ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'local
MySQL8 调整密码策略和指定Root 用户密码存储方式
第一步:查看password密码策略的变量名:SHOW VARIABLES LIKE 'validate_password%'; 查询结果如下: +--------------------------------------+-------+ | Variable_name | Value | +--------------------------------------+-------+ | validate_password.check_user_name ON | validate_pa
洛谷P2904 跨河River Crossing
目录 题目描述 输入输出格式 输入输出样例 说明 我的WA思路 AC思路 同步:https://buringstraw.win/admin/write-post.php?cid=33 题目描述 Farmer John以及他的N(1 <= N <= 2,500)头奶牛打算过一条河,但他们所有的渡河工具,仅仅是一个木筏。 由于奶牛不会划船,在整个渡河过程中,FJ必须始终在木筏上。在这个基础上,木筏上的奶牛数目每增加1,FJ把木筏划到对岸就得花更多的时间。 当FJ一个人坐在木筏上,他把木筏划到对岸需
Vue_(基础)Vue中的指令
Vue.js中文文档 传送门 Vue的指令:其实就是单个JavaScript表达式,一般来说是带有v-前缀 Vue指令: v-model:数据双向绑定; v-text:以纯文本方式显示数据; v-html:可以识别HTML标签; v-once:只渲染元素或组件一次; v-pre:不进行编译,直接显示内容; v-for:对集合或对象进行遍历; 项目结构 【每个demo下方都存有html源码】 Hello
spark记录(0)Spark初始
部分摘自:https://www.cnblogs.com/qingyunzong/p/8886338.html 1.什么是Spark Apache Spark 是专为大规模数据处理而设计的快速通用的计算引擎。Spark是UC Berkeley AMP lab (加州大学伯克利分校的AMP实验室)所开源的类Hadoop MapReduce的通用并行计算框架,Spark拥有Hadoop MapReduce所具有的优点;但不同于MapReduce的是Job中间输出结果可以保存在内存中,从而不再需要读
HDU 4725 The Shortest Path in Nya Graph(构图)
The Shortest Path in Nya Graph Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13445 Accepted Submission(s): 2856 Problem Description This is a very easy problem, your task is just calculate el
今日推荐
周排行