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 简单模拟题的更多相关文章

  1. 2019浙大校赛--A--Thanks, TuSimple!(简单模拟题)

    这题前三段都是一堆吹爆赞助商的屁话,正式题目在图片下边,一个简单模拟题. 题目大意: 有n个男生,m个女生在进行舞会,其中一部分男生祥和比自己矮的女生跳舞,一部分男生想和比自己高的女生跳舞,一部分女生 ...

  2. UVa 679 小球下落 简单模拟题,树

    题目大意:给你一个完全二叉树,并且给他们编号,编号规则为左子树为2*k,右子树为2*k+1,每一个节点 上都有一个开关,初始时开关都处于关闭状态,小球碰到节点就会改变该点的开关的状态.然后给你I个小球 ...

  3. HDU 4772 Zhuge Liang&#39;s Password (简单模拟题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4772 题面: Zhuge Liang's Password Time Limit: 2000/1000 ...

  4. Crashing Robots POJ 2632 简单模拟

    Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is neede ...

  5. 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, · · · ...

  6. POJ-3078.Shuffle'm Up(简单模拟题)

    这道题做了有四个小时吧,今天一整天都处于边玩边学的状态,我很是不喜欢...一开始用了20分钟模拟,过了样例后TLE了,就在考虑是不是判断是否重复判定的数组开大了,结果一直蛙,后面想到了map判重,结果 ...

  7. HDU 5059 Help him(简单模拟题)

    http://acm.hdu.edu.cn/showproblem.php?pid=5059 题目大意: 给定一个字符串,如果这个字符串是一个整数,并且这个整数在[a,b]的范围之内(包括a,b),那 ...

  8. poj 1068(模拟题)

    Parencodings Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23545   Accepted: 13802 De ...

  9. HDU 1234 简单模拟题

    题目很简单不多说了,我只是觉得这题目的输入方式还是很有特点的 #include <cstdio> #include <cstring> #include <algorit ...

随机推荐

  1. Package libvirt was not found in the pkg-config search path

    关于pip安装libvirt-python的时候提示Package libvirt was not found in the pkg-config search path的问题解决方法 1.一开始以为 ...

  2. P4879 ycz的妹子

    思路 让你干啥你就干啥呗 查询第x个妹子就get一下再修改 这里稳一点就维护了三个东西,也许两个也可以 代码 #include <iostream> #include <cstdio ...

  3. ZooKeeper与Kafka相关

    Kafka集群搭建: https://www.cnblogs.com/likehua/p/3999538.html https://www.cnblogs.com/mikeguan/p/7079013 ...

  4. LOJ #10222. 「一本通 6.5 例 4」佳佳的 Fibonacci

    题目链接 题目大意 $$F[i]=F[i-1]+F[i-2]\ (\ F[1]=1\ ,\ F[2]=1\ )$$ $$T[i]=F[1]+2F[2]+3F[3]+...+nF[n]$$ 求$T[n] ...

  5. C#学习笔记(十六):索引器和重载运算符

    二维数组如何映射到一维数组 重载运算符 1.算术运算符 2.关系运算符, < 和 > 成对重载 using System; using System.Collections.Generic ...

  6. Facebook广告API系列 Business Manager

    Facebook广告API系列 Business Manager Business Manager,是个很牛叉的东西,有多牛叉呢? 因为facebook已经越来越商业化了,上面的每个账号,页面,往往都 ...

  7. MapReduce程序(一)——wordCount

    写在前面:WordCount的功能是统计输入文件中每个单词出现的次数.基本解决思路就是将文本内容切分成单词,将其中相同的单词聚集在一起,统计其数量作为该单词的出现次数输出. 1.MapReduce之w ...

  8. 线程面试top50题

    转载:java线程面试题: 不管你是新程序员还是老手,你一定在面试中遇到过有关线程的问题.Java语言一个重要的特点就是内置了对并发的支持,让Java大受企业和程序员的欢迎.大多数待遇丰厚的Java开 ...

  9. zepto点透解决思路

    首先看几个链接, http://blog.youyo.name/archives/zepto-tap-click-through-research.html youyo的分析 http://softw ...

  10. WPF基础学习笔记整理 (六) RoutedEvent路由事件

    基础知识: 传统的事件模型中,会在消息触发时将消息通过事件传给事件的订阅者(显式的事件订阅),事件订阅者使用事件处理程序来做出响应.事件订阅者必须能够直接访问到事件的宿主(拥有者). 路由事件的事件的 ...