HDU 多校联合 6045
Is Derek lying?
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 441 Accepted Submission(s): 266
is Austrian.This summer holiday,they both participate in the summer
camp of Borussia Dortmund.During the summer camp,there will be fan tests
at intervals.The test consists of N choice questions and each question is followed by three choices marked “A” “B” and “C”.Each question has only one correct answer and each question is worth 1 point.It means that if your answer for this question is right,you can get 1 point.The total score of a person is the sum of marks for all questions.When the test is over,the computer will tell Derek the total score of him and Alfia.Then Alfia will ask Derek the total score of her and he will tell her: “My total score is X,your total score is Y.”But Derek is naughty,sometimes he may lie to her. Here give you the answer that Derek and Alfia made,you should judge whether Derek is lying.If there exists a set of standard answer satisfy the total score that Derek said,you can consider he is not lying,otherwise he is lying.
For each test case,there will be three lines.
The first line consists of three integers N,X,Y,the meaning is mentioned above.
The second line consists of N characters,each character is “A” “B” or “C”,which represents the answer of Derek for each question.
The third line consists of N characters,the same form as the second line,which represents the answer of Alfia for each question.
Data Range:1≤N≤80000,0≤X,Y≤N,∑Ti=1N≤300000
Please print “Lying” if you can make sure that Derek is lying,otherwise please print “Not lying”.
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
char a[],b[];
int ans,dif,t,n,la,lb;
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d%d%d",&n,&la,&lb);
scanf("%s%s",&a,&b);
ans=dif=;
for(int i=;i<n;i++)
{
if(a[i]==b[i]) ans++;
else dif++;
}
if(abs(la-lb)>dif || la+lb>n*-dif)puts("Lying");
else puts("Not lying");
}
return ;
}
HDU 多校联合 6045的更多相关文章
- HDU 多校联合 6033 6043
http://acm.hdu.edu.cn/showproblem.php?pid=6033 Add More Zero Time Limit: 2000/1000 MS (Java/Others) ...
- HDU 多校联合练习赛2 Warm up 2 二分图匹配
Warm up 2 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total ...
- hdu 5288||2015多校联合第一场1001题
pid=5288">http://acm.hdu.edu.cn/showproblem.php?pid=5288 Problem Description OO has got a ar ...
- HDU 5792---2016暑假多校联合---World is Exploding
2016暑假多校联合---World is Exploding Problem Description Given a sequence A with length n,count how many ...
- 2016暑假多校联合---Windows 10
2016暑假多校联合---Windows 10(HDU:5802) Problem Description Long long ago, there was an old monk living on ...
- hdu5379||2015多校联合第7场1011 树形统计
pid=5379">http://acm.hdu.edu.cn/showproblem.php? pid=5379 Problem Description Little sun is ...
- 2016暑假多校联合---Rikka with Sequence (线段树)
2016暑假多校联合---Rikka with Sequence (线段树) Problem Description As we know, Rikka is poor at math. Yuta i ...
- 2016暑假多校联合---Substring(后缀数组)
2016暑假多校联合---Substring Problem Description ?? is practicing his program skill, and now he is given a ...
- 2016暑假多校联合---To My Girlfriend
2016暑假多校联合---To My Girlfriend Problem Description Dear Guo I never forget the moment I met with you. ...
随机推荐
- Intel Media SDK 性能測试
经过測试,发如今windows 7上 i3 i5 上Intel Media SDK 1080P仅仅能解6路,720P仅仅能解8路, 不知大家有没有測试过?
- Ubuntu 16.04/18.04 LTS改变时区和语言
Ubuntu 16.04/18.04 LTS改变Timezone时区设定原文 https://www.phpini.com/linux/ubuntu-16-04-change-timezone-set ...
- 21.MFC进制转换工具
相关代码:链接:https://pan.baidu.com/s/1pKVVUZL 密码:e3vf #include <stdlib.h> #include <stdio.h> ...
- 35.QQ大数据模型
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <stri ...
- 编写jsp代码时出现的红色提示线错误
将jsp页面关闭:点击"X"号,例如图中的index.jsp页面的”X"号,或者右键—“close"也可以. 双击jsp页面:重新启动页面,页面的错误提示线 ...
- 温习 socket http tcp
Socket是一个接口,可以实现TCP或者UDP的传输HTTP是协议 资料: 1.TCP/IP连接 手机能够使用联网功能是因为手机底层实现了TCP/IP协议,可以使手机终端通过无线网络建立TCP连接. ...
- webpack+react实现echarts可视化配置
先上效果 开发环境要求 需要事先安装node及npm 前期准备 1.创建文件夹react-echarts-editor2.在项目根目录(以下称根目录)下创建src目录3.在项目根目录下创建dist目录 ...
- 9.9递归和动态规划(九)——N皇后
/** * 功能:打印八皇后在8*8棋盘上的各种摆法.当中每一个皇后都不同行.不同列,也不在对角线上. * 这里的"对角线"指的是全部的对角线,不仅仅是平分整个棋盘的那两条对角 ...
- Ajax核心对象——高速上手XmlHttpRequest
引言: 非TGB的.直接跳过吧-- 从开学结束JQuery之后,计算机的进度停了一段时间.某天无聊的时候,又又一次把BS的东西拿过来看了看. 发现里面有非常多既熟悉又陌生的东西. 在学习王兴魁老师的A ...
- jQuery Easy UI ProgressBar(进度条)组件
ProgressBar(进度条)组件,这个还是挺好玩的.我们在自己做点什么的时候常常能用到,比方上传下载文件.导入导出文档啊.加载网页等等. 应用场景非常多,使用起来还非常easy. 演示样例: &l ...