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. ...
随机推荐
- ruby redis的集群管理器
#========================================================================================== # => ...
- 记录一下Memcached的用法:
首先就是先要配置Memcached,这个回头再写. https://zhidao.baidu.com/question/809745125827797732.html https://www.cnbl ...
- 如何在Ubuntu14.04中创建Python虚拟环境
在Ubuntu14.04中安装Python相对比较容易些,最简单的安装方法就是apt-get安装了,具体的教程可以戳这篇文章:在Ubuntu14.04中如何安装Python3和切换py2和py3环境. ...
- @Accessors
@Accessors 作用:存取器,用于配置getter和setter方法的生成结果 三个属性:fluent.chain.prefix 1.fluent:流畅的,设置为true,getter和sett ...
- du---是对文件和目录磁盘使用的空间查看
du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的. 语法 du [选项][文件] 选项 -a或-all 显示目录中个 ...
- MySQL中好用的GROUP_CONCAT函数
今天看到同事的代码,又学到了一个有用的函数,刚看的时候不太懂,就搜了下用法,看下面这篇文章讲的挺详细就直接转载了,我也写不那么好,呵呵,感谢作者的无私奉献. http://blog.sina.com. ...
- RvmTranslator6.0 - Dassault Systemes 3DXML
RvmTranslator6.0 - Dassault Systemes 3DXML eryar@163.com 1. Introduction RvmTranslator can translate ...
- 【Android】利用自己定义View的重绘实现拖动移动,获取组件的尺寸
以下利用一个app来说明怎样利用自己定义View的重绘实现拖动移动.获取组件的尺寸. 例如以下图,触摸拖动,或者轻轻点击屏幕都能移动图片.假设碰到文字,则会弹出提示. 这里是利用自己定义View的重绘 ...
- [51Nod]NOIP2018提高组省一冲奖班模测训练(三) 题解
链接 A.Anan的派对 题意:Anan想举办一个派对.Anan的朋友总共有 n 人.第i个人如果参加派对会得到 \(c_i\) 的快乐值,除他自己外每多一个人参加他会减少 \(d_i\) 的快乐值. ...
- 2.CURL命令
转自:https://blog.csdn.net/ligang2585116/article/details/46548617 curl是一种命令行工具,作用是发出网络请求,然后得到和提取数据,显示在 ...