http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1396

1396: Erase Securely

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 102  Solved: 60
[Submit][Status][Web Board]

Description

Input

Output

Sample Input

1
10001110101000001111010100001110
01110001010111110000101011110001

Sample Output

Deletion succeeded

HINT

Source

分析;
就是01互换,然后对比两个串的异同。

AC代码:

 #include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<iostream>
#include<stack>
#include<map>
#include<string>
using namespace std;
char ch1[], ch2[];
int main(){
int n;
while(~scanf("%d", &n)){
scanf("%s%s", ch1, ch2);
int l = strlen(ch1);
if(n% == )
for(int i = ; i < l; i++)
if(ch1[i] == '')
ch1[i]--;
else if(ch1[i] == '')
ch1[i]++;
if(strcmp(ch1, ch2) == )
printf("Deletion succeeded\n");
else
printf("Deletion failed\n");
}
return ;
}

csuoj 1396: Erase Securely的更多相关文章

  1. 2014 UESTC 暑前集训队内赛(1) 解题报告

    A.Planting Trees 排序+模拟 常识问题,将耗时排一个序,时间长的先种,每次判断更新最后一天的时间. 代码: #include <iostream> #include < ...

  2. stl vector erase

     C++ Code  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...

  3. map 和 vector 的erase函数说明

    1. map的erase函数使用 这里首先要注意,C++针对map的erase函数有不同的函数原型,这往往是出现问题的关键所在.根据参考文献1: 在C++98中: (1) void erase (it ...

  4. map erase iterator

    错误写法: map<int, int> m; for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) ...

  5. C++ 容器 LIST VECTOR erase

     在Vector中 做erase操作就是按照下面的步骤来做的: copy() destory(); 在list容器中 erase操作 destory() deallocate() Vector使用从某 ...

  6. vector使用篇之erase

    由于最近项目使用中发现了之前对vector的一个误区,由此发现自己对vect非常不了解,对此进行了一些了解,由此打算写一下关于vector使用方面的注意点,本篇先来讲一下vector的erase功能, ...

  7. C++ vector erase函数的使用注意事项

    最近使用了顺序容器的删除元素操作,特此记录下该函数的注意事项. 在C++primer中对c.erase(p) 这样解释的:  c.erase(p)    删除迭代器p所指向的元素,返回一个指向被删元素 ...

  8. C++ std::map::erase用法及其陷阱

    1.引入: STL的map中有一个erase方法用来从一个map中删除制定的节点 eg: map<string,string> mapTest; typedef map<string ...

  9. vector的erase的用法

    vector<string>::iterator it = v.erase(v.begin() + 3, v.begin() + 6); 可以直接从begin进行加减,比如我们要移除第3个 ...

随机推荐

  1. 用正则验证字符串格式,形如:A)XXX B)XXXX C)XXX

    今天遇到个小功能,要验证某个英文选项是否正确,例如:A)accumulate B)circling C)communities  D)competition  E)domestic F)financi ...

  2. php+mysql实现事务回滚

    模拟条件:第一个表插入成功,但是第二个表插入失败,回滚.第一个表插入成功,第二个表插入成功,执行.第一个表插入失败,第二个表插入成功,回滚.第一个表插入失败,第二个表插入失败,回滚.以上情况都需要回滚 ...

  3. key_value 类型配置文件的解析

    #include <iostream> #include <string> #include <stdint.h> #include <map> #in ...

  4. php---分组函数group_concat()

    group_concat()函数总结 group_concat(),手册上说明:该函数返回带有来自一个组的连接的非NULL值的字符串结果.比较抽象,难以理解. 通俗点理解,其实是这样的:group_c ...

  5. 超级管理员登录后如果连续XX分钟没有操作再次操作需要重新登录

    首先在设置session页面时 session_start(); session("name",$adminname); //加入session时间 time() session( ...

  6. mongoDB 安装配置

    1. 配置文件: 建立配置文件 :mongodb.conf dbpath=D:\mongoDb\data\db #配置数据库目录路径,预先手动创建db目录 logpath=D:\mongoDb\dat ...

  7. (letcode)String to Integer (atoi)

    Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. ...

  8. SMART Goals

    Once you have planned your project, turn your attention to developing several goals that will enable ...

  9. Windows-004-显示文件的扩展名

    此文主要讲述 Windows 7 下如何显示文件的扩展名,敬请亲们参阅.若有不足之处,敬请大神指正,不胜感激! 通常安装好 Win7 后,文件的扩展名默认是不显示的,如下所示: 点击工具栏中的 组织, ...

  10. http://www.cnblogs.com/peida/archive/2013/04/23/3036035.html

    http://www.cnblogs.com/peida/archive/2013/04/23/3036035.html