Codeforces Round #195 (Div. 2) 少部分题解
太困了于是没做...第二天看题蘑菇题居多就只切了简单的两个...
A:直接输出...
int main()
{
//FIN;
//FOUT;
int x,y;
cin>>x>>y;
int q = abs(abs(x) + abs(y));
if(x > && y > )
cout<<"0 "<<q<<" "<<q<<""<<endl;
if(x < && y > )
cout<<-q<<""<<" 0 "<<q<<endl;
if(x < && y < )
cout<<-q<<" 0 "<<"0 "<<-q<<endl;
if(x > && y < )
cout<<"0 "<<-q<<" "<<q<<""<<endl;
return ;
}
C:求做&以后 mod2k=0 且k最大的子序列
枚举右移位数 , 出现能整除2k的就输出...
vector<int> v;
int main()
{
//FIN;
//FOUT;
int n,a;
cin>>n;
for(int i = ; i < n ; i++) {
cin>>a;
v.push_back(a);
}
int p = ,m = -INF;
for(int i = ; i >= ; i--){
vector<int> s;
for(int j = ; j < v.size() ; j++){
if((v[j]>>i) & ){
s.push_back(v[j]);
}
}
if(s.size() == ) continue;
int sum = s[];
for(int j = ; j < s.size() ; j++){
sum = sum & s[j];
}
if(sum % (<<i) == ){
cout<<s.size()<<endl;
for(int j = ; j < s.size() ; j++){
cout<<s[j]<<" ";
}
break;
}
}
return ;
}
Codeforces Round #195 (Div. 2) 少部分题解的更多相关文章
- Codeforces Round #196 (Div. 2) 少部分题解
A:sort以后求差值最小 ]; int main() { int n,m; cin>>n>>m; ; i < m ; i++) cin>>a[i]; sor ...
- Codeforces Round #612 (Div. 2) 前四题题解
这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. An ...
- Codeforces Round #198 (Div. 2)A,B题解
Codeforces Round #198 (Div. 2) 昨天看到奋斗群的群赛,好奇的去做了一下, 大概花了3个小时Ak,我大概可以退役了吧 那下面来稍微总结一下 A. The Wall Iahu ...
- Codeforces Round #672 (Div. 2) A - C1题解
[Codeforces Round #672 (Div. 2) A - C1 ] 题目链接# A. Cubes Sorting 思路: " If Wheatley needs more th ...
- Codeforces Round #614 (Div. 2) A-E简要题解
链接:https://codeforces.com/contest/1293 A. ConneR and the A.R.C. Markland-N 题意:略 思路:上下枚举1000次扫一遍,比较一下 ...
- Codeforces Round #610 (Div. 2) A-E简要题解
contest链接: https://codeforces.com/contest/1282 A. Temporarily unavailable 题意: 给一个区间L,R通有网络,有个点x,在x+r ...
- Codeforces Round #611 (Div. 3) A-F简要题解
contest链接:https://codeforces.com/contest/1283 A. Minutes Before the New Year 题意:给一个当前时间,输出离第二天差多少分钟 ...
- Codeforces Round #195 (Div. 2) D题Vasily the Bear and Beautiful Strings
这场CF,脑子乱死啊...C题,搞了很长时间,结束了,才想到怎么做.B题,没看,D题,今天看了一下,很不错的组合题. 如果n和m都挺多的时候 以下情况都是变为1,根据偶数个0,最后将会为1,奇数个0, ...
- Codeforces Round #195 (Div. 2)
记次CF吧 1题...B题..因为循环的i没设成long long 却参与了运算 结果就悲剧了 一直交 一直挂 ..上题 A 水.. 第一次少了个空格还.. #include <iostream ...
随机推荐
- 在iPad iOS8环境下打开相冊或者拍照
在iPad下打开相冊或者拍照,假设使用 UIImagePickerController 打开相冊或者拍照,那必需要用到 UIPopoverController 去打开. UIPopoverContro ...
- CSU1608: Particle Collider(后缀数组)
Description In the deep universe, there is a beautiful planet named as CS on which scientists have d ...
- 安卓自己定义对话框及The specified child already has a child问题
问题:在android开发过程中,有时会在不同情况下遇到同种问题:The specified child already has a parent.You must call removeView() ...
- 当我们谈论Erlang Maps时,我们谈论什么 Part 1
Erlang 添加 Maps数据类型并非非常突然,由于这个提议已经进行了2~3年之久,仅仅只是Joe Armstrong老爷子近期一篇文章Big changes to Erlang掀起不小了 ...
- BZOJ 4003 左偏树
思路: 用到了左偏树合并复杂度是logn的性质 一开始先BFS一遍 打标记的左偏树 //By SiriusRen #include <cstdio> #include <cstrin ...
- leetcode 10 Regular Expression Matching(简单正则表达式匹配)
最近代码写的少了,而leetcode一直想做一个python,c/c++解题报告的专题,c/c++一直是我非常喜欢的,c语言编程练习的重要性体现在linux内核编程以及一些大公司算法上机的要求,pyt ...
- 用三层交换建立企业VLAN
650) this.width=650;" onclick='window.open("http://blog.51cto.com/viewpic.php?refimg=" ...
- div动态加载页面
div动态加载页面 /* /// method 1 var url="<%=basePath%>/qne.do?p=pessegerCountSet"; $.post( ...
- Zabbix监控平台部署
系统环境 Server端:192.168.149.128 Agent端:192.168.149.129 一.lamp环境安装 1.yum安装lamp yum install -y http http- ...
- 进阶《Python高性能编程》中文PDF+英文PDF+源代码
入门使用高性能 Python,建议参考<Python高性能编程>,例子给的很多,讲到高性能就会提到性能监控,里面有cpu mem 方法的度量,网络讲了一点异步,net profiler 没 ...