csuoj 1396: Erase Securely
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的更多相关文章
- 2014 UESTC 暑前集训队内赛(1) 解题报告
A.Planting Trees 排序+模拟 常识问题,将耗时排一个序,时间长的先种,每次判断更新最后一天的时间. 代码: #include <iostream> #include < ...
- stl vector erase
C++ Code 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...
- map 和 vector 的erase函数说明
1. map的erase函数使用 这里首先要注意,C++针对map的erase函数有不同的函数原型,这往往是出现问题的关键所在.根据参考文献1: 在C++98中: (1) void erase (it ...
- map erase iterator
错误写法: map<int, int> m; for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) ...
- C++ 容器 LIST VECTOR erase
在Vector中 做erase操作就是按照下面的步骤来做的: copy() destory(); 在list容器中 erase操作 destory() deallocate() Vector使用从某 ...
- vector使用篇之erase
由于最近项目使用中发现了之前对vector的一个误区,由此发现自己对vect非常不了解,对此进行了一些了解,由此打算写一下关于vector使用方面的注意点,本篇先来讲一下vector的erase功能, ...
- C++ vector erase函数的使用注意事项
最近使用了顺序容器的删除元素操作,特此记录下该函数的注意事项. 在C++primer中对c.erase(p) 这样解释的: c.erase(p) 删除迭代器p所指向的元素,返回一个指向被删元素 ...
- C++ std::map::erase用法及其陷阱
1.引入: STL的map中有一个erase方法用来从一个map中删除制定的节点 eg: map<string,string> mapTest; typedef map<string ...
- vector的erase的用法
vector<string>::iterator it = v.erase(v.begin() + 3, v.begin() + 6); 可以直接从begin进行加减,比如我们要移除第3个 ...
随机推荐
- Lazarus中Base64的操作
在字符串处理中,我们经常需要对文件编码然后再进行传输,通常会使用base64编码,在FreePascal中默认集成了这个单元,我们来介绍如何使用: 首先需要在引用单元的时候使用: use base64 ...
- Xlib 窗口属性
Xlib 窗口属性 转, 无法找到原作者 所有的 InputOutput 窗口都可以有零个或者多个像素的边框宽度,一个可选的背景,一个事件压制掩码(它压制来自孩子的事件传播),和一个 property ...
- CSS的display属性,显示或隐藏元素
<html> <head> <script type="text/javascript"> function removeElement() { ...
- USBDongle及Btool使用说明
BLE 模块可使用开发套件中的 USB Dongle 模拟手机APP配合Btool.exe 进行蓝牙通讯测试. >连接 BLE 模块 USB Dongle 和模块的连接是通讯的基础,扫描连接的操 ...
- android source compiler
- BulletedList使用及详解
BulletedList是一个让你轻松在页面上显示项目符号和编号格式(Bulledted List)的控件.对于ASP.NET 1.x里要动态显示Bulledted List时,要么自己利用HTML的 ...
- 【译】Android系统架构
让我们来快速预览一下整个android系统的架构.从下面的图中我们可以发现,这个架构分为几个不同的层,底层为上一层提供服务. Linux Kernel android系统建立在一个坚固的基石上:Li ...
- Difference between _, __ and __xx__ in Python
When learning Python many people don't really understand why so much underlines in the beginning of ...
- [LeetCode] Longest Palindromic Substring(manacher algorithm)
Given a string S, find the longest palindromic substring in S. You may assume that the maximum lengt ...
- C# 时间与时间戳互转 13位
/// <summary> /// 将c# DateTime时间格式转换为Unix时间戳格式 /// </summary> /// <param name="t ...