上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 24 下一页
摘要: 1 #include <cstdio> 2 const int M=150010,N=30010; 3 struct edge{int v,w,next;}e[M];int head[N],cnt; 4 void add(int u,int v,int w){e[++cnt].v=v,e[cnt]. 阅读全文
posted @ 2020-02-23 15:15 墨鳌 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 枚举子集,要求子集的min+max<=k,求子集个数,答案对1000000007取模 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn=100010,MOD=1000000007; 4 typedef long lo 阅读全文
posted @ 2020-02-23 00:32 墨鳌 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 分析:https://www.bilibili.com/read/cv4777102 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 const int MAXN=1e5+10; 5 struct node{in 阅读全文
posted @ 2020-02-22 20:38 墨鳌 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 题意就是,找出最长合法子括号序列 容易想到设f[l][r]为l~r的最长合法子括号序列的长度 然后从短的状态往长的状态枚举,不断更新答案就可以了 1 //#include<bits/stdc++.h> 2 #include <cstdio> 3 #include <cstring> 4 #inclu 阅读全文
posted @ 2020-02-21 21:49 墨鳌 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 每次只能从取集合S中个数的物品,其他和普通Nim游戏相同 预处理出每种物品堆的sg值,然后直接xor一下,xor-sum>0即必胜 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include < 阅读全文
posted @ 2020-02-20 22:12 墨鳌 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 题目把Nim游戏为什么可以取异或和讲解得十分清楚,建议多读几次,理解一下 再一个,可以把每次异或视为一次取数,因此(k[i]^sg)<k[i]即为一种可行操作 /* Nim is a 2-player game featuring several piles of stones. Players a 阅读全文
posted @ 2020-02-20 12:21 墨鳌 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include <vector> 6 #include <cstdio> 7 #include <cstdlib> 8 #include <cstri 阅读全文
posted @ 2020-02-19 23:00 墨鳌 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include <vector> 6 #include <cstdio> 7 #include <cstdlib> 8 #include <cstri 阅读全文
posted @ 2020-02-19 21:50 墨鳌 阅读(155) 评论(0) 推荐(0) 编辑
摘要: //(ak,bk)=([k*(1+sqrt(5))/2],[k*(1+sqrt(5))/2]+k)=(ak,ak+k) 1 #include <cstdio> 2 double sqrt5=2.2360679774997896964091736687313; 3 int main(){ 4 for( 阅读全文
posted @ 2020-02-19 15:03 墨鳌 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include <vector> 6 #include <cstdio> 7 #include <cstdlib> 8 #include <cstri 阅读全文
posted @ 2020-02-19 13:33 墨鳌 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 24 下一页