
dfs
文章平均质量分 70
JamesLee0001
无
展开
-
hihocoder#1054 : 滑动解锁
#include #include#include#include#include#includeusing namespace std;int T,m,a[10],ans;vector mg[10];int g[10][10];bool used[10];void init(){ memset(g,0,sizeof(g)); g[1][3]=g[3][原创 2015-05-10 20:48:55 · 733 阅读 · 0 评论 -
hihocoder 1680 hiho字符串2
#1680 : hiho字符串2时间限制:10000ms单点时限:1000ms内存限制:256MB描述我们定义第一代hiho字符串是"hiho"。 第N代hiho字符串是由第N-1代hiho字符串变化得到,规则是:h -> hio i -> hi o -> ho 例如第二代hiho字符串是: hiohihioho 第三代是: ...原创 2018-10-18 13:31:50 · 290 阅读 · 0 评论 -
hihocoder 1372 平方求和
#include using namespace std;const int mx=1000000001+100000;int n;vector g;int dfs(int num,int cnt,int limit){ if(num==0) return 0; int p=upper_bound(g.begin(),g.end(),num)-g.begin()-1;原创 2017-02-01 19:18:39 · 413 阅读 · 0 评论 -
hihocodxer1187 Divisors
时间限制:10000ms单点时限:1000ms内存限制:256MB描述Given an integer n, for all integers not larger than n, find the integer with the most divisors. If there is more than one integer with the same原创 2015-10-27 19:06:36 · 972 阅读 · 0 评论 -
hihocoder 1238 Total Highway Distance
时间限制:10000ms单点时限:1000ms内存限制:256MB描述Little Hi and Little Ho are playing a construction simulation game. They build N cities (numbered from 1 to N) in the game and connect them by N-原创 2015-10-24 16:48:20 · 835 阅读 · 0 评论 -
hihocoder 诺兹多姆
时间限制:1000ms单点时限:1000ms内存限制:256MB描述wuzhengkai是一个炉石传说玩家。有一天,他碰到对面上了个诺兹多姆并上了嘲讽和圣盾。诺兹多姆是一个有8点攻击力和8点生命值的随从,这意味着他能够承受总量小于8点的伤害而不死亡,且对于任何攻击他的单位造成8点伤害。嘲讽意味着当诺兹多姆死亡之前你不能攻击对方玩家。圣盾意味着诺兹原创 2015-11-03 18:29:01 · 1046 阅读 · 0 评论 -
uva 12219 Common Subexpression Elimination
#include #include#include#include#include#include#include#includeusing namespace std;const int mx=50000+1000;int T,num,p;char name[mx][10] ,s[mx*10];bool used[mx];vector g[mx];struct no原创 2015-09-14 20:36:14 · 504 阅读 · 0 评论 -
UVA 1103
DescriptionIn order to understand early civilizations, archaeologists often study texts written in ancient languages. One such language, used in Egypt more than 3000 years ago, is based on charact原创 2015-08-03 14:59:50 · 416 阅读 · 0 评论 -
hdu 1364 Illusive Chase
刚开始我还很怀疑我的想法,后来百度没发现题解,看到discuss里面说数据很弱,于是我就大胆的写了个暴力,每次枚举一个点找到一次到合法终点的合法路径是,结束dfs,简单暴力代码如下#include #include#includeusing namespace std;const int mx=111;int mp[mx][mx],T,n,m,num,ans;bool use原创 2015-08-01 13:43:32 · 628 阅读 · 0 评论 -
uva 215 Spreadsheet Calculator
A spreadsheet is a rectangular array of cells. Cells contain data or expressions that can be evaluated toobtain data. A “simple” spreadsheet is one in which data are integers and expressions are mixed原创 2015-08-10 16:17:18 · 593 阅读 · 4 评论 -
hdu1100
#include #include#include#includeusing namespace std;int n,op[40],sum[40];void init(){ memset(op,0,sizeof(op)); op[1]=sum[1]=1;op[0]=1;sum[0]=0; for(int i=2;i<20;i++) {原创 2015-06-14 16:13:02 · 604 阅读 · 0 评论 -
hdu1175 连连看
#include #include#include#includeusing namespace std;int n,m,q,mp[1100][1100];bool used[1100][1100];int dx[4]={0,0,-1,1},dy[4]={1,-1,0,0};int x1,x2,y1,y2;void dfs(int x,int y){ used[x]原创 2015-06-22 12:04:55 · 355 阅读 · 0 评论 -
hihocoder 1689 推断大小关系 并查集+dfs
#1689 : 推断大小关系时间限制:20000ms单点时限:2000ms内存限制:256MB描述有N个整数A1, A2, ... AN,现在我们知道M条关于这N个整数的信息。每条信息是:Ai < Aj 或者 Ai = Aj 小Hi希望你能从第一条信息开始依次逐条处理这些信息。一旦能推断出A1和AN的大小关系就立即停止。 输出在处理第几条时第一次推断出A1...原创 2018-10-17 17:21:27 · 222 阅读 · 0 评论