- 博客(65)
- 收藏
- 关注
转载 hihocoder #1185 : 连通性·三 tarjan
#1185 : 连通性·三时间限制:10000ms单点时限:1000ms内存限制:256MB描述暑假到了!!小Hi和小Ho为了体验生活,来到了住在大草原的约翰家。今天一大早,约翰因为有事要出去,就拜托小Hi和小Ho忙帮放牧。约翰家一共有N个草场,每个草场有容量为W[i]的牧草,N个草场之间有M条单向的路径。小Hi和小Ho需要将牛...
2016-10-26 08:59:00 153
转载 Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) C. Ray Tracing
C. Ray TracingThere areksensors located in the rectangular room of sizen × mmeters. Thei-th sensor is located at point(xi, yi). All sensors are located at distinct points str...
2016-10-09 23:18:00 138
转载 Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) D. Dense Subsequence(贪心)
D. Dense SubsequenceYou are given a strings, consisting of lowercase English letters, and the integerm.One should choose some symbols from the given string so that any contiguous subs...
2016-10-09 13:33:00 127
转载 CodeForces - 580D Kefa and Dishes
D. Kefa and Dishestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhen Kefa came to the restaurant ...
2016-10-08 12:42:00 106
转载 CodeForces 723E One-Way Reform
One-Way ReformDescriptionThere arencities andmtwo-way roads in Berland, each road connects two cities. It is known that there is no more than one road connecting each pair of citie...
2016-10-07 17:02:00 88
转载 Codeforces Round #375 (Div. 2) C. Polycarp at the Radio
C. Polycarp at the Radiotime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is a music editor at the rad...
2016-10-03 23:03:00 103
转载 Codeforces Round #375 (Div. 2) D.Lakes in Berland (dfs + 贪心)
D. Lakes in Berlandtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe map of Berland is a rectangle ...
2016-10-03 23:00:00 121
转载 hdu 5898 odd-even number (数位dp)
odd-even numberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 454Accepted Submission(s): 245Problem DescriptionFor a number,if t...
2016-09-20 17:01:00 106
转载 Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum (树状数组 + 离线查询)
D. Mishka and Interesting sumLittle Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integersa1, a2, ..., ano...
2016-08-13 10:20:00 80
转载 hdu 3333 Turing Tree(树状数组 + 离线查询)
Turing TreeDescriptionAfter inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have the solution. As well, wily 3xian ...
2016-08-13 10:09:00 160
转载 hdu 5831 Rikka with Parenthesis II
Rikka with Parenthesis IIProblem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:C...
2016-08-13 09:53:00 86
转载 hdu 5821 Ball (贪心)
BallDescriptionZZX has a sequence of boxes numbered1,2,...,n. Each box can contain at most one ball.You are given the initial configuration of the balls. For1 \leq i \leq n, if thei-t...
2016-08-13 09:47:00 90
转载 LightOJ 1274 Beating the Dataset
题意是一个人做ACM题,这道题的数据的字节数和提问数已经给出,答案只有YES或NO。那个人做不来这道题,只能蒙,一开始一定蒙YES,数据会告诉你蒙对了没有,之后蒙的都是之前的正确答案,求蒙错的数据组数的期望数量。因为字节数和提问数已经给出,所以立方程组可以算出来YES和NO的个数,设为X,Y。题目可以抽象为某个01串全排列该位置与前一个位置不同或者第一位为0的数量期望。每个1贡献...
2016-08-07 17:04:00 118
转载 LightOJ 1248 Dice (III)
题意是给出一个有n面的色子,求要看见所有面所投掷的期望次数。设F(i)为看见i面的期望值。F(i) = F(i - 1) * ((i - 1) / n) + 1 + F(i) * ((n - (i - 1)) / n)。解得F(i) = F(i - 1) + (n / (i - 1))。#include <bits/stdc++.h>using nam...
2016-08-07 16:43:00 95
转载 LightOJ 1284 Lights inside 3D Grid
题意是给出一个由边长为1的立方体组成的长方体,每个小立方体中有一盏灯,每次操作随机选择两个立方体,以这两个立方体作为对角线顶点确定一个长方体,长方体中所有块的灯自己取反,就是亮着的关上,暗着的打开,求这样操作k次以后亮着的灯数的期望值。设F(i)为操作i次以后对某灯奇数次取反的概率,G(i)为偶数次,奇数次取反以后灯是亮着的,贡献的期望值显然是1,所以求出F(k)就可以了。设p为...
2016-08-07 16:17:00 68
转载 hdu 5806 NanoApe Loves Sequence Ⅱ (尺取法)
NanoApe Loves Sequence ⅡTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 500Accepted Submission(s): 242Problem DescriptionNanoAp...
2016-08-07 10:54:00 99
转载 hdu 5795 A Simple Nim (sg函数)
A Simple NimTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 33Accepted Submission(s): 18Problem DescriptionTwo players take turns...
2016-08-04 17:46:00 85
转载 hdu 5787 K-wolf Number (数位dp)
K-wolf NumberTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 737Accepted Submission(s): 265Problem DescriptionAlice thinks an int...
2016-08-04 10:08:00 182
转载 hdu 5792 World is Exploding(离散化 + 树状数组 + 容斥)
World is ExplodingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 540Accepted Submission(s): 249Problem DescriptionGiven a sequen...
2016-08-03 15:12:00 91
转载 hdu 5791 Two
TwoTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 21Accepted Submission(s): 10Problem DescriptionAlice gets two sequences A and ...
2016-08-02 17:23:00 72
转载 hdu 5775 Bubble Sort (树状数组)
Bubble SortTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 591Accepted Submission(s): 359Problem DescriptionP is a permutation of...
2016-07-29 18:56:00 96
转载 UVALive 4329 Ping pong (树状数组)
白书上的例题。花了很多时间在找bug上,刚学树状数组,这道题add操作时要注意上限不是n。#include <bits/stdc++.h>using namespace std;#define ll long longconst ll maxn = 1e5 + 10;ll C[maxn];ll n;inline ll lowbit(l...
2016-07-29 16:23:00 100
转载 hdu 5754 Life Winner Bo(博弈)
Life Winner BoTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 454Accepted Submission(s): 150Problem DescriptionBo is a "Life Wi...
2016-07-26 21:10:00 102
转载 UVA 11426 GCD - Extreme (II)(数论)
题目是给出N,求G的值。可以转化为S(n) = f(1) + f(2) + f(3) + ... + f(n)。其中f(n) = gcd(1, n) + gcd(2, n) + ... + gcd(n, n)。随便写一个n = 5 的情况。得到gcd(1, 5) = 1, gcd(2, 5) = 1, gcd(3, 5) = 1, gcd(4, 5) = 1, gcd(5, 5)...
2016-07-25 20:29:00 115
转载 UVALive 3516 Exploring Pyramids (区间dp)
#include<cstdio>#include<cstring>#include<algorithm>#include<iostream>using namespace std;#define ll long longconst int maxn = 310;const ll mod = 1e9;cha...
2016-07-24 16:28:00 76
转载 uva 11361 - Investigating Div-Sum Property(数位dp)
简单的数位dp题,题意是求区间内的一种数的个数,这种数的本身和各个位置上的数之和能除尽给定的k(k <= 10000)。dp[20][10000][100]也是可以过的,但是因为各位置上的数之和不会超过100。所以k>=100的情况其实可以直接返回0。所以dp[20][110][110]足够了(因为懒的想,所以通常数组开大点...)。#include<c...
2016-07-24 10:57:00 90
转载 UVA 11375 Matches
白书上的例题,实际上就是一个背包问题,不过要注意高精度问题,上java就没问题了。import java.io.*;import java.math.*;import java.util.*;public class Main { public static void main(String args[]) { Scanner in =...
2016-07-24 10:51:00 85
转载 hihoCoder - #1173 : 博弈游戏·Nim游戏·三
#1173 : 博弈游戏·Nim游戏·三时间限制:10000ms单点时限:1000ms内存限制:256MB描述在这一次游戏中Alice和Bob决定在原来的Nim游戏上增加一条规则:每一次行动时,不仅可以选择一堆取走任意数量的石子(至少取1颗,至多取出这一堆剩下的所有石子),还可以选择将一堆石子分成两堆石子,但并不取走石子。比如说有一堆石子为...
2016-07-23 14:50:00 95
转载 zstu-2437 English word
2437: English wordTime Limit:1 SecMemory Limit:64 MBSubmit:2580Solved:1174DescriptionYou still are worried about reading acm English problem, let me tell you a kind of very good m...
2016-07-23 10:28:00 106
转载 HDU 1524 - A Chess Game(sg函数 + dfs)
A Chess GameProblem DescriptionLet's design a new chess game. There are N positions to hold M chesses in this game. Multiple chesses can be located in the same position. The positions are ...
2016-07-22 21:17:00 89
转载 UVA 10561 Treblecross
白书上的例题,用长度作为状态推算sg值。代码写的有点挫。#include<complex>#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<vector>using namesp...
2016-07-22 21:13:00 105
转载 POJ 2413 How many Fibs? (java大数)
How many Fibs?DescriptionRecall the definition of the Fibonacci numbers:f1 := 1 f2 := 2 fn := fn-1 + fn-2 (n>=3) Given two numbers a and b, calculate how many Fibon...
2016-07-21 10:43:00 108
转载 hdu 5724 Chess(博弈)
ChessProblem DescriptionAlice and Bob are playing a special chess game on an n × 20 chessboard. There are several chesses on the chessboard. They can move one chess in one turn. If there ar...
2016-07-21 09:44:00 95
转载 UVALive 5059 Playing With Stones(求sg函数)
题意和nim游戏差不多,就是取石子的时候最多只能拿原来的一半,比如一堆5个石子最多拿两个。先用打表的方式看出前面一部分的sg值,然后找规律来做。打表求sg值的程序才是最重要的。#include<cstdio>#include<cstring>#define ll long longint main() { int vis[50...
2016-07-21 09:41:00 86
转载 UVA 11859 Division Game
白书的例题,做法是记好每个数的质因数的个数,然后就可以转化为简单的nim游戏。#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;const int maxn = 1010;int ...
2016-07-21 09:33:00 102
转载 [Neerc2015] Binary vs Decimal(java大数 + 找规律)
题目大意是有一种数,它的二进制形式的后几位刚好是它自己。比如100的二进制形式是1100100,1100100的末尾三个数刚好是100,就符合条件,求第n个符合条件的数。序列在oeisA181891。做法的话先是发现这样的数的后缀一定在之前出现过,然后可以bfs一下。更简单的做法是发现一个规律,就是符合条件的数的二进制形式比如100的1100100,如果把1100100...
2016-07-19 10:41:00 306
转载 hdu 5719 Arrange
ArrangeTime Limit: 8000/4000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 674Accepted Submission(s): 236Problem DescriptionAccidentally, Cupid, go...
2016-07-18 20:42:00 92
转载 hdu 5050 - Divided Land(java 大数)
Divided LandProblem DescriptionIt’s time to fight the local despots and redistribute the land. There is a rectangular piece of land granted from the government, whose length and width are ...
2016-07-17 14:56:00 97
转载 Team Contests - Warmup Problem F
Problem FProblem DescriptionThere are n points in a geometrical plane. If there exists a rectangle whose four vertices are among those points and every edge of the rectangle has exactly m ...
2016-07-17 09:37:00 78
转载 Team Contests - Warmup Problem C
Problem CProblem DescriptionDefinite an operation work(Q,x)as sequenceQfrom the first number on,keep the topxnumbers and delete followedxnumbers, keep the nextxnumbers and delete fol...
2016-07-17 09:26:00 97
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人