HDU 6045 (2017 多校训练赛2 1001)Is Derek lying?
来源:互联网 发布:用eclipse写java 编辑:程序博客网 时间:2024/05/29 16:36
2017 Multi-University Training Contest - Team 2 1001
Is Derek lying?
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0 Accepted Submission(s):
Problem Description
Input
The first line consists of an integer T ,represents the number of test cases.
For each test case,there will be three lines.
The first line consists of three integersN ,X ,Y ,the meaning is mentioned above.
The second line consists ofN characters,each character is “A ” “B ” or “C ”,which represents the answer of Derek for each question.
The third line consists ofN 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
For each test case,there will be three lines.
The first line consists of three integers
The second line consists of
The third line consists of
Data Range:
Output
For each test case,the output will be only a line.
Please print “Lying ” if you can make sure that Derek is lying,otherwise please print “Not lying ”.
Please print “
Sample Input
23 1 3AAAABC5 5 0ABCBCACBCB
Sample Output
Not lyingLying
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;char aima[800000],aimb[800000];int abs(int a){ return a>0?a:-a;}int main(){ int T; scanf("%d",&T); while(T--) { int n,a,b; scanf("%d%d%d",&n,&a,&b); int sam=0; scanf("%s",aima);scanf("%s",aimb); for(int i=0;i<n;i++) if(aima[i]==aimb[i]) sam++; //相同题目数量 int aa=abs(a-b); //分数差距 if(aa<=n-sam&&n-sam<=n-a+n-b) printf("Not lying\n"); else printf("Lying\n"); }}
阅读全文
0 0
- HDU 6045 (2017 多校训练赛2 1001)Is Derek lying?
- HDU-2017 多校训练赛2-1001-Is Derek lying?
- 【多校训练】hdu 6045 Is Derek lying?
- 2017 多校训练第二场 HDU 6045 Is Derek lying?
- 2017 多校训练第二场 HDU 6045 Is Derek lying?(思维)
- 2017多校训练第二场 hdu6045 Is Derek lying
- HDU 2017 多校联赛2 1001 Is Derek lying?
- Is Derek lying?(HDU 6045)
- HDU 6045 Is Derek lying?(思维)
- HDU 6045 Is Derek lying?(水~)
- HDU 6045 Is Derek lying?
- hdu 6045 Is Derek lying?
- HDU 6045 Is Derek lying?
- hdu--6045 Is Derek Lying
- hdu 6045 Is Derek lying?
- HDU 6045 Is Derek lying?【】
- HDU 6045 Is Derek lying?
- HDU-6045-Is Derek lying?
- JAVA正则表达式:Pattern类与Matcher类详解(转)
- Charles最新版破解注册方法
- bzoj1013——球形空间生成器(高斯消元)
- jetpack刷到TX2上后,NVIDIA_CUDA-8.0_Samples中示例不能用问题
- 17暑假多校联赛2.1 HDU 6045 Is Derek lying?
- HDU 6045 (2017 多校训练赛2 1001)Is Derek lying?
- 字符串长度乘积最大值 位操作
- Android 使用第三方SDK—友盟实现分享功能
- 如何学习技术(任何东西),重点是什么(转自知乎)
- SpringMVC
- vue-cli安装规范
- 杭电多校 1011 Regular polygon! 题解报告
- 使用 acl 库编写多线程应用程序
- Spark编程之基本的RDD算子coalesce, repartition, checkpoint