08 2018 档案

摘要:功能要求: 具体类: Decrypt 测试类,用来启动破解和日志线程 DecryptThread 破解线程类,用来生成测试的字符串,并暴力破解 LogThread 日志类,将输出每次生成的字符串结果集,并且设置为守护线程,等DecryptThread线程运行结束,也将停止运行 package dec 阅读全文
posted @ 2018-08-31 18:57 Draymonder 阅读(1783) 评论(0) 推荐(0)
摘要:代码 package thread; public class TestChongNeng { public static void main(String[] args) { Thread t1 = new Thread() { public void run() { while (true) { 阅读全文
posted @ 2018-08-31 17:01 Draymonder 阅读(3843) 评论(0) 推荐(0)
摘要:学过了操作系统,突然不知道多线程有什么用了。 看了一下百度,发现多线程,可以提升系统利用率 在系统进行IO操作的时候,CPU可以处理一些其他的东西,等IO读取到内存后,CPU再处理之前的操作。 总之可以在用户层面,可以提升效率,不过,有时候多线程设计不当,调试也很麻烦 今天尝试一下简单的查找文件后缀 阅读全文
posted @ 2018-08-31 12:02 Draymonder 阅读(1614) 评论(0) 推荐(0)
摘要:1201 整数划分 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注 将N分为若干个不同整数的和,有多少种不同的划分方式,例如:n = 6,{6} {1,5} {2,4} {1,2,3},共4种。由于数据较大,输出Mod 10^9 + 7的结果即可。 I 阅读全文
posted @ 2018-08-30 13:59 Draymonder 阅读(218) 评论(0) 推荐(0)
摘要:1020 逆序排列 基准时间限制:2 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 如2 4 3 1中,2 1,4 3,4 阅读全文
posted @ 2018-08-29 19:14 Draymonder 阅读(279) 评论(0) 推荐(0)
摘要:#1636 : Pangu and Stones 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 In Chinese mythology, Pangu is the first living being and the creator of the sky and th 阅读全文
posted @ 2018-08-29 15:03 Draymonder 阅读(766) 评论(0) 推荐(1)
摘要:1202 子序列个数 题目来源: 福州大学 OJ 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注 子序列的定义:对于一个序列a=a[1],a[2],......a[n]。则非空序列a'=a[p1],a[p2]......a[pm]为a的一个子序列,其中 阅读全文
posted @ 2018-08-27 17:19 Draymonder 阅读(241) 评论(0) 推荐(0)
摘要:51nod 1134 最长递增子序列 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define rep(i,l,r) for (int i=l; i<=r; i++) typedef long 阅读全文
posted @ 2018-08-27 14:38 Draymonder 阅读(160) 评论(0) 推荐(0)
摘要:1021 石子归并 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 取消关注 N堆石子摆成一条线。现要将石子有次序地合并成一堆。规定每次只能选相邻的2堆石子合并成新的一堆,并将新的一堆石子数记为该次合并的代价。计算将N堆石子合并成一堆的最小代价。 例如: 1 阅读全文
posted @ 2018-08-27 11:11 Draymonder 阅读(201) 评论(0) 推荐(0)
摘要:Neko's loop Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 356 Accepted Submission(s): 56 Proble 阅读全文
posted @ 2018-08-26 13:07 Draymonder 阅读(730) 评论(0) 推荐(1)
摘要:题目链接: https://www.cnblogs.com/Draymonder/p/9536681.html 同上一篇文章,只是 需要记录最大值的开始和结束的位置 #include <iostream> #include <string.h> #include <cmath> using name 阅读全文
posted @ 2018-08-26 12:57 Draymonder 阅读(176) 评论(0) 推荐(0)
摘要:题目链接: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1050 这个呢,这个题之前 求一遍最大值 然后求一遍最小值 最后结果 res = max( MAX, SUM - MIN ); 但是 这种题如果 要求 变成 最长 阅读全文
posted @ 2018-08-26 11:28 Draymonder 阅读(295) 评论(0) 推荐(0)
摘要:Taotao Picks Apples Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2506 Accepted Submission(s) 阅读全文
posted @ 2018-08-25 22:01 Draymonder 阅读(266) 评论(0) 推荐(1)
摘要:题目链接:https://www.nowcoder.com/acm/contest/160/D 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 给出一个长度为n的整数序列a1,a2,..., 阅读全文
posted @ 2018-08-24 23:22 Draymonder 阅读(281) 评论(0) 推荐(0)
摘要:****************************************************************************************** 动态规划 专题训练 ************************************************* 阅读全文
posted @ 2018-08-24 15:48 Draymonder 阅读(431) 评论(0) 推荐(0)
摘要:Attack on TitansTime Limit: 2 Seconds Memory Limit: 65536 KB Over centuries ago, mankind faced a new enemy, the Titans. The difference of power betwee 阅读全文
posted @ 2018-08-24 15:25 Draymonder 阅读(223) 评论(0) 推荐(0)
摘要:Division Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 999999/400000 K (Java/Others)Total Submission(s): 5883 Accepted Submission(s): 2337 Pro 阅读全文
posted @ 2018-08-23 19:08 Draymonder 阅读(265) 评论(0) 推荐(0)
摘要:Print Article Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 17335 Accepted Submission(s): 5310 阅读全文
posted @ 2018-08-23 18:56 Draymonder 阅读(178) 评论(0) 推荐(0)
摘要:Problem E. TeaTree Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 722 Accepted Submission(s): 阅读全文
posted @ 2018-08-23 15:51 Draymonder 阅读(313) 评论(0) 推荐(0)
摘要:B. Working out time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Summer is coming! It's ti 阅读全文
posted @ 2018-08-20 17:33 Draymonder 阅读(258) 评论(0) 推荐(0)
摘要:题目大意: 给你一些单词,和一个字符串,问你这个字符串中含有多少个上面的单词。 解题分析: 这是多模匹配问题,如果用KMP的话,对每一个单词,都跑一遍KMP,那么当单词数量非常多的时候,耗时会非常多,所以这里用到了AC自动机,这是一种类似于Trie树的数据结构,但是同时,它也用到了KMP算法中 ne 阅读全文
posted @ 2018-08-19 23:52 Draymonder 阅读(207) 评论(0) 推荐(0)
摘要:Tree Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=1741 Description Give a tree with n vertices,each edge has a length(positi 阅读全文
posted @ 2018-08-18 18:13 Draymonder 阅读(143) 评论(0) 推荐(0)
摘要:题目让O(1)预处理出来 类三角形边界及内部的和 根据这个图 就是一个大矩形-左边的绿色的矩形 - 蓝色的大三角形 + 右上角突出的蓝色的小三角形 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define r 阅读全文
posted @ 2018-08-18 16:05 Draymonder 阅读(305) 评论(0) 推荐(0)
摘要:小zc现在有三个字符串,他想知道前两个字符串能不能生成第三个字符串,生成规则如下:第一个串的每个字符都可以往第二个串的任意位置插入(包括首尾位置),但必须保证来源于第一个串中的字符在生成后的串中的相对顺序不可以改变。 举个例子: String A: cu String B: mt 那么,A和B可以生 阅读全文
posted @ 2018-08-18 11:22 Draymonder 阅读(280) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; const int N = 2000000+10; struct node{ node *next[26]; int num; bool ok; node() { for(int i=0;i<26;i++) { 阅读全文
posted @ 2018-08-18 11:19 Draymonder 阅读(202) 评论(0) 推荐(0)
摘要:首先下载mac版本的 sublimetext3 下载链接: https://www.sublimetext.com/3 接着可以按照其他博客的方法来安装一些插件,便于我们的工作和学习 安装sublime text 3 插件 1.安装 Package Control组件: 按 control+` (键 阅读全文
posted @ 2018-08-16 16:35 Draymonder 阅读(1805) 评论(0) 推荐(0)
摘要:重点补充一下 dp 和 字符串的营养,其他的一些 交给队友好了 下面是很棒的一些视频讲解 电子科大ACM视频 https://space.bilibili.com/7711573/#/video 浙师大ACM视频 https://space.bilibili.com/8198319/#/video 阅读全文
posted @ 2018-08-14 23:06 Draymonder 阅读(142) 评论(0) 推荐(0)
摘要:直接Copy好了 // 欧拉函数 phi(n) = n * π(1-1/p) ,p为n的质因数 // phi(m*n) = phi(m) * phi(n),nm互质 // phi(i*p) = p*phi(i) ,当i mod p == 0 const int N = 3e6+5; bool vis 阅读全文
posted @ 2018-08-14 22:31 Draymonder 阅读(163) 评论(0) 推荐(0)
摘要:根据公式就是 对每次C(n,m) = C(n%p,m%p) * C(n/p,m/p); ll pow(ll x,ll n) { ll res = 1; x%=mod; while (n) { if(n&1) res = res*x%mod; x = x*x %mod; n >>=1; } retur 阅读全文
posted @ 2018-08-14 22:29 Draymonder 阅读(1076) 评论(0) 推荐(1)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1348 给一个半径和n个点 求圆的周长 + n个点的凸包的周长 #include<bits/stdc++.h> using namespace std; const int maxn = 1005; co 阅读全文
posted @ 2018-08-14 22:23 Draymonder 阅读(140) 评论(0) 推荐(0)
摘要:poj 3468 给出N个数,Q次操作。有两种操作类型 1. 在区间 [L,R] 加上一个整数v 2. 区间[L,R]查询。 区间查询 区间更新 #include<iostream> #include<string.h> using namespace std; #define ls rt<<1 # 阅读全文
posted @ 2018-08-14 21:47 Draymonder 阅读(234) 评论(0) 推荐(0)