HDU 6045 Is Derek lying?【】
来源:互联网 发布:江苏远洋数据 编辑:程序博客网 时间:2024/06/05 02:24
Is Derek lying?
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1198 Accepted Submission(s): 649
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
#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<cmath>#include<queue>#include<stack>#include<vector>#include<map>#include<set>#include<algorithm>using namespace std;#define ll long long#define ms(a,b) memset(a,b,sizeof(a))#define maxn 510const int M=1e5+10;const int inf=0x3f3f3f3f;const int mod=1e9+7;const double eps=1e-10;ll n,m;char a[M];char b[M];ll x,y;int main(){ int t; scanf("%d",&t); while(t--){ scanf("%lld%lld%lld",&n,&x,&y); scanf("%s",a); scanf("%s",b); int sum=0; for(int i=0,j=0;i<n;i++,j++){ if(a[i]==b[j])sum++; } sum=n-sum; if(abs(x-y)<=sum&&(x+y)<=2*n-sum)printf("Not lying\n"); else printf("Lying\n"); } return 0;}
阅读全文
0 0
- 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?
- Is Derek lying? HDU
- HDU 6045多校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 6054-Is Derek lying?
- Codeforces 835B
- ADB命令
- +、-、*、/、%的使用
- 前缀和--分布函数--cf835c star sky
- Oracle之多表查询
- HDU 6045 Is Derek lying?【】
- Hive基础到高级
- ==、~=、>、<、<=的使用
- 7月31日云栖精选夜读:金融安全资讯精选 2017年第一期:云战略下的安全思维转型与新认知
- hdu 5532 (最长上升子序列)nlogn
- 关于datatables隐藏显示列多次提交后台刷新数据的问题
- 职场不是电视剧,面试学罗子君铁定完蛋!
- or、and的使用
- windows7+visual studio 2013+CUDA7.5 编译caffe+配置matcaffe+配置pycaffe