杭电暑期多校集训—Is Derek lying?
来源:互联网 发布:ucpaas java短信发送 编辑:程序博客网 时间:2024/05/16 17:45
Is Derek lying?
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3598 Accepted Submission(s): 999
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题意:D和A做n道题,每题选项分别为A,B,C。做完后计算机把D和A的得分告诉D,D再把X,Y(得分)告诉A。下面两组字符串分别表示D和A的答案,判断D是否说谎。#include<cstdio>#include<cstring>#include<cmath>using namespace std;char s1[300010],s2[300010];int main(){ int t; scanf("%d",&t); while(t--){ int a,b,n; scanf("%d %d %d",&n,&a,&b); scanf("%s",s1); scanf("%s",s2); int c=0; for(int i=0;i<n;i++){ if(s1[i]==s2[i]) c++; } if(a+b<=n+c&&abs(a-b)<=n-c){ printf("Not lying\n"); } else{ printf("Lying\n"); } } return 0;}
阅读全文
0 0
- 杭电暑期多校集训—Is Derek lying?
- 2017暑期多校 HDU6045 Is Derek lying?
- hdu 多校联赛 Is Derek lying?
- Is Derek lying?-2017 暑期组队训练赛1-HDU-
- HDU 2017 多校联赛2 1001 Is Derek lying?
- HDU 2017多校联赛-Is Derek lying?
- 【多校联合】(HDU6045)Is Derek lying?
- Is Derek lying?
- Is Derek lying?
- 1001.Is Derek lying?
- hdu6045 Is Derek lying
- HDU6045-Is Derek lying?
- Is Derek lying?
- HDU6045-Is Derek lying?
- Is Derek lying?
- Is Derek lying?
- hdu6045 Is Derek lying?
- Is Derek lying?
- 实习笔记之个人设置界面
- 搬家了-博客园
- UITextField的各种属性,代理方法,常见的使用,纯代码和可视化工具中的都有
- Give Me This Pizza
- Android源码博文集锦4
- 杭电暑期多校集训—Is Derek lying?
- 使用Maven整合Spring+SpringMVC+Hibernate
- * 24种设计模式——组合模式
- 网站打开速度慢的原因分析及对策
- unix网络编程之套接字编程简介
- Web App、Hybrid App与Native App的设计差异
- 收集的伪静态中经常使用的一些参数
- 移动端上传预览压缩图片
- DOCX4J 解析DOCX文档字体格式