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 ...
随机推荐
- sass02
新建一个文件夹 1 cd 进入文件夹 ,cd E:\360data\重要数据\桌面\sass, 2 compass creat hello:当前目录创建sass工程, 3 sass文件夹放置sass文 ...
- 在IIS中给某一个网站添加binding的坑
以http为例, 假如ip地址从局域网的地址172.31.212.20改为127.0.0.1 但是网站没法访问了http://172.31.212.20/chile.backoffice/ 必须通过 ...
- VS链接数据库
可以用VS链接数据库,并进行数据库操作.前提是安装了Sqlserver,活着连接线上的数据库服务器.
- “DNS隧道”盗号木马分析——类似hjack偷密码然后利用dns tunnel直传数据发送出去
摘自:http://www.freebuf.com/articles/network/38276.html# 运行后不断监控顶端窗口,一旦发现为QQ,就弹出一个自己伪造的QQ登陆窗口,诱导用户输入密码 ...
- 30.angularJS第一个实例
转自:https://www.cnblogs.com/best/tag/Angular/ AngularJS 通过 ng-directives 扩展了 HTML. ng-app 指令定义一个 Angu ...
- Spring MVC 入门
1.准备开发环境和运行环境: ☆开发工具:eclipse ☆运行环境:tomcat6.0.20 ☆工程:动态web工程(springmvc-chapter2) ☆spring框架下载: spring- ...
- Weka中数据挖掘与机器学习系列之Weka3.7和3.9不同版本共存(七)
不多说,直接上干货! 为什么,我要写此博客,原因是(以下,我是weka3.7.8) 以下是,weka3.7.8的安装版本. Weka中数据挖掘与机器学习系列之Weka系统安装(四) 基于此,我安装最新 ...
- cf 822B Crossword solving
B. Crossword solving time limit per test 1 second memory limit per test 256 megabytes input standard ...
- AIX 系统补丁升级步骤
AIX 系统补丁升级步骤 1.升级之前建议备份 rootvg (推荐) # smit mksysb 2.检查系统版本号 # oslevel -r 3.找到补丁光盘或者下载补丁,上传到服务器 ...
- 03015_DBUtils
1.概述 (1)如果只使用JDBC进行开发,我们会发现冗余代码过多,为了简化JDBC开发,本案例我们讲采用apache commons组件一个成员:DBUtils : (2)DBUtils就是JDBC ...