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 ...
随机推荐
- 20165211 2017-2018-2 《Java程序设计》第4周学习总结
20165211 2017-2018-2 <Java程序设计>第4周学习总结 教材学习内容总结 本周,我学习了书本上第五.六两章的内容,以下是我整理的主要知识. 第五章 子类与继承 子类与 ...
- Educational Codeforces Round 27 A B C
A. Chess Tourney Berland annual chess tournament is coming! Organizers have gathered 2·n chess pla ...
- Educational Codeforces Round 57 (Rated for Div. 2)
我好菜啊. A - Find Divisible 好像没什么可说的. #include<cstdio> #include<cstring> #include<algori ...
- animate动画回调函数
对非动画的实现排队,比如这个css()是要放在回调函数里才能,让前面的动画执行完成后在进行实现 $('button').click(function(event) { $(this).next().a ...
- 关于使用jquery的Ajax结合java的Servlet后台判定用户名是否存在
关于把AJAX加入到注册登录demo中去 2018年3月10日 19:21:23 第一次来SUBWAY真切地打代码. 这次的西红柿汤还是挺好喝的. index.jsp: <%@ page con ...
- DataTables warning: table id=data-table - Requested unknown parameter '3' for row 0.
本文为博主原创,未经允许,不得转载: 在使用jquery 的datatable时,报错在页面弹出弹出框,并提示以下内容: DataTables warning: table id=data-table ...
- java编程内容之开始
java应用程序开发应该掌握的各方面技术 1.初识java,熟悉Eclipse开发工具 2.java语言基础 3.流程控制,数组,字符串,类与对象 4.接口,继承与多态,类的高级特性 5.Java集合 ...
- 网易云音乐综合爬虫python库NetCloud v1版本发布
以前写的太烂了,这次基本把之前的代码全部重构了一遍.github地址是:NetCloud.下面是简单的介绍以及quick start. NetCloud--一个完善的网易云音乐综合爬虫Python库 ...
- Croc Champ 2013 - Round 1 E. Copying Data 分块
E. Copying Data time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...
- python 集合清空
setp = set(["Red", "Green"]) setq = setp.copy() print(setq) setp.clear() print(s ...