1061 Dating (20 分)
Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange strings are actually referring to the coded time Thursday 14:04 -- since the first common capital English letter (case sensitive) shared by the first two strings is the 4th capital letter D, representing the 4th day in a week; the second common character is the 5th capital letter E, representing the 14th hour (hence the hours from 0 to 23 in a day are represented by the numbers from 0 to 9 and the capital letters from A to N, respectively); and the English letter shared by the last two strings is s at the 4th position, representing the 4th minute. Now given two pairs of strings, you are supposed to help Sherlock decode the dating time.
Input Specification:
Each input file contains one test case. Each case gives 4 non-empty strings of no more than 60 characters without white space in 4 lines.
Output Specification:
For each test case, print the decoded time in one line, in the format DAY HH:MM, where DAY is a 3-character abbreviation for the days in a week -- that is, MON for Monday, TUE for Tuesday, WED for Wednesday, THU for Thursday, FRI for Friday, SAT for Saturday, and SUN for Sunday. It is guaranteed that the result is unique for each case.
Sample Input:
3485djDkxh4hhGE
2984akDfkkkkggEdsb
s&hgsfdk
d&Hyscvnm
Sample Output:
THU 14:04
分析: 卡了好久,因为case sensitive,这个意思是区分大小写。。另外capital letter是大写字母的意思
/**
* Copyright(c)
* All rights reserved.
* Author : Mered1th
* Date : 2019-02-24-15.27.28
* Description : A1061
*/
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<unordered_set>
#include<map>
#include<vector>
#include<set>
using namespace std;
map<char,int> hashtable;
]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
int main(){
#ifdef ONLINE_JUDGE
#else
freopen("1.txt", "r", stdin);
#endif
string s1,s2,s3,s4;
cin>>s1>>s2>>s3>>s4;
int len1=s1.size(),len2=s2.size(),len3=s3.size(),len4=s4.size();
int i;
;i<len1&&i<len2;i++){
if(s1[i]==s2[i] && s1[i]>='A' &&s1[i]<='G'){
cout<<we[s1[i]-'A']<<" ";
i++;
break;
}
}
for(i;i<len1&&i<len2;i++){
if(s1[i]==s2[i]){
'){
printf(');
break;
}
else if(s1[i]>='A'&&s1[i]<='N'){
printf();
break;
}
}
}
;i<len3&&i<len4;i++){
if(s3[i]==s4[i]&&isalpha(s3[i])){
printf("%02d",i);
break;
}
}
;
}
1061 Dating (20 分)的更多相关文章
- PAT 甲级 1061 Dating (20 分)(位置也要相同,题目看不懂)
1061 Dating (20 分) Sherlock Holmes received a note with some strange strings: Let's date! 3485djDk ...
- PAT Basic 1014 福尔摩斯的约会 (20 分) Advanced 1061 Dating (20 分)
大侦探福尔摩斯接到一张奇怪的字条:我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm.大侦探很快就明白了,字条上奇 ...
- 【PAT甲级】1061 Dating (20 分)
题意: 给出四组字符串,前两串中第一个位置相同且大小相等的大写字母(A~G)代表了周几,前两串中第二个位置相同且大小相等的大写字母或者数字(0~9,A~N)代表了几点,后两串中第一个位置相同且大小相等 ...
- PAT甲级——1061 Dating (20分)
Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkg ...
- 1061 Dating (20分)
Sherlock Holmes received a note with some strange strings: Let's date! 3485djDkxh4hhGE 2984akDfkkkkg ...
- 1061. Dating (20)
#include <stdio.h> #include <map> #include <string.h> #include <ctype.h> usi ...
- PAT (Advanced Level) 1061. Dating (20)
简单模拟. #include<stdio.h> #include<string.h> ],s2[],s3[],s4[]; ][]={"MON ", &quo ...
- PAT甲题题解-1061. Dating (20)-字符串处理,水水
#include <iostream> #include <cstdio> #include <algorithm> #include <string.h&g ...
- pat1061. Dating (20)
1061. Dating (20) 时间限制 50 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Sherlock Holmes ...
随机推荐
- Linux IO模式-阻塞io、非阻塞io、多路复用io
一 概念说明 在进行解释之前,首先要说明几个概念: - 用户空间和内核空间 - 进程切换 - 进程的阻塞 - 文件描述符 - 缓存 I/O 用户空间与内核空间 现在操作系统都是采用虚拟存储器,那么对3 ...
- Magento里显示指定分类的所有子分类
如何在magento左侧导航栏里显示父分类和子分类名,如果需要在magento显示指定分类的所有子分类,可以用以下的方法: <!--? php if($category--->hasC ...
- os.path.join 用法
写在前面的话:看大家阅读量这么大,也应该在放点干货来了~~ 获取层级路径,直到可以获取文件夹下面的文件,多一个判断就行了: level1_list = [os.path.join(base_path, ...
- pymysql中如何将动态的插入数据库中
data = { ', 'name': 'zengsf', 'age': 20 } table = 'students' #获取到一个以键且为逗号分隔的字符串,返回一个字符串 keys = ', '. ...
- 电脑技巧合集 - imsoft.cnblogs
● 如何制作网页● 教你建一个别人打不开的文件夹 ● 只改一个值!马上加快宽带上网速度 ● 在电脑右下角显示你的名字● XP系统如何加快开机速度● 连接宽带时出错表示的意思 ● 恢复丢失数据的方法● ...
- .NET 中使用 TaskCompletionSource 作为线程同步互斥或异步操作的事件
你可以使用临界区(Critical Section).互斥量(Mutex).信号量(Semaphores)和事件(Event)来处理线程同步.然而,在编写一些异步处理函数,尤其是还有 async 和 ...
- (3)socket的基础使用(基于UDP协议)
服务端代码 import socket server =socket.socket(socket.AF_INET,socket.SOCK_DGRAM) #SOCK_DGRAM就是数据报,UDP就是数据 ...
- ZOJ3545 Rescue the Rabbit
分析 未知定长串中不同已知模板串的出现次数问题,一般做法是AC自动机上dp. 考虑背包,\(dp(i,j,k)\)表示当前串长为\(i\),在AC自动机上对应节点\(j\),已匹配的模板串的状态为\( ...
- leetcode -day28 Unique Binary Search Trees I II
1. Unique Binary Search Trees II Given n, generate all structurally unique BST's (binary search t ...
- MongoDB注册Windows服务启动
下载MongoDB安装到:E:\Work_App\MongoDB 这个目录 安装:E:\Work_App\MongoDB (安装在专门的目录中) 配置: 1.在E:\Work_App\MongoDB\ ...