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. ...
随机推荐
- Android旋转屏幕后国际化语言失效的解决的方法
本文已同步至个人博客:liyuyu.cn 近期在项目中使用到了国际化多语言(英文+中文),但在使用时发现了一个问题.当屏幕旋转后.APP语言(中文)自己主动转换为了系统语言(英文).设置了Activi ...
- oracle之ROWNUM的查询应用
1 在ORACLE数据库中,ROWNUM是ORACLE数据库为查询结果加入的一个伪列.起始值为1.经常使用来处理查询结果的分页. 2 因为ROWNUM的特殊性,使用时候一般是分三层: 第一层:先进行查 ...
- CCNP路由实验之十 组播(多播)
CCNP路由实验之十 组播(多播) 种方法: 在交换机上配置静态的多播MAC地址到用户接口的映射 使用CGMP.执行CGMP的多播路由器能够将用户发送给自己 ...
- JSP脚本连接数据库
入门 简单的jsp文件 <%-- Created by IntelliJ IDEA. User: e550 Date: 2017/1/9 Time: 23:24 To change this t ...
- 英语影视台词---三、Cinema Paradiso
英语影视台词---三.Cinema Paradiso 一.总结 一句话总结:天堂电影院 1.Alfredo: No, Toto. Nobody said it. This time it's all ...
- delete 用法总结
// delete 删除 // 语法: boolean delete 数据; // 在当前作用域上删除数据 // 用法: // 1, 删除数组中的一个元素 // 2, 删除一个对象的属性或方法 // ...
- js数组去重的常用方法总结
最近几天朋友面试了几家,笔试题都做了关于数组去重的问题,自己在网上收集整理了一些去重的方法来学习下,感觉换不错哈!!!第一种方法: function oSort(arr){ var n = []; / ...
- Xamarin大佬的地址
https://www.cnblogs.com/hlx-blogs/p/7266098.html http://www.cnblogs.com/GuZhenYin/p/6971069.html
- 1.9 Python基础知识 - 数值运算
一.数值运算 在Python中有丰富的算术运算,这使得Python在科学计算领域有着很高的地位,Python可以提供包括四则运算在内的各种算术运算. 算术运算符 运算符 含义 说明 优先级 实例 ...
- asp.net MVC4.0中几种控制器的区别
空的MVC控制器MVC控制器的读/写操作和视图,使用实体框架MVC控制器带空的读/写操作空API控制器API控制器的读/写操作和视图,使用实体框架API控制器带空的读/写操作