define M 1010int c[M][M];int f[M][M];int min(int a,int b,int c){ int z=(a<b)?a:b; if(z<c)return z; else return c;}int Max(int a ,int b){return a>b?a:b;}void LCS(char aa[], char bb[], int x, i
原创 2021-07-28 16:48:34
69阅读
#include#includeint a[10];int cmp(const void *a,const void *b) {return *(int *)a-*(int *)b;}int main() { int n,m,i,t; scanf("%d",&t); while(t--) { sc...
转载 2014-05-07 22:57:00
43阅读
2评论
A题。发现是递推可以解决这道题,a[n]=6*a[n-1]-a[n-2]。因为是求和,可以通过一个三维矩阵加速整个计算过程,主要是预处理出2^k时的矩阵,可以通过这道题 1 #include 2 #include 3 #include 4 #include 5 #define LL long...
转载 2015-10-16 20:11:00
53阅读
2评论
View Code //Problem 2013 A short problem /*Accept: 158 Submit: 452Time Limit:
原创 2021-07-28 17:27:12
63阅读
http://acm.fzu.edu.cn/problem.php?pid=2014好办法!View Code #include"iostream"using namespace std;int today[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
原创 2021-07-28 17:26:51
91阅读
#includeint main(){ __int64 n,i,sum,l,r; while(scanf("%I64d",&n)!=EOF)
转载 2013-08-26 18:55:00
38阅读
2评论
推规律吧/**1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 223 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 430 1 25 13 29 61 125
原创 2022-08-05 16:49:03
68阅读
推规律吧 /** 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 0 1 2 5 13 29 61 1
转载 2017-08-05 10:40:00
64阅读
Problem DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid o...
转载 2015-11-27 22:29:00
86阅读
2评论
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2170贴个baka爷的代码留念。。数据出的有问题,输入的字符串长度不超过1000#include#include#include#include#include#include#include#include#include#include#define inf 0x3f3f3f
原创 2021-08-13 13:48:55
20阅读
Problem 1021 飞船赛Accept: 1368Submit: 5167Time Limit: 1000 mSecMemory Limit : 32768 KB Problem Description有N个飞船进行比赛,它们的跑道为直线并互相平行。每个飞船的起跑位置均不相同。第i个飞船从起跑线右边Xi处开始向右行驶(Xi各不相同)。比赛开始后,它能在零时间内加速到最大速度Vi并永远保持此速度。比赛没有终点,即会永远进行下去。你的任务是算出比赛过程中一共有多少次"超车"。 Input输入数据由多组数据组成。每组数据格式如下:第一行为一个整数N(1<=N<=
转载 2011-11-14 12:34:00
40阅读
2评论
昨天比赛时浩神写的这道题,当时我想了想,大致有了个思路,只是感觉绝对会超时,所以一直没写。没想到这道题数据弱了,浩神给过了。今天来了后试着写了一下,没想到,这一写就写了快一天。。。。。悲剧。。。已经有了思路,还是tle了几次,,题目:Problem 2077 The tallest treeAccept: 41Submit: 176Time Limit: 1000 mSecMemory Limit : 65536 KBProblem Descriptionlzs种了n棵树,每棵树每天长高一定的高度。某一天,lzs想知道树长得怎么样了,你能求出那一天最高的树有多高吗?Input有多组测试数...
转载 2012-03-26 16:54:00
30阅读
2评论
费用流。。。。拆边,把一条边
原创 2023-07-05 20:10:28
39阅读
View Code #include<iostream>usingnamespace std;char ch[101];
原创 2021-07-28 17:14:48
107阅读
贪心。。。挨个判断每个点
原创 2023-07-05 20:10:36
33阅读
题目地址:http://acm.fzu.edu.cn/problem.php?pid=1607 给定一个n,将n平均分成m份,问有几种方法,每种方法中找出最大的数。思路:就是求n的因子数、先将每个数求出最小素因子、再将n的所有素因子数加1相乘。小结论:求一个数的所有因子数、先分解、n=(a^x)*(b^y)*(c^z),(a、b、c均为素数),因子数=(x+1)*(y+1)*(z+1)-1。 AC代码:输入数据很多,开始用cin果断超时了。#include #include #include #include #include #include #include #include #incl. Read More
转载 2013-07-16 18:58:00
45阅读
2评论
Problem 2173 NostopAccept: 52Submit: 210Time Limit: 3000 mSecMemory Limit : 32768 KBProblem DescriptionM国有N个城市,H条单向的道路,AekdyCoin从编号为1的城市出发,每经过一条道路要花一个...
转载 2014-04-30 10:33:00
71阅读
2评论
Problem 1759 Super A^B mod C Accept: 1368 Submit: 4639Time Limit: 1000 mSec Memory Limit : 32768 KB Accept: 1368 Submit: 4639Time Limit: 1000 mSec Mem
原创 2021-07-29 17:39:58
107阅读
Problem A: Yellowstar的第一道题写个暴力程序会发现若n*r*c 是偶数,则是必败态,输出0否则对于3*3*3 赢的位置有:1 0 10 1 01 0 10 1 01 0 10 1 01 0 10 1 01 0 11为必胜点。也就是说左上角是1,这样扩散出去。答案就是所有1位置的概率和。题解:Problem
原创 2021-08-13 13:47:26
162阅读
擦,没啥好说的,这个模板至少得打10遍。。纪念自己成功的打错了。。#include #include #include #include using namespace std;#define LL int#define lson id siz[son[u]])son[u] = v ; }}...
转载 2015-03-28 10:35:00
51阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5