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. ...
随机推荐
- WEB前端,混合排版,有的宽有的窄,滚动会出现空白处,怎么办。
多数时候出现空白都是由于有滚动栏滚到一边就会产生空白. overflow-x: hidden; 在最大图的那个div里写这句.
- [python]pip坏了怎么办?
今天,给一位新同事配置pip,用get-pip.py安装之后.出现错误: raise DistributionNotFound(req) # XXX put more info here pkg_r ...
- Android LruCache 压缩图片 有效避免程序OOM
转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/9316683 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工, ...
- .net core的安装
安装完成后的路径在C:\Program Files\dotnet https://github.com/dotnet/cli/issues/390 ===2017年06月29日=== 安装成功之后,配 ...
- Hadoop的单节点集群详细启动步骤
见,如下博客 hadoop-2.2.0.tar.gz的伪分布集群环境搭建(单节点) 很简单,不多赘述.
- 洛谷P4093 [HEOI2016/TJOI2016]序列
题目描述 佳媛姐姐过生日的时候,她的小伙伴从某宝上买了一个有趣的玩具送给他.玩具上有一个数列,数列中某些项的值可能会变化,但同一个时刻最多只有一个值发生变化.现在佳媛姐姐已经研究出了所有变化的可能性, ...
- C/C++(C++重载,默认参数,引用)
C++重载详解 重载就是同名而非同义,具体意义根据上下文的语境而言. 重载规则: 1,函数名相同. 2,参数个数不同,参数的类型不同,参数顺序不同,均可构成重载. 3,返回值类型不同则不可以构成重载. ...
- CodeChef November Challenge 2013 部分题解
http://www.codechef.com/NOV13 还在比...我先放一部分题解吧... Uncle Johny 排序一遍 struct node{ int val; int pos; }a[ ...
- Java技术——Java泛型详解(转)
); for (int i = 0; i < list.size(); i++) { String name = (String) list.get(i); //取出Integer时,运行时出现 ...
- CODEVS——T 1404 字符串匹配
http://codevs.cn/problem/1404/ 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 大师 Master 题解 查看运行结果 题目描述 Desc ...