- 博客(84)
- 资源 (3)
- 收藏
- 关注
原创 hdoj 5512 Pagodas 【gcd 思维】
PagodasTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 24 Accepted Submission(s): 22Problem Descriptionn pagodas were stand
2015-10-31 18:27:44 532
原创 hdoj 5510 Bazinga 【不要想太多。。。 strstr】
BazingaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 72 Accepted Submission(s): 28Problem DescriptionLadies and gentlemen,
2015-10-31 18:27:13 738
原创 lightoj 1071 - Baker Vai 【最大费用最大流】
1071 - Baker VaiPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBAll of you must have heard the name of Baker Vai. Yes, he rides a
2015-10-31 18:26:31 723
原创 lightoj 1155 - Power Transmission 【多源多汇 拆点网络流】
1155 - Power TransmissionPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBDESA is taking a new project to transfer power. Power i
2015-10-29 21:30:38 808
原创 hdoj 2669 Romantic 【扩展欧几里得 求解最小非负解】
RomanticTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3974 Accepted Submission(s): 1645Problem DescriptionThe Sky is Sprite
2015-10-28 21:35:10 649
原创 2015 CCPC L题 【水题】
题目链接 点我题意:有n种药串在一起,医生只记得放的顺序。现在让你找到最短的链 使得医生在黑暗中也可以找到想要的药。思路:对称,答案 为 2*n-1。AC代码:#include #include #include #include #include #include #include #include #define lson o<<
2015-10-28 19:16:01 674
原创 2015 CCPC H题 【DFS】
题目链接 点我题意:数独,用1 - 4补全4*4的格子, 格子里面的字符*代表空。思路:DFS暴力就可以了。AC代码:#include #include #include #include #include #include #include #include #define lson o<<1|1, l, mid#define r
2015-10-28 19:15:41 556 1
原创 2015 CCPC G题 【DFS 暴力】
题目链接 点我题意:给定一个9*9的围棋局面,要求你先除去对方的死棋,再除去己方的死棋。对于当前局面,问能否通过一手棋吃掉对面至少一个子。思路:对于每个.字符,先填上字符#include #include #include #include #include #include #include #include #define lson o<<1
2015-10-28 19:15:28 443
原创 2015 CCPC D题 【0-1背包变形】
题目链接 点我题意:有n(思路:我们可以任意选择k (k 这样用dp[i][j][k]表示放第i根金条 背包剩余容量为j的情况下有k根金条砍半放置 获得的最大价值。状态转移方程 dp[i][j][k] = min(dp[i-1][j][k], dp[i-1][j-len[i]][k], dp[i-1][j-len[i]/2][k-1])。下面直接0-1背包就可以
2015-10-28 19:15:11 625
原创 2015 CCPC C题 【树状数组优化dp】
题目链接 点我题意:给出n个数组成的序列,让你按顺序任选m个数,能够得到的上升子序列个数。思路:较简单的dp,状态转移方程也好想。用dp[i][j]表示以a[i]结尾的长度为j的上升子序列个数。状态转移方程dp[i][j] = sigma(dp[k][j-1]) 其中(1 主要是O(n^3)的时间复杂度过高,需要优化。我们考虑a[k] 例如:4
2015-10-28 19:14:37 674
原创 2015 CCPC A题 【水题】
题目链接 点我题意:给你两个二维矩阵A和B,问你矩阵A能否通过矩阵B旋转得到。思路:直接暴力。AC代码:#include #include #include #include #include #include #include #include #define lson o<<1|1, l, mid#define rson o<<1, mid+1
2015-10-28 19:14:03 451
原创 hdoj 2227 Find the nondecreasing subsequences 【树状数组优化dp】
Find the nondecreasing subsequencesTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1711 Accepted Submission(s): 625Problem Descr
2015-10-27 21:55:42 444
原创 hdoj 5446 Unknown Treasure 【lucas + CRT】
Unknown TreasureTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1820 Accepted Submission(s): 671Problem DescriptionOn the w
2015-10-27 21:55:28 488
原创 hdoj 4349 Xiao Ming's Hope 【lucas 推广】
Xiao Ming's HopeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1880 Accepted Submission(s): 1252Problem DescriptionXiao Ming
2015-10-26 21:30:04 408
原创 hdoj 1576 A/B 【扩展欧几里得 求乘法逆元】
A/BTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3346 Accepted Submission(s): 2540Problem Description要求(A/B)%9973,但由于A很大,我们
2015-10-26 18:24:46 670
原创 hdoj 3037 Saving Beans 【Lucas】
Saving BeansTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3409 Accepted Submission(s): 1305Problem DescriptionAlthough wint
2015-10-26 18:24:25 393
原创 Lucas 定理 大组合数取余 【记录】
FormulationFor non-negative integers m and n and a prime p, the following congruence relation holds:whereandare the base p expansions of m and n respectively.Lucas 定理:将m写出p
2015-10-26 17:48:25 705
原创 lightoj 1356 - Prime Independence 【质因子分解 奇偶构图 + HK优化】
1356 - Prime IndependencePDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 32 MBA set of integers is called prime independent if none of
2015-10-25 21:32:50 1436
原创 poj 2115 C Looooops 【扩展欧几里得】
C LooooopsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20702 Accepted: 5596DescriptionA Compiler Mystery: We are given a C-language style for loop
2015-10-25 15:46:23 1539
原创 lightoj 1100 - Again Array Queries 【思维题】
1100 - Again Array QueriesPDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 32 MBGiven an array with n integers, and you are given two in
2015-10-25 14:27:40 584
原创 lightoj 1258 - Making Huge Palindromes 【Manacher】
1258 - Making Huge PalindromesPDF (English)StatisticsForumTime Limit: 1 second(s)Memory Limit: 32 MBA string is said to be a palindrome if it remains sa
2015-10-25 13:20:57 581
原创 lightoj 1171 - Knights in Chessboard (II) 【奇偶图 最小割】
1171 - Knights in Chessboard (II)PDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 32 MBGiven an m x n chessboard where some of the cells
2015-10-25 13:20:38 724
原创 lightoj 1005 - Rooks 【组合数学】
1005 - RooksPDF (English)StatisticsForumTime Limit: 1 second(s)Memory Limit: 32 MBA rook is a piece used in the game of chess which is played on a board
2015-10-25 13:20:16 435
原创 lightoj 1148 - Mad Counting 【一个模拟题 因为看错题目 WA到死。。。】
1148 - Mad CountingPDF (English)StatisticsForumTime Limit: 0.5 second(s)Memory Limit: 32 MBMob was hijacked by the mayor of the Town "TruthTown". Mayor
2015-10-24 18:17:12 534
原创 poj 1410 Intersection 【判断线段 与矩形面是否相交】
IntersectionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13094 Accepted: 3409DescriptionYou are to write a program that has to decide whether a giv
2015-10-24 18:11:48 779
原创 lightoj 1154 - Penguins 【拆点建图后枚举汇点 满流判可行解】
1154 - PenguinsPDF (English)StatisticsForumTime Limit: 4 second(s)Memory Limit: 32 MBSomewhere near the South Pole, a number of penguins are standing on
2015-10-24 09:19:31 728
原创 hdoj 4944 FSF’s game 【数学思维】
FSF’s gameTime Limit: 9000/4500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 811 Accepted Submission(s): 414Problem DescriptionFSF has program
2015-10-23 21:31:29 461
原创 hdoj 4937 Lucky Number 【思维题】
Lucky NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1487 Accepted Submission(s): 441Problem Description“Ladies and
2015-10-23 21:28:57 486
原创 hdoj 4941 Magical Forest 【STL map】
Magical ForestTime Limit: 24000/12000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1287 Accepted Submission(s): 580Problem DescriptionThere is
2015-10-23 17:13:22 415
原创 hdoj 4939 Stupid Tower Defense 【DP】
Stupid Tower DefenseTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1908 Accepted Submission(s): 531Problem DescriptionFSF
2015-10-23 17:03:04 369
原创 【stack 实现前缀、后缀、中缀表达式运算】
问题一:输入一个前缀表达式,每个运算符和数字之间都有一个空格,输入的数字全为正实数。代码实现:#include #include #include #include #include #include #include #define MAXN 600using namespace std;char str[MAXN];void solve(char *s){
2015-10-20 15:09:11 767
原创 hdoj 2509 Be the Winner 【博弈】
Be the WinnerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2705 Accepted Submission(s): 1478Problem DescriptionLet's consid
2015-10-20 14:08:48 413
原创 lightoj 1153 - Internet Bandwidth 【无向图最大流】
1153 - Internet BandwidthPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBOn the Internet, machines (nodes) are richly interconnect
2015-10-19 23:57:55 2008
原创 hdoj 4767 Bell 【矩阵快速幂 + CRT】
BellTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 666 Accepted Submission(s): 286Problem DescriptionWhat? MMM is learning C
2015-10-18 22:40:14 495
原创 hdoj 3579 Hello Kiki 【CRT】
Hello KikiTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2706 Accepted Submission(s): 1000Problem DescriptionOne day I was s
2015-10-18 22:39:56 541
原创 hdoj 1573 X问题 【CRT】【求解方程组在 N内正整数解的个数】
X问题Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4405 Accepted Submission(s): 1420Problem Description求在小于等于N的正整数中有多少个X满足:X
2015-10-18 15:42:12 552
原创 poj 1006 && hdoj 1370 Biorhythms 【CRT】
BiorhythmsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 122912 Accepted: 38772DescriptionSome people believe that there are three cycles in a person's
2015-10-18 14:49:48 470
原创 poj 2891 Strange Way to Express Integers 【CRT】
Strange Way to Express IntegersTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 11750 Accepted: 3661DescriptionElina is reading a book written by Ru
2015-10-18 14:40:06 685
原创 中国剩余定理 【CRT】 【记录】
问题一:给你n个方程组:x%m[0] = a[0]x%m[1] = a[1]···x%m[n-1] = a[n-1]求变量x 的值,其中m[]必须两两互质。直接exgcd可以KOLL gcd(LL a, LL b){ return b == 0 ? a : gcd(b, a%b);}void exgcd(LL a, LL b, LL &d, LL
2015-10-18 14:34:32 1073
原创 hdoj 3341 Lost's revenge 【AC自动机 + 变进制状态压缩dp】
Lost's revengeTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 3452 Accepted Submission(s): 932Problem DescriptionLost and Ae
2015-10-18 12:05:48 640
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人