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. jquery 替换img 属性

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...

  2. To Learn

    1. Hybrid:Ionic.Cordova.AngularJS等框架 webView,处理H5 2. View.ViewGroup android.view.View  public class ...

  3. IOS __ 面试题

    1.下面四种内部排序算法中哪一种在最差的情况下时间复杂度最高:(B) A.快速排序 B.冒泡排序 C.堆排序 D.归并排序   2.Shell中,将command1的输出作为command2的输入应该 ...

  4. mysql介绍及安装

    一.MySQL介绍 1.标志 MySQL的海豚标志的名字叫"sakila",它是由MySQL AB的创始人从用户在"海豚命名"的竞赛中建议的大量的名字表中选出的 ...

  5. 【Java EE 学习 56】【酒店会员管理系统技术点总结】

    一.树状菜单加载 这是js的一个典型应用,使用zTree插件能够完成该项任务http://www.ztree.me/v3/main.php 我是用的版本:zTree2.5 使用方法: <%@ p ...

  6. Java基础学习(四)

    流程控制 /* 控制流程语句之---if 判断语句 格式一: 只适用于一种情况下去使用. if(判断条件){ 符合条件执行的代码; } 格式二:适用于两种情况下去使用 if(判断条件){ 符合条件执行 ...

  7. JS 数据类型转换

    JS 数据类型转换 方法主要有三种 转换函数.强制类型转换.利用js变量弱类型转换. 1. 转换函数: js提供了parseInt()和parseFloat()两个转换函数.前者把值转换成整数,后者把 ...

  8. Web Service 的创建简单编码、发布和部署

    最近,老大准备将已有的C/S架构项目中的通信部分做成通用,需要将其支持WebService为以后项目向着B/S架构升级做好铺垫,为此身为屌丝的我去各种百度WebService是个什么卵玩意,然后逐渐搭 ...

  9. C#创建文件夹,往里追字符串。

    /// <summary>写文本日志</summary> /// <param name="StrMessage">日志消息</param ...

  10. F#之旅2 - 我有特别的学F#技巧

    原文地址:https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/learning-fsharp/ Learning F#Functio ...