开始啦~

始まった

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 题解的更多相关文章

  1. 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 ...

  2. Codeforces Round #612 (Div. 2) 前四题题解

    这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. An ...

  3. Codeforces Round #198 (Div. 2)A,B题解

    Codeforces Round #198 (Div. 2) 昨天看到奋斗群的群赛,好奇的去做了一下, 大概花了3个小时Ak,我大概可以退役了吧 那下面来稍微总结一下 A. The Wall Iahu ...

  4. Codeforces Round #672 (Div. 2) A - C1题解

    [Codeforces Round #672 (Div. 2) A - C1 ] 题目链接# A. Cubes Sorting 思路: " If Wheatley needs more th ...

  5. Codeforces Round #394 (Div. 2) 题解

    无需吟唱,直接传送 problem A 题目大意 已知有n个偶数,m个奇数,问这些数有没有可能组成一个严格递增1的序列 题解 判断abs(n,m) <= 1即可,注意n,m均为0的情况. Cod ...

  6. Codeforces Round #394 (Div. 2) 颓废记

    昨天晚上(今天凌晨),又忍不住去打CF.(本蒟弱到只能打Div.2)... 我觉得我可以用一个词概括我这次的CF: 呵呵 刚一开赛,我就codeforces访问失败.. 后来好不容易能上了,两三分钟才 ...

  7. 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 ...

  8. 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 ...

  9. Codeforces Round #394 (Div. 2) C. Dasha and Password 暴力

    C. Dasha and Password 题目连接: http://codeforces.com/contest/761/problem/C Description After overcoming ...

随机推荐

  1. ssh验证和端口转发

    ssh 服务登录验证 ssh 服务登录验证方式: 用户/ 口令 基于密钥 基于用户和口令登录验证 客户端发起ssh请求,服务器会把自己的公钥发送给用户 用户会根据服务器发来的公钥对密码进行加密 加密后 ...

  2. [App Store Connect帮助]四、添加 App 图标、App 预览和屏幕快照(4)为其他设备尺寸和本地化内容添加屏幕快照和预览

    如果您不想在其他设备尺寸上使用经过缩放的高分辨率屏幕快照或 App 预览,您可以使用“媒体管理”为其他设备尺寸和本地化内容添加自定屏幕快照. 屏幕快照和 App 预览仅在 App 状态为可编辑时才能进 ...

  3. python自动化测试学习笔记-8单元测试unittest模块

    官方参考文档:http://docs.python.org/2.7/library/unittest.html unittest是一个python版本的junit,junit是java中的单元测试框架 ...

  4. 贪心 Codeforces Round #191 (Div. 2) A. Flipping Game

    题目传送门 /* 贪心:暴力贪心水水 */ #include <cstdio> #include <algorithm> #include <cstring> us ...

  5. TensorFlow---基础---GFile

    使用TensorFlow的时候经常遇到 tf.gfile.exists().... 关于gfile,一个googler是这样给出的解释: The main roles of the tf.gfile ...

  6. js调试技巧汇总中

    由于设备多样性(PC.ios.安卓.pad.tv)以及各设备对js脚本支持性差异性.js兼容性调试显得越来越重要. 0:尽力模仿真实场景下进行调试,迅速定位问题以及提供解决方案. 1:setTimeo ...

  7. 简单的win7-cmd命令提示符

    在win7打开cmd窗口 有两个路径:(1)开始 -->所有程序 --> 附件 --> 命令提示 (2)开始 -->在搜索框输入 “cmd”   指令 作用 对文件夹的操作   ...

  8. EasyUI系列学习(十)-Tabs(选项卡)

    一.创建组件 <div class="easyui-tabs" style="width:500px;height:250px"> <div ...

  9. UNICODE本地编译freescale的i.MX6Q的android4.2.2&android4.4.2 && 全志a80的步骤x1

    20151031本地编译freescale的i.MX6Q的android4.2.2&android4.4.2 && 全志a80的步骤x1 2015/10/31 15:07 开始 ...

  10. weex开发前配置

    weex 环境配置:win10 node java git weex-toolkit :npm install weex-toolkit -g在安装weex-toolkit的时候,尽量不要使用cnpm ...