codeforces round #394 (div. 2) A\B 题解
开始啦~
始まった
T1
#include <stdio.h>
int l,r,even,odd;
void Jud(){
for(int i=1;i<=200;i++){
for(int j=i;j<=200;j++){
odd=even=0;
for(int k=i;k<=j;k++)
k&1?odd++:even++;
if(even==l&&odd==r){
puts("YES");
return;
}
}
}
puts("NO");
}
int main(){
scanf("%d%d",&l,&r);
Jud();
return 0;
}
T2
#include <math.h>
#include <stdio.h>
#include <memory.h>
int n,L,a[55],b[55],ta[105],tb[105];
bool Jud(){
for(int l=0;l<L;l++)
if(ta[l]!=tb[l])
return 0;
return 1;
}
void solve(){
for(int i=0;i<n;i++)
tb[b[i]]++;
for(int k=1;k<=L;k++){
memset(ta,0,sizeof ta);
for(int i=0;i<n;i++)
ta[(++a[i])%=L]++;
if(Jud()){
puts("YES");
return;
}
}
puts("NO");
}
int main(){
scanf("%d%d",&n,&L);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(int i=0;i<n;i++)
scanf("%d",&b[i]);
solve();
return 0;
}
codeforces round #394 (div. 2) A\B 题解的更多相关文章
- Codeforces Round #394 (Div. 2) E. Dasha and Puzzle(分形)
E. Dasha and Puzzle time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- 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 #394 (Div. 2) 题解
无需吟唱,直接传送 problem A 题目大意 已知有n个偶数,m个奇数,问这些数有没有可能组成一个严格递增1的序列 题解 判断abs(n,m) <= 1即可,注意n,m均为0的情况. Cod ...
- Codeforces Round #394 (Div. 2) 颓废记
昨天晚上(今天凌晨),又忍不住去打CF.(本蒟弱到只能打Div.2)... 我觉得我可以用一个词概括我这次的CF: 呵呵 刚一开赛,我就codeforces访问失败.. 后来好不容易能上了,两三分钟才 ...
- Codeforces Round #394 (Div. 2) E. Dasha and Puzzle 构造
E. Dasha and Puzzle 题目连接: http://codeforces.com/contest/761/problem/E Description Dasha decided to h ...
- Codeforces Round #394 (Div. 2) D. Dasha and Very Difficult Problem 贪心
D. Dasha and Very Difficult Problem 题目连接: http://codeforces.com/contest/761/problem/D Description Da ...
- Codeforces Round #394 (Div. 2) C. Dasha and Password 暴力
C. Dasha and Password 题目连接: http://codeforces.com/contest/761/problem/C Description After overcoming ...
随机推荐
- 【单独编译使用WebRTC的音频处理模块 - android】
更新 [2015年2月15日] Bill 这段时间没有再关注 WebRTC 以及音频处理的相关信息,且我个人早已不再推荐单独编译 WebRTC 中的各个模块出来使用.实际上本文的参考价值已经很小了,甚 ...
- 如何过滤 adb logcat 输出(转载)
转自:http://www.cnblogs.com/imouto/archive/2012/12/11/filtering-adb-logcat-output.html 简介: 本文介绍如何在 she ...
- Redis设置认证密码
1.找到Redis里的redis.conf配置文件:搜素requirepass所在的行,格式为:requirepass password 2.redis-cli客户端登陆格式:redis-cli -a ...
- JAVA接口和抽象类的特点
接口的特点: 1:接口不可实例化,可结合多态进行使用(接口 对象=new 对象()) 2:接口里的成员属性全部是以 public(公开).static(静态).final(最终) 修饰符修饰 3:接口 ...
- [Swift通天遁地]一、超级工具-(18)创建强大、灵活的日期时间拾取器
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- shiro vue 前后端分离中模拟登录遇到的坑
系统采用jeeplus框架(ssm+redis+shiro+mongodb+redis),默认是了JSP未做前后端分离,由于业务需要已经多终端使用的需求(H5.小程序等),需要实现前后端分离.但是由于 ...
- [GDOI2014]拯救莫莉斯
题目描述 莫莉斯·乔是圣域里一个叱咤风云的人物,他凭借着自身超强的经济头脑,牢牢控制了圣域的石油市场. 圣域的地图可以看成是一个n*m的矩阵.每个整数坐标点(x , y)表示一座城市吗,两座城市间相邻 ...
- 题解报告:hdu 1061 Rightmost Digit(快速幂取模)
Problem Description Given a positive integer N, you should output the most right digit of N^N. Input ...
- *RelativeLayout的布局参数含义表,如android:layout_alignParentTop等
RelativeLayout 参数规则 一个控件的位置由横,纵两个方向上的距离决定 控件默认的位置在左上角. 单独使用以下属性都只是改变一个方向的相对位置. 如:只使用了android:layout_ ...
- Coding Pages 服务与万网域名的配置
1071220 http://support.huawei.com/learning/NavigationAction!createNavi?navId=MW000001_term1000190292 ...