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个 ...
随机推荐
- TabHost详解
[转]http://blog.csdn.net/harvic880925/article/details/17120325 前言:今天仔细研究了下TabHost,主要是为了实现微信底部导航栏的功能,最 ...
- scala手动编译运行
1 Person.scala class Person { var name = "" } object Person { // a one-arg constructor de ...
- PHP 加密 和 解密 方法
关于Discuz的加密解密函数,相信大家都有所了解,该authcode函数可以说是对PHP界作出了重大的贡献,真的发觉discuz这个函数写的太精彩啦. 研究了一下这个算法,总的来说可以归纳为以下三点 ...
- BAT for循环
一,数字循环 echo off & color 0A for /l %%i in (1,1,10) do ( echo %%i ) pause > nul 输出: 1 2 3 4 5 6 ...
- IOS的APNS和PushKit门道详述
基本功 iOS在诞生之初为了最大程度的保证用户体验,做了一些高瞻远瞩且影响深远的设计.APNs(Apple Push Notification service)就是其中一项. 早期iOS设备的内存和C ...
- 对象(List<T>)的序列化和反序列化
本文描述将对象(List<T>)序列化到 XML 文档中和从 XML 文档中反序列化为对象(List<T>). 命名空间: System.Xml.Serialization 程 ...
- 常用分类列表wp_list_categories()
使用: <ul> <?php $args= array( 'depth'=>1, 'orderby'=>id, 'style'=>none ); wp_list_c ...
- 在express项目中有效组织和使用mongoose
平凡之路 1.创建express项目 express mongooseExpress 2.最简express var express = require("express"); v ...
- dom classList
才发现dom对象就有classList属性,通过它可以判断该dom是否有指定的class名存在. var tar = e.target; var classList = tar.classList; ...
- ajax处理回调函数,用ajax向后台发送数据
这是我的后台返回给前台的数据: 处理后台返回的数据有一下两种方式: function sethouse_housing_pattern(housing_pattern){ var str=[]; va ...