自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

NoSwAlReCa

唯死者长眠

  • 博客(12)
  • 资源 (1)
  • 收藏
  • 关注

原创 HDU 5341 Gcd and Lcm

题意:给你一个N,让你求∑​i=1​n​​∑​j=1​n​​∑​k=1​n​​∑​l=1​n​​lcm(gcd(i,j),gcd(k,l))参考论文:贾志鹏线性筛首先,考虑子问题,求这样一个东西:∑​i=1​n​​∑​j=1​n​​[(i,j)=d](中括号是一个函数:若其中的命题为真,返回1,否则返回0)转化一下,就是求1到n/d两两之间互素的数然后再乘以d就是gcd为d的数了。

2015-08-29 10:57:53 671

原创 Andrew Stankevich Contest 38 , J-Jackpot

J-Jackpot

2015-07-29 22:46:54 990

原创 ZOJ3824 Fiber-optic Network

Fiber-optic NetworkTime Limit: 15 Seconds      Memory Limit: 262144 KBMarjar University has decided to upgrade the infrastructure of school intranet by using fiber-optic technology. There are

2015-06-15 09:41:14 472

原创 Topcoder SRM661 ColorfulLineGraphs

Problem Statement Bob is going to create a graph with N nodes. The graph will be constructed in two steps. First, Bob will take N isolated vertices, label them 1 through N and color each o

2015-06-15 00:17:26 440

原创 Aizu 1333 Beautiful Spacing

这题为某种取最值的dp提供一种解题思路,通过二分,可以使得时间复杂度从n^2降到nlogn。dp我是倒序做的,定义dp[i]表示从第i个为该行第一个单词时,最大的空格是否小于二分的答案。再定义两个指针从后往前边做边扫,再弄个前缀和判断指针之间是否有解,再来决定这个第i位的dp值的真假。#include#include#include#include#includeusing

2015-03-24 00:08:35 325

原创 SGU 477 doors

477. DoorsTime limit per test: 1.5 second(s)Memory limit: 65536 kilobytesinput: standardoutput: standardIt seems that the Museum of the Modern Technology is the only place where

2015-03-15 00:17:49 499

原创 Codeforces 489E Hiking

E. Hikingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA traveler is planning a water hike along the rive

2015-03-10 17:52:48 490

原创 低级数据结构

数据结构

2015-01-26 10:41:59 276

原创 LIS的另一种简单做法nlogn(带路径)

最长上升子序列(Longest Increasing Subsequence,LIS),在计算机科学上是指一个序列中最长的单调递增的子序列。第一种做法是离散化+树状数组/线段树,这种方法学了树状数组的人都能想得到。第二种是二分+dp。小了个常数,时间和空间要稍稍比前面的快那么一些。定义dp[i]=j,表示长度为i的上升自序列最小末端元素是j。下面给出代码,不详细解释。#incl

2015-01-23 19:36:19 763

原创 Codeforces 500E New Year Domino

E. New Year Dominotime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputCelebrating the new year, many people po

2015-01-14 14:17:36 1515

原创 Codeforces 497C Distributing Parts

C. Distributing Partstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are an assistant director in a ne

2014-12-19 10:38:30 565

原创 Topcoder SRM642 TaroCutting

Problem Statement Cat Taro has some trees in his garden. Initially, the i-th tree (0-based index) is height[i] meters tall. Each day the trees grow. For each i, the i-th tree will grow by

2014-12-17 21:01:47 381

华为codecraft复赛用例

1000个点 4000条边 100个必经点*2

2016-04-26

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除