HDU6045+Is Derek lying?(思路)+多校联赛第二场
来源:互联网 发布:全国心智障碍者数据 编辑:程序博客网 时间:2024/04/27 13:51
Is Derek lying?
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1000 Accepted Submission(s): 545
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
Source
2017 Multi-University Training Contest - Team 2
Recommend
liuyiding | We have carefully selected several similar problems for you: 6055 6054 6053 6052 6051
#include<stdio.h>#include<iostream>#include<algorithm>#include<string.h>#include<math.h>using namespace std;char a[100010];char b[100010];int main(){ int t,n,m,x,y,sum; scanf("%d",&t); while(t--) { scanf("%d%d%d",&n,&x,&y); sum=0; scanf("%s",a); scanf("%s",b); for(int i=0; i<n; i++) { if(a[i]==b[i]) sum++; } if(x<y) { m=x; x=y; y=m; } if((x+y-sum<=n)&&(x-y+sum<=n)) printf("Not lying\n"); else printf("Lying\n"); }}
阅读全文
0 0
- HDU6045+Is Derek lying?(思路)+多校联赛第二场
- HDU6045 Is Derek lying?(规律,2017 HDU多校联赛 第2场)
- 2017多校训练第二场 hdu6045 Is Derek lying
- 2017杭电多校联赛第二场-Is Derek lying?(hdu6054)
- 【多校联合】(HDU6045)Is Derek lying?
- Hdu6045 Is Derek lying?(2017多校第2场)
- hdu6045 Is Derek lying
- HDU6045-Is Derek lying?
- HDU6045-Is Derek lying?
- hdu6045 Is Derek lying?
- hdu 多校联赛 Is Derek lying?
- 2017暑期多校 HDU6045 Is Derek lying?
- hdu6045-思维-Is Derek lying?
- HDU 2017 多校联赛2 1001 Is Derek lying?
- HDU 2017多校联赛-Is Derek lying?
- 2017 杭电多校联赛第二场 1001 Is Derek lying? HDU 6045
- 2017多校2(hdu6045)Is Derek lying?
- 2017多校联合第二场 1001题 hdu 6045 Is Derek lying?
- Java实战训练(一)
- msf之SNMP的扫描与枚举
- KVM安装报错Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
- canvas图片体积压缩
- Python3 异常处理
- HDU6045+Is Derek lying?(思路)+多校联赛第二场
- Find The Multiple(poj 1426)
- LinkedHashMap原理分析
- 104/111 Maximum/Minimum Depth of Binary Tree(二叉树求深度)
- 玩玩JFinal第一发
- 批处理入门手册之批处理常用DOS命令篇(echo、rem、cd、dir)
- Python中graphics不存在,解决办法
- 图片展示
- 图的存储结构之邻接表