Link

http://acm.hust.edu.cn/vjudge/contest/121539#problem/A

Description

standard input/output

Haneen is trying to solve an easy problem given by Dr. Ibrahim in the Algorithms course. The problem is to find the lexicographically smallest Longest Common Subsequence (LCS) between two strings. Unfortunately, she got many runtime errors. After tens of wrong submissions, she asked Master Hazem about the problem and he replied:

"C strings are terminated with the null character ‘\0’. When you want to store a string of length N, the size of the array should be at leastN + 1."

Haneen didn’t get anything of what he said, and now, she is in need of your help! Given the length of the string Haneen has, determine the minimum size of an array needed to store this string.

Input

The input contains a single integer N(1 ≤ N ≤ 105), the length of the string.

Output

Print the minimum size of an array needed to store the string.

Sample Input

Input
3
Output
4
Input
7
Output
8
Input
64
Output
65

Solution

This is an easy question.The description of the problem has told us C strings usually prepare an extra space for the null character '\0'.So,just input an integer n,then output n+1.

C++ Code

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  cout<<n+1<<endl;
  return 0;
}

The Solution of UESTC 2016 Summer Training #1 Div.2 Problem A的更多相关文章

  1. The Solution of UESTC 2016 Summer Training #1 Div.2 Problem C

    Link http://acm.hust.edu.cn/vjudge/contest/121539#problem/C Description standard input/output After ...

  2. The Solution of UESTC 2016 Summer Training #1 Div.2 Problem B

    Link http://acm.hust.edu.cn/vjudge/contest/121539#problem/B Description standard input/output Althou ...

  3. UESTC 2016 Summer Training #6 Div.2

    我好菜啊.. UVALive 6434 给出 n 个数,分成m组,每组的价值为最大值减去最小值,每组至少有1个,如果这一组只有一个数的话,价值为0 问 最小的价值是多少 dp[i][j] 表示将 前 ...

  4. UESTC 2016 Summer Training #1 Div.2

    最近意志力好飘摇..不知道坚不坚持得下去.. 这么弱还瞎纠结...可以滚了.. 水题都不会做.. LCS (A) 水 LCS (B) 没有看题 Gym 100989C 水 1D Cafeteria ( ...

  5. UESTC 2016 Summer Training #1 J - Objects Panel (A) 按条件遍历树

    #include <iostream> #include <cstdio> #include <vector> using namespace std; typed ...

  6. 2016 Multi-University Training Contests

    2016 Multi-University Training Contest 1 2016 Multi-University Training Contest 2 2016 Multi-Univers ...

  7. 2016 Multi-University Training Contest 2 D. Differencia

    Differencia Time Limit: 10000/10000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tot ...

  8. 2016 Multi-University Training Contest 1 G. Rigid Frameworks

    Rigid Frameworks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  9. 2016 Multi-University Training Contest 1

    8/11 2016 Multi-University Training Contest 1 官方题解 老年选手历险记 最小生成树+线性期望 A Abandoned country(BH) 题意: 1. ...

随机推荐

  1. UTF-8编码规则(转)

    from:http://www.cnblogs.com/chenwenbiao/archive/2011/08/11/2134503.html UTF-8是Unicode的一种实现方式,也就是它的字节 ...

  2. jquery Ajax提交表单数据

    //表单中控件的name要和实体类字段属性一致 $.ajax({ cache: true, type: "POST", url:ajaxCallUrl, data:$('#your ...

  3. js加解密字符串

    项目中经常会有url带参并取参数值的问题,最常见的就是登录后再回到原来的页面redirect_uri,我们通常会使用 encodeURIComponent() 转码,当然简单的可以这样使用,如果涉及到 ...

  4. java 的 struts2 Spring Hibernate 三大框架的整合

    原理就不说了,直接上配置文件及代码,用来备用 首先,将三大框架所需要的jar包导入项目中 导入  struts2-spring-plugin-2.3.3.jar包  此包的作用是作为struts2 与 ...

  5. mysql导出excel文件的几种方法

    方法一 用mysql的命令和shell select * into outfile './bestlovesky.xls' from bestlovesky where 1 order by id d ...

  6. jq冒泡之——点击其他地方隐藏

    e.stopPropagetion(); <!DOCTYPE html> <html lang="en"> <head> <meta ch ...

  7. 学习微信小程序之css11内外边距集合

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. Mysql数据库的使用总结之Innodb简介

     最近在对开发的软件的服务器部分制作安装包,但服务器部分需要有mysql数据库的支持.因此,采用免安装版的mysql策略:将mysql数据库需要的文件在安装程序中进行设置和打包即可.但也遇到了很多问题 ...

  9. iOS之 清理缓存

    作为一个开发者,对于缓存的清理也是理所应当的需要的.这次就简单的谈一下iOS中对于缓存的清理方法. 我们清理缓存通常是在这三种方式下进行的: (1)项目中的清理缓存按钮 (2)点击退出app按钮时清理 ...

  10. SQLServer生成三位姓名及11位国内电话号码(生成测试数据用)

    SELECT SUBSTRING(N'王李张刘陈杨黄赵吴周徐孙马朱胡郭何高林郑谢罗梁宋唐许韩冯邓曹彭曾肖田董袁潘于蒋蔡余杜叶程苏魏吕丁任沈姚卢姜崔钟谭陆汪范金石廖贾夏韦付方白邹孟熊秦邱江尹薛闫段雷侯龙 ...