POJ 1008 简单模拟题
e.... 虽然这是一道灰常简单的模拟题、但是米做的时候没有读懂第二个日历的计时方法。然后捏。敲完之后华丽的WA了进一个点。坑点就在一年的最后一天你是该输出本年的。e ...但是我好想并没有。、看discuss里好想被坑的人还不少。总天数能直接整除260的时候。年数要减1。
不喜欢做模拟.....5555....
附代码:
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<map>
using namespace std;
string Maya_name[20] = {"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"};
string Holly_name[21] = {"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
int main()
{
map<string, int>m;
m.clear();
for (int i=0; i<19; ++i)
{
m[Maya_name[i]] = i;
}
map<int, string>mm;
mm.clear();
for (int i=0; i<20; ++i)
{
mm[i+1] = Holly_name[i];
}
int t, total;
int day, year;
char temp;
string month;
while(cin >> t)
{
cout << t << endl;
while(t--)
{
total = 0;
cin >> day >> temp >> month >> year;
int tm = m[month];
total += year * 365 + tm * 20 + day + 1;
// cout << total << "==\n";
year = total / 260;
int tot = total;
tot %= 260;
tm = tot % 20;
if (tm == 0) tm = 20;
day = total % 13;
if (day == 0) day = 13;
if (total % 260 == 0)
{
year -= 1;
}
cout << day << ' ' << mm[tm] << ' ' << year << endl;
}
}
return 0;
}
POJ 1008 简单模拟题的更多相关文章
- 2019浙大校赛--A--Thanks, TuSimple!(简单模拟题)
这题前三段都是一堆吹爆赞助商的屁话,正式题目在图片下边,一个简单模拟题. 题目大意: 有n个男生,m个女生在进行舞会,其中一部分男生祥和比自己矮的女生跳舞,一部分男生想和比自己高的女生跳舞,一部分女生 ...
- UVa 679 小球下落 简单模拟题,树
题目大意:给你一个完全二叉树,并且给他们编号,编号规则为左子树为2*k,右子树为2*k+1,每一个节点 上都有一个开关,初始时开关都处于关闭状态,小球碰到节点就会改变该点的开关的状态.然后给你I个小球 ...
- HDU 4772 Zhuge Liang's Password (简单模拟题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4772 题面: Zhuge Liang's Password Time Limit: 2000/1000 ...
- Crashing Robots POJ 2632 简单模拟
Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is neede ...
- UVA 1594 Ducci Sequence(紫书习题5-2 简单模拟题)
A Ducci sequence is a sequence of n-tuples of integers. Given an n-tuple of integers (a1, a2, · · · ...
- POJ-3078.Shuffle'm Up(简单模拟题)
这道题做了有四个小时吧,今天一整天都处于边玩边学的状态,我很是不喜欢...一开始用了20分钟模拟,过了样例后TLE了,就在考虑是不是判断是否重复判定的数组开大了,结果一直蛙,后面想到了map判重,结果 ...
- HDU 5059 Help him(简单模拟题)
http://acm.hdu.edu.cn/showproblem.php?pid=5059 题目大意: 给定一个字符串,如果这个字符串是一个整数,并且这个整数在[a,b]的范围之内(包括a,b),那 ...
- poj 1068(模拟题)
Parencodings Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 23545 Accepted: 13802 De ...
- HDU 1234 简单模拟题
题目很简单不多说了,我只是觉得这题目的输入方式还是很有特点的 #include <cstdio> #include <cstring> #include <algorit ...
随机推荐
- poj 1274 The Perfect Stal - 网络流
二分匹配传送门[here] 原题传送门[here] 题意大概说一下,就是有N头牛和M个牛棚,每头牛愿意住在一些牛棚,求最大能够满足多少头牛的要求. 很明显就是一道裸裸的二分图最大匹配,但是为了练练网络 ...
- Entity Framework 6 和 MVC5
网站地址: Entity Framework 6 http://msdn.microsoft.com/en-us/data/ef.aspx MVC5 http://www.asp.net ...
- 论文笔记——Channel Pruning for Accelerating Very Deep Neural Networks
论文地址:https://arxiv.org/abs/1707.06168 代码地址:https://github.com/yihui-he/channel-pruning 采用方法 这篇文章主要讲诉 ...
- attr返回被选元素的属性值
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 利用Ajax和Servlet实现输入框提示功能
目的和效果: 输入框输入字符串x,匹配后台传入的数据str,如果str中的元素包含字符串x,则提示. 后台代码: String x = request.ge ...
- 使用rz,sz需要安装lrzsz
... tar zxvf lrzsz-1.12.20.tar.gz 4.进入目录 cd lrzsz-1.12.20 5../configure --prefix=/usr/local/lrzsz 6. ...
- Java中一种无意识的递归
来自: Java编程思想P287 public class Main { /** * @param args */ @Override public String toString() { retur ...
- hdu 2874 Connections between cities 带权lca判是否联通
Connections between cities Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (J ...
- Python matplot画柱状图(一)
图的存在,让数据变得形象化.无论多么复杂的东西,都是简单的组合. import matplotlib.pyplot as plt import numpy as np dict = {'A': 40, ...
- webstorm注册码 永久有效!!! 前端工程师福利
2RRJMBXW33-eyJsaWNlbnNlSWQiOiIyUlJKTUJYVzMzIiwibGljZW5zZWVOYW1lIjoi5b285bK4IHNvZnR3YXJlMiIsImFzc2lnb ...