随笔分类 -  lrj

摘要:接着紫书图论开始刷。。。 Fire! UVA - 11624 先从所有火源bfs1求出任意方格的起火时间,再从人开始bfs2逃跑。 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn=1050; 4 char pic[ 阅读全文
posted @ 2017-07-20 09:30 yijiull 阅读(231) 评论(0) 推荐(0)
摘要:重新开始学习图论了 Common Subexpression Elimination UVA - 12219 表达式树,,关于递归还是不会写 原文:http://www.cnblogs.com/zyb993963526/p/6385608.html 1 #include<iostream> 2 #i 阅读全文
posted @ 2017-07-19 13:59 yijiull 阅读(197) 评论(0) 推荐(0)
摘要:Colossal Fibonacci Numbers! UVA - 11582 因为输入WA了好几次。。。 unsigned long long最大为18446744073709551615 1 #include <iostream> 2 #include <bits/stdc++.h> 3 usi 阅读全文
posted @ 2017-07-17 10:57 yijiull 阅读(137) 评论(0) 推荐(0)
摘要:{DP} A Spy in the Metro UVA - 1025 has_train那块搞了挺久的。。。 1 #include <cstdio> 2 #include <bits/stdc++.h> 3 using namespace std; 4 const int maxn=260; 5 c 阅读全文
posted @ 2017-07-13 23:57 yijiull 阅读(154) 评论(0) 推荐(0)
摘要:##二分查找## HDU - 1053 很久之前做过的Huffman编码,用优先队列 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<queue> 5 6 using namespace std; 7 8 阅读全文
posted @ 2017-07-12 23:09 yijiull 阅读(118) 评论(0) 推荐(0)
摘要:上午终于考完最后一科了 接下来就要开始刷题了 前几天先快速的把之前基础的东西再巩固一下,一两个月没碰很多东西又忘了 而且,很多东西回顾起来,理解的也更深一些 【回溯】 【搜索】 n皇后问题 1 #include <cstdio> 2 #include <iostream> 3 #include <c 阅读全文
posted @ 2017-07-11 14:54 yijiull 阅读(151) 评论(0) 推荐(0)
摘要:补一些基础简单题purple7 UVA - 725 1 #include <cstdio> 2 #include <bits/stdc++.h> 3 using namespace std; 4 5 bool check(int x,int y) 6 { 7 int a[10]; 8 memset( 阅读全文
posted @ 2017-07-09 23:47 yijiull 阅读(155) 评论(0) 推荐(0)
摘要:UVA 1593 学习了重定向。。。 1 //#define LOCAL 2 #include <bits/stdc++.h> 3 using namespace std; 4 vector<string> s[1005]; 5 int len[1850]; 6 7 int main(){ 8 #i 阅读全文
posted @ 2017-06-21 20:27 yijiull 阅读(177) 评论(0) 推荐(0)
摘要:UVA-1592 1 // UVa1592 Database 2 // Rujia Liu 3 // 本程序只是为了演示STL各种用法,效率较低。实践中一般用C字符串和哈希表来实现。 4 5 #include<iostream> 6 #include<cstdio> 7 #include<vecto 阅读全文
posted @ 2017-06-17 21:15 yijiull 阅读(127) 评论(0) 推荐(0)
摘要:题目连接:http://poj.org/problem?id=3368 来自lrj。。 阅读全文
posted @ 2017-04-23 22:33 yijiull 阅读(154) 评论(0) 推荐(0)
摘要:题目连接:https://vjudge.net/problem/UVALive-3942 trie树 dp[i]=sum(dp[i+len(x)]%mod; dp[i]表示从字符i开始的字符串的分解方案方案数,x是s[i……L]的前缀 lrj: 1 // LA3942 Remember the Wo 阅读全文
posted @ 2017-04-21 19:17 yijiull 阅读(141) 评论(0) 推荐(0)
摘要:题目连接:https://vjudge.net/problem/UVALive-4329 lowbit.. 阅读全文
posted @ 2017-04-21 00:38 yijiull 阅读(134) 评论(0) 推荐(0)
摘要:题目连接:https://vjudge.net/problem/UVA-10561 抄的别人的代码,大概能理解,自己写还很费劲,再练习。。。。 参考:http://www.cnblogs.com/cyb123456/p/5815570.html 阅读全文
posted @ 2017-04-19 20:58 yijiull 阅读(153) 评论(0) 推荐(0)
摘要:题目连接:https://vjudge.net/problem/UVALive-5059 开始学SG,, 输入a较大,无法递推出所有sg值,打表找规律。。 观察结果可得: sg[x]=(x%2==0)? x/2:sg[x/2]; 阅读全文
posted @ 2017-04-19 20:25 yijiull 阅读(115) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/problem/UVALive-3905 阅读全文
posted @ 2017-04-18 17:17 yijiull 阅读(121) 评论(0) 推荐(0)
摘要:题目链接:https://vjudge.net/problem/UVALive-3902 阅读全文
posted @ 2017-04-18 13:26 yijiull 阅读(122) 评论(0) 推荐(0)
摘要:题目连接:https://vjudge.net/problem/UVALive-3971 阅读全文
posted @ 2017-04-17 23:20 yijiull 阅读(111) 评论(0) 推荐(0)