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. Delphi 的绘图功能[1] - PolyBezier、PolyBezierTo

    双击代码全选 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 unit Unit1; interface uses Windows, Messages, SysUtils ...

  2. web项目中 集合Spring&使用junit4测试Spring

    web项目中 集合Spring 问题: 如果将 ApplicationContext applicationContext = new ClassPathXmlApplicationContext(& ...

  3. java获取类路径

    String file = MessageTask3.class.getResource("").getFile(); File: public static final Stri ...

  4. C++ 栈和队列

    使用标准库的栈和队列时,先包含相关的头文件 #include<stack> #include<queue> 定义栈如下: stack<int> stk; 定义队列如 ...

  5. selenium By 元素定位详解

    转自:http://blog.sina.com.cn/s/blog_6966650401012a6u.html WebDriver拾级而上·之三 定位页面元素 selenium-webdriver提供 ...

  6. 【转】C# HttpWebRequest\HttpWebResponse\WebClient发送请求解析json数据

    http://blog.csdn.net/kingcruel/article/details/44036871 版权声明:本文为博主原创文章,未经博主允许不得转载. ================= ...

  7. windbg sos版本不匹配问题解决

    dumpheap 时提示: 0:105> !dumpheap -stat The garbage collector data structures are not in a valid sta ...

  8. C#访问url地址并返回数据

    public partial class Form1 : Form { static bool isSelect = false; public Form1() { InitializeCompone ...

  9. .Net程序员安卓学习之路5:使用xutils注入View和事件以及图片的显示

    xUtils注入和图片显示 一.xUtils注入 引用官方介绍: ViewUtils模块: •android中的ioc框架,完全注解方式就可以进行UI,资源和事件绑定: •新的事件绑定方式,使用混淆工 ...

  10. 关于前后台交互生成json区别

    如何返回[object{xx:{}}]这种数组型json在服务器端return $arr[]=m;像这种都可以产生[Object { 0="9", 1="8", ...