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. MS08_067漏洞测试——20145301

    MS08_067漏洞测试 实验步骤 search MS08_067查看相关信息 show payloads命令查找需要的攻击载荷 选择generic/shell_reverse_tcp来获取漏洞主机的 ...

  2. Python3基础 os mkdir 创建一层文件夹 在有父目录的情况下创建子目录

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  3. 解决Android Studio Conflict with dependency 'com.android.support:support-annotations'报错

    解决Android Studio Conflict with dependency 'com.android.support:support-annotations'报错 在Android Studi ...

  4. linux下保存下位机输出的串口信息为文件

    linux下保存下位机输出的串口信息为文件 1.stty -F /dev/ttyUSB0 raw (转换成raw模式) 2.stty -F /dev/ttyUSB0 speed 115200 (设置波 ...

  5. hdu4528 小明系列故事——捉迷藏(记录状态的BFS)题解

    思路: 一道BFS题,和以前的BFS有点不同,这里的vis数组需要记录每次走时的状态,所以开了3维,只对该状态下的vis修改. 注意坑点:S的位置是可以走的 代码: #include<queue ...

  6. 【第三十七章】 springboot+docker(手动部署)

    一.下载centos镜像 docker pull hub.c.163.com/library/centos:latest docker tag containId centos:7 docker ru ...

  7. HDU 1874 畅通工程续(最短路训练

    因为数据比较小 所以flyod spfa dijkstra 多可以过 Floyd #include <bits/stdc++.h> using namespace std; const i ...

  8. Codeforces Round #530 (Div. 1)

    A - Sum in the tree 就是贪心选尽量让上面的点权尽量大,那么对于偶数层的点,其到根节点的和即为所有儿子中的最大值. #include<bits/stdc++.h> usi ...

  9. Visual Studio 项目模板制作(一)

    我们编写项目的时候,很多时候都是在写重复代码,比如一个比较完整的框架,然后下面有很多代码都是重复的Copy,其实我们可以利用Visual Studio的模板替我们干这些活,我们只要关注项目具体的业务就 ...

  10. ZOJ 3469 Food Delivery(区间DP)

    https://vjudge.net/problem/ZOJ-3469 题意:在一条直线上有一个餐厅和n个订餐的人,每个人都有随时间上升的不满意值,从餐厅出发,计算出送完时最小的不满意值总和. 思路: ...