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 ...
随机推荐
- 20145220韩旭飞《网络对抗》实验五:MSF基础应用
20145220韩旭飞<网络对抗>实验五:MSF基础应用 主动攻击 首先,我们需要弄一个xp sp3 English系统的虚拟机,然后本次主动攻击就在我们kali和xp之间来完成. 然后我 ...
- C# 获取当前IIS请求地址
using System;using System.Collections.Generic;using System.Linq;using System.Web; /// <summary> ...
- 详解C中的volatile关键字【转】
本文转载自:http://www.cnblogs.com/yc_sunniwell/archive/2010/06/24/1764231.html volatile提醒编译器它后面所定义的变量随时都有 ...
- 【第三十五章】 metrics(3)- codahale-metrics基本使用
<!-- metrics --> <dependency> <groupId>io.dropwizard.metrics</groupId> <a ...
- perl入门知识(3)
引用 在很多场合下使用引用传值,能在很大程度上提高代码的运行效率. 定义一个引用在变量名前加”\”就可以了,如: $ra=\$a; $rb=\@b; ...
- UVa 1347 旅行
https://vjudge.net/problem/UVA-1347 思路:用d(i,j)表示第一个人走到i,第二个人走到j,还需要走多长的距离.在这里强制定义i>j,并且每次只能走到i+1. ...
- UVa 11572 唯一的雪花(滑动窗口)
https://vjudge.net/problem/UVA-11572 题意:输入一个长度为n的序列A,找到一个尽量长的连续子序列,使得该序列中没有相同的元素. 思路:很简单的题,也没啥好解释的了. ...
- 项目中的一个分页功能pagination
项目中的一个分页功能pagination <script> //总页数 ; ; //分页总数量 $(function () { // $("#pagination"). ...
- Hibernate 由实体类与配置文件的配置关系生成数据库中的表
import org.hibernate.cfg.Configuration; import org.hibernate.tool.hbm2ddl.SchemaExport; public class ...
- hdu 5587 Array 二分
Array Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem ...