Coder-Strike 2014 - Finals (online edition, Div. 2) A. Pasha and Hamsters
水题
#include <iostream>
#include <vector>
#include <algorithm> using namespace std; int main(){
int n,a,b;
cin >> n >>a >> b;
vector<int> apple(n+,);
int k;
for(int i = ; i < a; ++ i) {
cin>>k;
apple[k] = ;
}
for(int i = ; i < b; ++ i) {
cin >> k;
if(apple[k]==) apple[k] = ;
}
for(int i = ; i < n+; ++ i){
if( i == ) cout<< apple[i];
else cout<<" "<<apple[i];
}
cout<<endl;
}
Coder-Strike 2014 - Finals (online edition, Div. 2) A. Pasha and Hamsters的更多相关文章
- Coder-Strike 2014 - Finals (online edition, Div. 2) B. Start Up
需要满足的条件是 (1)每个字母是对称的 (2)每个字符串是对称的 #include <iostream> #include <algorithm> #include < ...
- Coder-Strike 2014 - Finals (online edition, Div. 2) C题
C. Online Meeting time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- Coder-Strike 2014 - Finals (online edition, Div. 1)
CF 420A A. Start Up 题目链接: http://codeforces.com/problemset/problem/420/A 题目意思: 给一个字符串A,通过镜面反射后得到A', ...
- Bubble Cup 11 - Finals [Online Mirror, Div. 1]题解 【待补】
Bubble Cup 11 - Finals [Online Mirror, Div. 1] 一场很好玩的题啊! I. Palindrome Pairs 枚举哪种字符出现奇数次. G. AI robo ...
- Codeforces Round #297 (Div. 2)B. Pasha and String 前缀和
Codeforces Round #297 (Div. 2)B. Pasha and String Time Limit: 2 Sec Memory Limit: 256 MBSubmit: xxx ...
- 字符串处理 Codeforces Round #297 (Div. 2) B. Pasha and String
题目传送门 /* 题意:给出m个位置,每次把[p,len-p+1]内的字符子串反转,输出最后的结果 字符串处理:朴素的方法超时,想到结果要么是反转要么没有反转,所以记录 每个转换的次数,把每次要反转的 ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) B. Bear and Compressing
B. Bear and Compressing 题目链接 Problem - B - Codeforces Limak is a little polar bear. Polar bears h ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) E - Bear and Forgotten Tree 2 链表
E - Bear and Forgotten Tree 2 思路:先不考虑1这个点,求有多少个连通块,每个连通块里有多少个点能和1连,这样就能确定1的度数的上下界. 求连通块用链表维护. #inclu ...
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) E. Bear and Forgotten Tree 2 bfs set 反图的生成树
E. Bear and Forgotten Tree 2 题目连接: http://www.codeforces.com/contest/653/problem/E Description A tre ...
随机推荐
- Redis笔记(六)Redis的消息通知
Redis的消息通知可以使用List类型的LPUSH和RPOP(左进右出),当然更方便的是直接使用Redis的Pub/Sub(发布/订阅)模式. >>使用List实现队列 使用列表类型的L ...
- Linux USB Project
转自:http://www.linux-usb.org/ Welcome to the home of the Linux USB Project This web site was created ...
- Bootstrap简介
接下来的一段时间,想研究一下现有的网页框架,第一个不容错过的就是Bootstrap,Bootstrap 是一个用于快速开发 Web 应用程序和网站的前端框架.Bootstrap 是基于 HTML.CS ...
- [LeetCode] Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. F ...
- DB2 日期相减
简单方法: 使用 days 字符型的日期:2012-01-01,2012-01-11 values days(date('2012-01-11')) - days(date('2012-01-01' ...
- Win10 for Phone 裁剪控件
<Page.BottomAppBar> <CommandBar x:Name="appBar"> <AppBarButton Label=" ...
- POJ 1947 Rebuilding Roads 树形DP
Rebuilding Roads Description The cows have reconstructed Farmer John's farm, with its N barns (1 & ...
- python学习第一天
编码:encode 解码:decode 计算长度:len list:索引从0开始 -1可以索引最后一个元素 append添加元素 insert插入元素 pop删除末尾元素 替换的话直接赋值 list里 ...
- 通信原理实践(三)——FM调制
一.FM调制 1.代码如下: clc,clear; fm = ; % 调制信号频率(Hz) Am = 0.5; % 调制信号幅度 fc = 5e3; % 载波频率(Hz) Ac = ; % 载波幅度 ...
- view和activity的区别
activity相当于控制部分,view相当于显示部分.两者之间是多对多的关系,所有东西必须用view来显示. viewGroup继承自view,实现了ViewManager,ViewParent接 ...