【多校训练】hdu 6045 Is Derek lying?
来源:互联网 发布:和彩云管家 网络异常 编辑:程序博客网 时间:2024/05/16 08:24
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
题意:
给出n道题,A和B的分数,再给出两个人的选项。判断是否有这种可能。
思路:
两人不同的题数不能小于分差,并且如果一题不同,那两人这题的得分和最多为1,如果一题相同,得分和最多为2,总得分和必须不小于总分和。
//// main.cpp// 1001//// Created by zc on 2017/7/27.// Copyright © 2017年 zc. All rights reserved.//#include <iostream>#include<cstdio>#include<iostream>#include<cmath>#include<cstring>using namespace std;const int N=110000;char s1[N],s2[N];int main(int argc, const char * argv[]) { int T; cin>>T; while(T--) { int n,x,y; scanf("%d%d%d",&n,&x,&y); scanf("%s%s",s1,s2); int dif=0; for(int i=0;i<n;i++) if(s1[i]!=s2[i]) dif++; if(dif<abs(x-y)||dif+(n-dif)*2<(x+y)) printf("Lying\n"); else printf("Not lying\n"); }}
阅读全文
0 0
- 【多校训练】hdu 6045 Is Derek lying?
- HDU 6045 (2017 多校训练赛2 1001)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?
- 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)
- 无刷新实现文件下载,同时带有错误提示
- SSM框架运行原理解析
- 浅谈字节对齐和具体实例
- JavaScript Date(日期)对象
- Android Studio dependencies依赖
- 【多校训练】hdu 6045 Is Derek lying?
- SpringBoot入门系列:第五篇 JPA mysql
- poj Counterfeit Dollar假币错解
- How many integers can you find HDU
- 如何快速学习掌握PLC
- Python学习笔记(一)三步走安装pip
- 【跟着stackoverflow学Pandas】Select rows from a DataFrame based on values in a column -pandas 筛选
- IEDA学习之Maven项目导入idea步骤详解
- 正则表达式