transaction transaction transaction Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 1496    Accepted Submission(s): 723 Problem Description Kelukin is a businessman. Every day, he travels arou…
最开始一直想不通,为什么推出这个公式,后来想了半天,终于想明白了. 题目大意是,有M个格子,有K个物品.我们希望在格子与物品之间连数量尽可能少的边,使得——不论是选出M个格子中的哪K个,都可以与K个物品恰好一一匹配. 然后你可以试着画图,每次必须有k个格子是单独的(与各物体只有一条线相连)所以还剩下m-k个格子,可以用来补位,也就是跟每个物品都相连,所以就有(m-k)*k 上代码(巨巨巨巨巨简单): #include <cstdio> #include <cstring> #inc…
Problem Description Connecting the display screen and signal sources which produce different color signals by cables, then the display screen can show the color of the signal source.Notice that every signal source can only send signals to one display…
HDU 6197 array array array 题意 输入n和k,表示输入n个整数和可以擦除的次数k,如果至多擦除k次能是的数组中的序列是不上升或者是不下降序列,就是魔力数组,否则不是. 解题思路 分别求最长不下降和不上升子序列的长度,看不符合要求的数字和k的大小. 这里使用优化后的求解最长不上升和不下降子序列的算法. #include <cstdio> #include <algorithm> using namespace std; ; ; int A[maxn], B[…
cable cable cable Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2084    Accepted Submission(s): 1348 Problem Description Connecting the display screen and signal sources which produce differen…
题目链接 emmmm...思路是群里群巨聊天讲这题是用尺取法.....emmm然后就没难度了,不过时间上3000多,有点.....盗了个低配本的读入挂发现就降到2800左右, 翻了下,发现神犇Claris280MS秒过.......%%% #include <stdio.h> #include <stdlib.h> #include <cmath> #include <string.h> #include <iostream> #include…
思路:找规律发现这个数是斐波那契第2*k+3项-1,数据较大矩阵快速幂搞定.   快速幂入门第一题QAQ #include <stdio.h> #include <stdlib.h> #include <cmath> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #include <vector> #i…
2017-09-15 21:05:41 writer:pprp 给出一个序列问能否去掉k的数之后使得整个序列不是递增也不是递减的 先求出LIS,然后倒序求出最长递减子序列长度,然后判断去k的数后长度是否都大于所求长度 代码如下: #include <bits/stdc++.h> using namespace std; ],tmp1[],arr2[], tmp2[]; int len1,len2; int main() { int cas; // cin >> cas; scanf…
题意:看后面也应该知道是什么意思了 解法: 我们设置l,r,符合条件就是l=起始点,r=当前点,不符合l=i+1 学习了一下FASTIO #include <iostream> #include <algorithm> #include <set> #include <string> #include <vector> #include <queue> #include <map> #include <stack&g…
Problem Description Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book named "the Man Who Changed China". Of course, Kelukin wouldn't miss this c…