自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(89)
  • 收藏
  • 关注

原创 POJ 2186 Kosaraju算法 强连通分量

Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 30842 Accepted: 12529 DescriptionEvery cow’s dream is to become the most popular cow in the herd. In a herd of N (

2016-08-30 21:33:03 302

原创 HDU 1285 拓扑排序

确定比赛名次 Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u SubmitStatusDescription 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个

2016-08-30 21:32:31 275

原创 CodeForces 711C - Coloring Trees DP

/*http://codeforces.com/problemset/problem/711/Chttp://codeforces.com/blog/entry/46830官方题解:We compute the following array : dp[i][j][k] denoting the minimum amount of paint needed to color the first i

2016-08-30 21:32:03 412

原创 CodeForces 711B - Chris and Magic Square

//http://codeforces.com/problemset/problem/711/B//又打了一场掉分赛 这个题最后一定要判断是否小于0 不然会wa7#include <stdio.h>#include <string>#include <cstring>#include <queue>#include <algorithm>#include <functional>#i

2016-08-30 21:31:34 345

原创 CodeForces 709B - Checkpoints

题目链接: http://codeforces.com/problemset/problem/709/B//想一想搞一搞#include <stdio.h>#include <string>#include <cstring>#include <queue>#include <algorithm>#include <functional>#include <vector>#inclu

2016-08-30 21:31:15 378

原创 POJ 1273 两种基本最大流算法

Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 69903 Accepted: 27110 DescriptionEvery time it rains on Farmer John’s fields, a pond forms over Bessie’s favor

2016-08-28 13:39:42 464

原创 CodeForces 701C They Are Everywhere

//http://codeforces.com/problemset/problem/701/C//尺取法#include <stdio.h>#include <string>#include <cstring>#include <queue>#include <algorithm>#include <functional>#include <vector>#include <ioma

2016-08-27 23:02:32 468

原创 CodeForces 710 Magic Odd Square

//http://codeforces.com/problemset/problem/710/C//规律/*1代表奇数的位置 0代表偶数的位置 则有以下表示1 3 5 7 0001000 00100 0011100 010 01110 01111101 111 11111 1111111

2016-08-26 17:26:24 445

原创 CodeForces 710B Optimal Point on a Line 找中位数

//http://codeforces.com/problemset/problem/710/B//规律.找中位数即可.#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<ioman

2016-08-26 17:25:15 652

原创 CodeForces 677B Vanya and Food Processor

#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#include<math.h>#include<iostream>#include<sstream>#i

2016-08-22 20:51:25 360

原创 CodeForces 296A Yaroslav and Permutations

#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#include<math.h>#include<iostream>#include<sstream>#i

2016-08-22 20:51:10 341

原创 CodeForces 446A DZY Loves Sequences

#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#include<math.h>#include<iostream>#include<sstream>#i

2016-08-22 20:50:56 229

原创 CodeForces 707-A,B,C

A:#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#include<math.h>#include<iostream>#include<sstream>

2016-08-22 20:50:25 342

原创 POJ 3233 矩阵快速幂 等比数列

//http://www.cnblogs.com/jiangjing/archive/2013/05/28/3103336.html/*分析:求a^1+..a^n这是矩阵乘法中关于等比矩阵的求法:|A E||0 E|其中的A为m阶矩阵,E是单位矩阵,0是零矩阵。而我们要求的是:

2016-08-22 20:50:02 393

原创 省赛训练赛

B - 大还是小?#include<iostream>#include<string>#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;int main(){ cin.sync_with_stdio(false); string str1,str2; string

2016-08-22 20:49:19 251

原创 POJ 1061 青蛙的约会 拓展欧几里德

C - 青蛙的约会 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %llu SubmitStatus Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的

2016-08-19 18:44:03 272

原创 HDU 1575 Tr A 矩阵快速幂

Tr A Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input 数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(

2016-08-19 18:43:36 232

原创 POJ 3070 Fibonacci 矩阵快速幂

Fibonacci Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatus Description In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2.

2016-08-19 18:43:10 257

原创 POJ 3090 Visible Lattice Points 欧拉函数运用

Visible Lattice Points Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatus Description A lattice point (x, y) in the first quadrant (x and y are integers greater

2016-08-19 18:42:34 264

原创 POJ 2478 Farey Sequence 欧拉函数运用

Farey Sequence Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatus Description The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rati

2016-08-19 18:41:59 282

原创 CodeForces 189A Cut Ribbon

题目链接:http://codeforces.com/problemset/problem/189/A#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#inc

2016-08-18 17:19:35 373

原创 CodeForces 327A Flipping Game

题目链接:http://codeforces.com/problemset/problem/327/A#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#incl

2016-08-18 17:19:03 271

原创 HDU 5272 Dylans loves numbers 二进制

Dylans loves numbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 848 Accepted Submission(s): 467Problem Description Who is Dylans?You

2016-08-18 17:18:33 332

原创 CodeForces 115A Party 求树的高度

A. Party time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output A company has n employees numbered from 1 to n. Each employee either has no immed

2016-08-18 17:17:46 456

原创 POJ 2349 Arctic Network 最小生成树 Prim

Arctic Network Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17290 Accepted: 5509 DescriptionThe Department of National Defence (DND) wishes to connect several northern outp

2016-08-18 17:16:50 314

原创 POJ 2502 Subway 最短路 Floyd

Subway Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8733 Accepted: 2821 DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of get

2016-08-18 17:16:09 297

原创 HDU 1176 免费馅饼 dp

A Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1176 Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在

2016-08-18 17:15:20 224

原创 HDU 1875 畅通工程再续 有限制的最小生成树

畅通工程再续 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题

2016-08-17 17:12:56 278

原创 HDU 2122 Ice_cream’s world III 两种最小生成树算法

Ice_cream’s world III Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description ice_cream’s world becomes stronger and stronger; every road is built as u

2016-08-17 17:12:13 443

原创 POJ 2485 Highways 两种最小生成树算法

Highways Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatus Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public h

2016-08-17 17:11:28 322

原创 POJ 1724 ROADS 带花费的最短路

ROADS Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatus Description N cities named with numbers 1 … N are connected with one-way roads. Each road has two param

2016-08-17 17:10:40 389

原创 UVA 11090 Going in Cycle!! SPFA判断负圈

You are given a weighted directed graph with n vertices and m edges. Each cycle in the graph has a weight, which equals to sum of its edges. There are so many cycles in the graph with different weight

2016-08-17 17:09:55 394

原创 CSU 1256 天朝的单行道 最短路问题

天朝的单行道 Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %llu SubmitStatus Description 在另一个平行宇宙中,有一个神奇的国度名叫天朝。天朝一共有N个城市(标号分别为1, 2, …, N),M条道路,为了方便交通管制,天朝的M条道路都是单行道。 不久

2016-08-17 17:09:04 319

原创 HDU 1874 畅通工程续 四种最短路算法

畅通工程续 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。

2016-08-17 17:08:27 340

原创 CodeForces 702A Maximum Increase 水

A. Maximum Increase time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given array consisting of n integers. Your task is to find the

2016-08-16 17:19:22 412

原创 POJ 1286 && POJ 2409 Polya定理

POJ 1286://Polya定理#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#include<math.h>#include<iostream>#i

2016-08-16 17:18:47 291

原创 CodeForces 705B Spider Man 思维游戏题

B. Spider Man time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Peter Parker wants to play a game with Dr. Octopus. The game is about cycles

2016-08-16 17:17:49 308

原创 CodeForces 471C MUH and House of Cards

C. MUH and House of Cards time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Polar bears Menshykov and Uslada from the zoo of St. Petersburg a

2016-08-16 13:35:56 263

原创 CodeForces 471D MUH and Cube Walls KMP

D. MUH and Cube Walls time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Polar bears Menshykov and Uslada from the zoo of St. Petersburg and

2016-08-16 13:35:13 402

原创 UVA 11988 Broken Keyboard (a.k.a. Beiju Text) 字符串处理

You’re typing a long text with a broken keyboard. Well it’s not so badly broken. The only problem with the keyboard is that sometimes the “home” key or the “end” key gets automatically pressed (inter

2016-08-16 13:34:26 386

空空如也

空空如也

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

TA关注的人

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