soj1678的字符界面版本。 通过计算空格从底向上推即可。 源码:  #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> /***************************
原创 2012-05-27 22:57:59
287阅读
先来无事,切道水题。 题目网址如下:http://cstest.scu.edu.cn/soj/problem.action?id=4150 最长递增子序列的变种。 代码如下:   #include <stdio.h>  #include <ctype.h>  #include <string.h&g
原创 2012-07-15 20:38:12
373阅读
Output the Yanghui triangel 总提交数量: 225 通过数量: 59 时间限制:1秒 内存限制:256兆 题目描写叙述 Write program to output the Yanghui triangel of n*n, where n is an input. The
 明天软考,但是今天还是手痒,在soj又切了道水题1663,看cauchy做了,故也来切掉。 题目意思是一串合法的表达式字符串,仅包括大写字母,+,-,(,),空格,tab字符,把多余的括号去掉。如:(A+(B+C)+(D-E)) ->A+B+C+D-E 或者((B))->B 思路: 1.堆栈操作字符串括号屁屁额 2. pos[top] = index ;//记录括
原创 2012-05-25 21:46:23
492阅读
Zig-Zag 在图形图像处理中经常须要将一个二维的图像矩阵转化为一维的向量。二维化一维的过程实际上就是将二维数组的元素按某种顺序构成一维数组。一种经常使用的序列叫“Zig-Zag”序列。它按下面顺序将二维数组转化为一维数组: 你的任务,就是写一个程序把给定的二维数组按“Zig-Zag”顺序转化为一
转载 2017-05-03 11:06:00
95阅读
2评论
题目链接:Easy Problem
原创 2022-08-31 10:37:31
40阅读
 昨天没事干,本来切了2道水题,可以oj又挂了就没交上。今天交WA了一次,因为一个参数写错了= =简单总结一下。 题目大意: 抽象出如下序列: 1, 1、1,2,  1、1、1,1、2,3.... 第i串序列要么其和比前面的长,要么字典序比前面的大。 序列和显然从1,2,3,&hellip;&hellip;,n。 序列长度为i时,其个数有 f[i] = f[i-1
原创 2012-05-26 21:58:13
354阅读
下午闲来无事,突然想起收藏夹里尘封多年的题目,都是些比较感兴趣的题目,随便看了道2829 binary strings。 链接:http://cstest.scu.edu.cn/soj/problem.action?id=2829  大意是: 给定一个初始字符串(不超过20位),和目标字符串,给定操作步骤,求初始字符串到目标字符串的最少操作次数。 操作步骤:对字符串某一段连续区间
原创 2012-07-30 23:09:50
520阅读
分析 按照被穿过多少次整体二分即可 代码
转载 2019-10-30 14:36:00
143阅读
2评论
传送门 分析 代码
转载 2019-07-18 20:02:00
27阅读
2评论
​代码#include<bits/stdc++.h>using namespace std;#define int long longconst int N = 1e6+5;const int mod = 1e9+7;int phi[N+3],is[N+3],a[N+3],b[N+3],c[N+3],n,m,t;signed main(){ int i,j,k,x=0,y=0;
转载 2019-07-26 07:18:00
47阅读
2评论
这道是个典型的AC自动机。 在trie的基础上添加fail指针,指向类似于KMP的next处。 大意是求一段文字中出现过多少某字典的词。 主要用于多串匹配。 #include <stdio.h>  #include <ctype.h>  #include <string.h>  #include
原创 2012-07-30 23:25:59
483阅读
分析 代码
转载 2019-07-26 07:07:00
32阅读
2评论
-----------------------------最优化问题------------------------------------- ----------------------常规动态规划 SOJ1162 I-Keyboard SOJ1685 Chopsticks SOJ1679 Gangsters SOJ2096 Maximum Submatrix SOJ2111 littleken bg SOJ2142 Cow Exhibition SOJ2505 The County Fair SOJ2818 QQ音速 SOJ2469 Exploring Pyramids SOJ1833 B
转载 2013-07-21 14:51:00
82阅读
-----------------------------最优化问题------------------------------------- ----------------------常规动态规划 SOJ1162 I-Keyboard SOJ1685 Chopsticks SOJ1679 Gangsters SOJ2096 Maximum Submatrix SOJ2111
原创 2023-03-22 06:18:11
41阅读
4429: frog's dice 题目连接: http://acm.scu.edu.cn/soj/problem.action?id=4429 Description frog has many dices:) Each dice has six surfaces and there is a l
qt
原创 2021-07-16 11:54:18
79阅读
4484: The Graver Robbers' Chronicles 题目连接: http://acm.scu.edu.cn/soj/problem.action?id=4484 Description One day, Kylin Zhang and Wu Xie are trapped in
qt
原创 2021-07-16 11:54:15
127阅读
4493: DNA 题目连接: http://acm.scu.edu.cn/soj/problem.action?id=4493 Description Deoxyribonucleic acid (DNA) is a molecule that carries most of the geneti
qt
原创 2021-07-16 11:54:15
119阅读
4423: Necklace 题目连接: http://acm.scu.edu.cn/soj/problem.action?id=4423 Description baihacker bought a necklace for his wife on their wedding anniversar
qt
原创 2021-07-16 11:54:20
42阅读
  • 1
  • 2
  • 3