我的方法
原创 2023-01-09 17:15:01
47阅读
写在前面思路分析理解题意给出两个数字序列,从这两个序列中分别选取相同数量的元素进行
原创 2022-08-23 15:48:56
41阅读
1037: I want you!Time Limit: 1 Sec  Memory Limit: 128 MB[Submit][Status][Web Board]DescriptionGiven an array Ai(0Besides, Ai and Bi meets the following conditions:If neither A[i]*B[i]
原创 2022-09-07 11:08:41
34阅读
#include const int Gal...
转载 2017-07-29 19:08:00
59阅读
2评论
#include const int Gal...
转载 2017-07-29 19:08:00
28阅读
2评论
#include const int Galleon = 17*29; // 一个加伦可以兑换的纳特数const int Sickle = 29; // 一个西可可以兑换的纳特数 int main(){ int a1,b1,c1; int a2...
转载 2017-07-29 19:07:00
52阅读
2评论
题目题意:给定两组序列,
原创 2023-06-27 10:24:11
48阅读
The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a produc
转载 2020-05-12 14:59:00
138阅读
1037. 在霍格沃茨找零钱(20)时间限制400 ms内存限制65536 kB代码长度
原创 2022-08-30 10:19:10
42阅读
#include #include using namespace std;int fences[25];bool DFSFlag[25];int caseNum;int plankNum;int ordin
原创 2023-05-23 15:53:32
50阅读
1 class Solution: 2 def isBoomerang(self, points: 'List[List[int]]') -> bool: 3 l = sorted(points, key = lambda x: (x[0],x[1])) 4 #print(l) 5 c = points[2] 6
转载 2019-05-05 13:55:00
39阅读
2011-12-20 16:13:50地址:http://acm.hdu.edu.cn/showproblem.php?pid=1037题意:输入一串数字,输出第一个小于168的数字。代码:# include <stdio.h>int main (){ int n ; while (~scanf ("%d", &n)) if (n < 168) break ; if (n < 168) printf ("CRASH %d\n", n) ; else printf ("NO CRASH\n") ; ret
转载 2012-01-06 23:15:00
35阅读
import sysn = int(raw_input())for i in range(1, n+1) : num = sys.stdin.readline() an = num.split() a = int(an[0]) b = int(an[1]) if(a%2...
转载 2013-03-15 19:45:00
113阅读
2评论
题目链接分析: 这道题还是挺好的 分da析biao发现 每五个一组,每组的末尾0的个数相同 分别是0,1,2,3… 后面的0都是不用进行计算的 一眼高精—->只过了3个点注意到了k#include#include#define ll long longusing na...
转载 2017-09-01 21:36:00
86阅读
2评论
/********************************** 日期:2011-3-1* 作者:SJF* 题号:杭电1037* 题目:Keep on Truckin'* 结果:AC* 注意:**********************************/#include<stdio.h>#include<time.h>int main(){ int a,b,c; while(scanf("%d %d %d",&a,&b,&c)!=EOF) { if(a<168) { printf("CRA
转载 2011-10-28 13:39:00
96阅读
2评论
1037. Magic Coupon (25)时间限制100 ms内存限制65536 kB代码长度限制16
原创 2022-08-30 10:17:25
66阅读
能不能仔细一点啊。。。
转载 2016-11-03 19:26:00
49阅读
2评论
题目链接:http://poj.org/problem?id=1037理解了牛人的代码才明白的,花了一晚上的功夫,orz....跪dp.思路:dp[len[i][0]表示长度为len的以i开始的前两个下降的序列的个数,dp[len][i][1]表示长度为len的以i开始的前两个上升的序列的个数;则有dp[len][i][0]+=dp[len-1][j][1](j<i);dp[len][i][1]+=dp[len-1][j][0](j>i);预处理之后,把序列求出来就可以了(这是难点);做法:由于不知道开始是上升还是下降,这一开始枚举,确定第1位的数,以及升降情况,然后我们就可以根据
转载 2013-05-02 23:20:00
79阅读
2评论
    为了查找标号最小的可用的block可以用一个以block标号为关键字的最小堆实现,同时为了能够修改正在使用的block延续的时间以及适时free过时的block,可以另外开一个以block开始使用的时刻为关键字的最小堆。 #include<stdio.h> #include<string.h> #define MAXD 30010 #define INF 0x3f
转载 2012-05-04 00:05:00
80阅读
2评论
/*题意: 给出一些长度相同的子串,目标串必须是由这些子串首尾连接起来,问有多少长度为L的目标串满足,比如:4 5 6ABB BCA BCD CAB CDD DDA则目标串有两个: BCABB 和 BCDDA定义连接 ch[i]->ch[j] , 只要满足 ch[i][1..len-1] = ch[j][0..len-2],即串i的后部分与串j的前部分重叠把每个输入的字符串当作顶点,字符串之间若可以连接则建立一条边,由此得到初始图,问题就转化成求 顶点数为 L-len+1 的路径 的总数*/#include<iostream> //DP#include<cstring&
转载 2011-07-05 12:20:00
45阅读
  • 1
  • 2
  • 3
  • 4
  • 5