2017青岛网络赛1008 Chinese Zodiac
Chinese Zodiac
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 2451 Accepted Submission(s): 1645
Victoria is married to a younger man, but no one knows the real age difference between the couple. The good news is that she told us their Chinese Zodiac signs. Their years of birth in luner calendar is not the same. Here we can guess a very rough estimate
of the minimum age difference between them.
If, for instance, the signs of Victoria and her husband are ox and rabbit respectively, the estimate should be 2 years.
But if the signs of the couple is the same, the answer should be 12 years.
the number of test cases.
For each test case a line of two strings describes the signs of Victoria and her husband.
ox rooster
rooster ox
dragon dragon
4
12
Statistic | Submit | Clarifications | Back
题意:十二生肖大循环
思路:比较水
#include <iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
vector< string>vec;
vec.push_back("rat");
//vec[0].second=1;
vec.push_back("ox");
//vec[1].second=2;
vec.push_back("tiger");
//vec[2].second=3;
vec.push_back("rabbit");
//vec.push_back("monkey");
vec.push_back("dragon");
vec.push_back("snake");
vec.push_back("horse");
vec.push_back("sheep");
vec.push_back("monkey");
vec.push_back("rooster");
vec.push_back("dog");
vec.push_back("pig");
int t;
cin>>t;
while(t--)
{
string str1,str2;
cin>>str1>>str2;
int cnt1,cnt2;
for(int i=0;i<=11;i++)
{
if(vec[i]==str1)
{
cnt1=i+1;
break;
}
}
for(int j=0;j<=11;j++)
{
if(vec[j]==str2)
{
cnt2=j+1;
break;
}
}
if(cnt2-cnt1>0)
cout<<cnt2-cnt1<<endl;
else
cout<<cnt2-cnt1+12<<endl;
}
}
2017青岛网络赛1008 Chinese Zodiac的更多相关文章
- HDU 6212 Zuma 2017青岛网络赛 区间DP
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6212 解法:看了眼题就发现这个BZOJ 1032不是一毛一样?但是BZOJ上那是个巨坑,数据有错,原来 ...
- 2017青岛网络赛1011 A Cubic number and A Cubic Number
A Cubic number and A Cubic Number Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/3276 ...
- 2017 青岛网络赛 Chenchen, Tangtang and ZengZeng
Chenchen, Tangtang and ZengZeng are starting a game of tic-tac-toe, played on a 3 × 3 board. Initial ...
- 2017 ACM/ICPC Asia Regional Qingdao Online - 1008 Chinese Zodiac
2017-09-17 13:28:04 writer:pprp 签到题:1008 Chinese Zodiac #include <iostream> #include <strin ...
- HDU 4745 Two Rabbits (2013杭州网络赛1008,最长回文子串)
Two Rabbits Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Tota ...
- HDU 5880 Family View (2016 青岛网络赛 C题,AC自动机)
题目链接 2016 青岛网络赛 Problem C 题意 给出一些敏感词,和一篇文章.现在要屏蔽这篇文章中所有出现过的敏感词,屏蔽掉的用$'*'$表示. 建立$AC$自动机,查询的时候沿着$fa ...
- 2017乌鲁木齐网络赛 j 题
题目连接 : https://nanti.jisuanke.com/t/A1256 Life is a journey, and the road we travel has twists and t ...
- hdu 6152 : Friend-Graph (2017 CCPC网络赛 1003)
题目链接 裸的结论题.百度 Ramsey定理.刚学过之后以为在哪也不会用到23333333333,没想到今天网络赛居然出了.顺利在题面更改前A掉~~~(我觉得要不是我开机慢+编译慢+中间暂时死机,我还 ...
- 2017 ICPC网络赛(西安)--- Xor
题目连接 Problem There is a tree with n nodes. For each node, there is an integer value ai, (1≤ai≤1,000 ...
随机推荐
- hdu 5073 推公式相邻质心转换
#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 51000 int cmp(co ...
- Linux下汇编语言学习笔记40 ---
这是17年暑假学习Linux汇编语言的笔记记录,参考书目为清华大学出版社 Jeff Duntemann著 梁晓辉译<汇编语言基于Linux环境>的书,喜欢看原版书的同学可以看<Ass ...
- 硬盘安装Win 7系统Windows 7 系统硬盘安装教程(图解)
目前,win 7的市场占有率即将超过XP成为了第一大系统,很多人也用上了win 7,你是不是也还是徘徊呢?是否因为XP用习惯了,或者是不会安装 win7呢?win7安装其实不麻烦,不管是什么系统,安装 ...
- [bzoj3991][SDOI2015]寻宝游戏_树链的并_倍增lca_平衡树set
寻宝游戏 bzoj-3991 SDOI-2015 题目大意:题目链接. 注释:略. 想法:我们发现如果给定了一些点有宝物的话那么答案就是树链的并. 树链的并的求法就是把所有点按照$dfs$序排序然后相 ...
- cn_windows_10_multiple_editions_version_1607_updated_jul_2016_x64
ed2k://|file|cn_windows_10_multiple_editions_version_1607_updated_jul_2016_x64_dvd_9056935.iso|43471 ...
- MySQL架构优化实战系列4:SQL优化步骤与常用管理命令
- how to read openstack code
本文的目的不是介绍openstack.我们这里假设你已经知道了openstack是什么,能够做什么.所以目的是介绍如何阅读openstack的代码.通过读代码来进一步学习openstack. 转载要求 ...
- CentOS6 设置AliNetflow 环境
CentOS6 设置AliNetflow 环境 Install OS 这一步略过. 只要保证操作系统是CentOS6.4 并且网络通畅 Install Python2.7.8 设置YUM 我的网络环境 ...
- 省市县三级联动js代码
省市县三级联动菜单,JS全国省市县(区)联动代码,一般可以用于用户注册或分类信息二手交易网站,需要的朋友直接复制代码就可以用了,不过有朋友反馈说缺少某些城市,具体缺少哪个尚不知,请想用的朋友自己补全吧 ...
- MySQL 中间层 Atlas MySQL
Atlas MySQL 详细介绍 Atlas是由 Qihoo 360, Web平台部基础架构团队开发维护的一个基于MySQL协议的数据中间层项目.它在MySQL官方推出的MySQL-Proxy 0. ...