自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

九野的博客

新窝:cygmasot.com

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

原创 HDU 4362 Dragon Ball 线段树

#include #include #include #include #include #include #include #include #include #include using namespace std;#define lson l, mid, rt << 1#define rson mid + 1, r, rt << 1 | 1typedef __int

2014-09-28 19:05:28 1264

原创 HDU 4360 As long as Binbin loves Sangsang spfa

题意:给定n个点m条边的无向图每次必须沿着LOVE走,到终点时必须是完整的LOVE,且至少走出一个LOVE,问这样情况下最短路是多少,在一样短情况下最多的LOVE个数是多少。有自环。#include #include #include #include #include #include using namespace std;typedef __int64 ll

2014-09-28 19:04:34 1252

原创 UVALive 6181 Mystery (水

题目链接:点击打开链接

2014-09-28 19:01:08 998

原创 UVALive 6179 Windmill Animation 规律题

题目链接:点击打开链接#include#include#include#include#include#includeusing namespace std;const double Pi = acos(-1.0);typedef long long ll;const int N = 100;int n, k, now, pre;struct node{ dou

2014-09-28 18:57:59 1122

原创 HDU 5052 Yaoge’s maximum profit 裸树链剖分 2014 ACM/ICPC Asia Regional Shanghai Online

题意:给定n个点的带点权树。下面n行给出每个点点权表示每个点买卖鸡腿的价格下面n-1行给出树边下面Q个操作Q行u, v, val从u走到v,过程中可以买一个鸡腿,然后到后面卖掉,输出max(0, 最大的收益)然后给[u,v]路径上点点权+=val思路:树链剖分裸题屌丝题解:点击打开链接#pragma comment(linker, "/STA

2014-09-28 16:57:45 1673

原创 UVALive 6176 Faulhaber's Triangle C++大数模拟

题目链接:点击打开链接

2014-09-28 12:25:37 1288

原创 UVALive 6177 The King's Ups and Downs 规律题

题目链接:点击打开链接

2014-09-28 12:24:06 1322

原创 0基础同学ACM入门篇

只针对没有基础的同学,不喜勿喷。1、首先要有C语言技能 (随便找本C的教程)2、li

2014-09-28 12:22:52 13006 3

原创 UVALive 6174 Pen Counts 规律

题目链接:点击打开链接打一下表就能找到规律了。

2014-09-27 18:50:53 1244

原创 UVALive 6175 Maximum Random Walk 期望+概率dp

题目链接:点击打开链接

2014-09-27 18:50:32 1348

原创 UVALive 6173 Casting

题目链接:点击打开链接#include #include #include using namespace std;const int N = 10000005;char s[N];int main() { int T, cas, k; scanf("%d", &T); while(T-- > 0) { scanf("%d %d %s", &cas, &k, s);

2014-09-27 18:49:43 1042

原创 UVALive 6172 Hailstone HOTPO (水

题目链接:点击打开链接

2014-09-27 18:48:50 1135

原创 URAL 1648 Yachts

题目链接:点击打开链接#include#include#include#include#includeusing namespace std;typedef long long ll;const int N = 20000+10;ll a[N];int main() { int n; ll d, sum, ans; while (~scanf("%

2014-09-27 18:43:47 1014

原创 URAL 1647 Divide an Island!

题目链接:点击打开链接#include #include #include #include #include #include using namespace std;const long double eps = 1e-13;#define y1 Y1long double area(long double x1, long double y1, long double

2014-09-27 18:43:07 971

原创 URAL 1645 Ski Race

题目链接:点击打开链接#include#include#include#include#includeusing namespace std;const int N = 2000+10;int a[N], b[N];int main() { int n; while (~scanf("%d", &n)) { for (int i = 1;

2014-09-27 18:41:41 1455

原创 URAL 1646 Godzilla Strikes Back!

题目链接:点击打开链接#include#include#include#include#includeusing namespace std;typedef long long ll;const int mod = 1000000000 + 7;const int N = 100+10;struct node { char s1[N], s2[N]; int

2014-09-27 18:40:43 1190

原创 URAL 1644 A Whole Lot of Walnuts (水

题目链接:点击打开链接

2014-09-27 18:39:11 1529

原创 URAL 1643 Attack of the Dark Fortress BFS

题目链接:点击打开链接把

2014-09-27 18:38:51 1259

原创 URAL 1642 1D Maze

题目链接:点击打开链接#include int main() { int n, s, x; while(~scanf("%d%d", &n, &s)) { int l = - 1000, r = 1000; for(int i = 0; i < n; i ++) { scanf("%d", &x); if(x l) l = x; if(x > 0 && x <

2014-09-27 18:33:38 1030

原创 URAL 1641 Duties

题目链接:点击打开链接

2014-09-27 18:32:25 1098

原创 URAL 1640 Circle of Winter

题目链接:点击打开链接

2014-09-27 18:28:40 899

原创 URAL 1639 Chocolate 2 简单博弈

题目链接:点击打开链接

2014-09-27 18:26:27 1125

原创 HDU 5046 Airport DLX 2014 ACM/ICPC Asia Regional Shanghai Online

hdu的原题。DLX:#include #include #include #include #include typedef long long ll;const int N = 600 + 10;const ll INF = (ll)(1e15);const int Max_N = 333333;typedef std::pair pii;struct Edge {

2014-09-27 18:13:21 1836 2

原创 HDU Tree LCA 2014 ACM/ICPC Asia Regional Shanghai Online

题意:给定n个点的树,m个操作树有点权和边权下面n-1行给出树边下面m行操作 :● ADD1 u v k: for nodes on the path from u to v, the value of these nodes increase by k.● ADD2 u v k: for edges on the path from u to v, the value

2014-09-27 18:11:02 1553

原创 HDU 5047 Sawtooth 规律+ C++大数模拟 2014 ACM/ICPC Asia Regional Shanghai Online

题意:用x个大M 可以把平面分成至多几块。就是折线切割平面的加强版。一个简单的递推式 : F(x+1) = 16x+1+F(x) 然后转成通项公式,然后C++ 位压大数模拟#include #include #include #include using namespace std;typedef long long ll;const int mod = 1

2014-09-27 18:05:28 1781

原创 HDU 5045 Contest 期望+状压dp 2014 ACM/ICPC Asia Regional Shanghai Online

题意:给定n个人 m个题目下面n*m的矩阵表示每个人解出每道题的概率我们可以得到一个模长为m的集合{1,2,3,1,2}代表每道题是谁解出的。有众多集合,且获得这个集合有一个期望,求期望最大的那个集合 ( 的期望值是多少)一个限制: 对于集合 {1,1,2,3,1} 这样是不合法的(即从[1,n]题必须是1-n的排列,然后[n+1, 2n]题也是一个排列)然后状

2014-09-27 18:01:40 1541

原创 HDU 5050 Divided Land 2014 ACM/ICPC Asia Regional Shanghai Online

求2个二进制数的GCDjava大数+位压import java.math.*;import java.util.*;import java.io.*;public class Main { public BigInteger GCD(BigInteger x, BigInteger y) { if(x.compareTo(y) < 0) {

2014-09-27 17:54:09 1580

原创 HDU 5053 the Sum of Cube 2014 ACM/ICPC Asia Regional Shanghai Online

#include #include #include #include using namespace std;typedef long long ll;int main() { int T; while(~scanf("%d", &T)) { int cas = 0; ll a, b; while(T-- > 0) {

2014-09-27 17:50:41 944

原创 Codeforces 467D Fedor and Essay bfs

题目链接:题意:给定n个单词。下面有m个替换方式,左边的单词能变成右边的单词。替换任意次后使得最后字母r个数最少,在r最少的情况下单词总长度最短输出字母r的个数和单词长度。思路:我们认为一个单词有2个参数,则m个替换规则可以当成m个点的有向图。则某些单词的替换终点会确定,所以反向建图bfs一下。为了防止某些点被反复更新,所以把每个点的权值都放到栈里排个序然后bf

2014-09-19 09:07:03 1748

原创 UVALive 2531 The K-League 网络流+建图

题目链接:点击打开链接白书例题P369

2014-09-18 23:18:49 1136

原创 SGU 482 Impudent Thief dp

题目链接:点击打开链接题意:给定

2014-09-18 16:59:01 1109

原创 SGU 481 Hero of Our Time java大数+规律

题目链接:点击打开链接import java.math.*;import java.util.*;import java.io.*;public class Solution { public void work() { int n; while (cin.hasNext()) { n = cin.nextInt(); BigInteger tmp =

2014-09-18 16:54:13 1238

原创 SGU 483 Jealous Cucumber STL(水

题目链接:点击打开链接#include #include #include #include #include #include #include using namespace std;typedef long long ll;vector G;ll n, h;int main(){ ll i, j, jia; while(cin>>n>

2014-09-18 16:53:33 1177

原创 SGU 484 Kola 模拟题(水

题目链接:点击打开链接#include #include #include #include using namespace std;const int N = 105;char a[N][N];int main() { int n, m; while(~scanf("%d%d", &n, &m)) { int si = -1, sj = -

2014-09-18 16:52:42 1064

原创 SGU 479 Funny Feature spfa

题目链接:#include #include #include using namespace std;const int N = 205;const int dx[] = {-1, 1, 0, 0};const int dy[] = {0, 0, 1, -1};int a[N][N], x[N*N], y[N*N];bool vis[N][N];queue

2014-09-18 16:52:33 985

原创 SGU 476 Coach's Trouble 大数模拟

题目链接:点击打开链接#include #include #include using namespace std;typedef long long ll;const int len = 1000000000;const int L = 700;const int N = 3001;struct big { int a[L]; void clear() {

2014-09-18 16:50:23 1070

原创 SGU 478 Excursion 水

题目链接:点击打开链接#include #include #include #include #include #include #include using namespace std;#define N 4010vector ansi, ansj;int main() { int n, m; while(~scanf("%d%d", &n, &m)

2014-09-18 16:49:06 1069

原创 URAL 1737 Mnemonics and Palindromes 3 构造

题目链接:点击打开链接题意:给定n#include #include #include using namespace std;char a[][4] = {"abc", "acb", "bac", "bca", "cab", "cba"};int main() { int n; while (~scanf("%d", &n)) { if(n * 6

2014-09-18 16:39:28 1308

原创 URAL 1741 Communication Fiend dp

题目链接:点击打开链接#include #include #include typedef long long ll;const ll Inf = (ll)(1e15);const int N = 10000 + 10;const int E = 10000 + 10;struct Edge { int v, cos, f, nex; Edge() { } Edg

2014-09-18 16:39:06 929

原创 URAL 1736 Chinese Hockey 网络流+建图

题目链接:点击打开链接题意:给定n个队伍的得分情况,输出任意一个可行解。n个队伍任意2个队伍 a, b 间有且仅有一场比赛。比赛结果分4种:1、a +3, b +02、a +0, b +33、a +2, b +14、a +1, b +2我们发现其实每种结果2个队伍得分和总是3 且4种情况就是3的所有拆分和的形式。所以我们把任意两个队伍组合成一个点。把n个

2014-09-18 16:36:30 1215

九野的模版3.15.10.pdf

http://blog.csdn.net/acmmmm

2015-12-19

空空如也

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

TA关注的人

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