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. 20145206邹京儒Exp6 信息搜集与漏洞扫描

    20145206邹京儒Exp6 信息搜集与漏洞扫描 一.实践过程记录 openvas漏洞扫描 1.openvas-check-setup来查看下他的安装状态: 如下图所示:在步骤7中出现错误,显示需要 ...

  2. 20145220韩旭飞《网络对抗》Exp7 网络欺诈技术防范

    20145220韩旭飞<网络对抗>Exp7 网络欺诈技术防范 应用SET工具建立冒名网站 要让冒名网站在别的主机上也能看到,需要开启本机的Apache服务,并且要将Apache服务的默认端 ...

  3. 20165211 学习基础和C语言调查

    20165211 学习基础和C语言调查 理论脱离实践是最大的不幸.--达芬奇 达芬奇,是我眼里最有嫌疑的穿越者. 绘画.天文.雕塑.音乐.发明.建筑,数学.生理.物理.天文.地质--我很难想象有一个人 ...

  4. 2018-2019-1 20189218《Linux内核原理与分析》第六周作业

    向menuOS中增加命令 修改menu目录下的test.c文件,增加自己的函数定义,并在修改main()函数,按照前面的menuconfig的写法写好自己的menuconfig. 我选择的是acces ...

  5. Asterisk1.8 转码策略分析

    最近在修改asterisk转码和编码协商的问题,发现asterisk的转码策略的选择还是有些问题的(基于1.8.9.3版本).——————————————相关的CLI命令转码路径的调试命令:core ...

  6. Spyder clear variable explorer from memory

    https://stackoverflow.com/questions/45853595/spyder-clear-variable-explorer-along-with-variables-fro ...

  7. ubuntu 安装 ftp服务

    1. 更新源列表 ---> sudo apt-get update 2. 安装vsftpd ---> sudo apt-get install vsftpd (安装) ----> s ...

  8. 【第六章】 springboot + 事务

    在实际开发中,其实很少会用到事务,一般情况下事务用的比较多的是在金钱计算方面. mybatis与spring集成后,其事务该怎么做?其实很简单,直接在上一节代码的基础上在相应的方法(通常是servic ...

  9. v-bind绑定属性样式

    一.class的四种绑定方式 1.布尔值的绑定方式 <div id="demo"> <span v-bind:class="{'class-a':isA ...

  10. 有关keras(Ubuntu14.04,python2.7)

    第一部分:安装 由于我的电脑之前已经已经配置好了caffe,因此有关python的一切相关包都已经安装完成.因此,即使不用Anaconda安装依然很简单. sudo pip install tenso ...