QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 256 MB Points totaux : 100

#11343. 夏令时

Statistiques

上个月,xiaodao 和她的朋友 poteko 一起从旧金山飞往上海。在开车去机场的路上,xiaodao 突然发现 poteko 车上的时钟比她手机上的时间快了一个小时。两人可能都是对的,但这怎么可能呢?因为那天是 11 月 6 日,也就是今年夏令时(Daylight Saving Time, DST)的切换日。

夏令时(DST)或称“夏季时间”,是一种在夏季月份将时钟拨快一小时的做法,以便让傍晚的日光持续时间更长。有人认为使用夏令时可以减少总能源消耗。目前并非所有地区都使用夏令时,即使在采用夏令时的地区,具体做法也各不相同。

以加利福尼亚州为例,根据 2005 年美国《能源政策法案》,自 2007 年起,当地时间在 3 月的第二个星期日从太平洋标准时间(PST)切换为太平洋夏令时间(PDT),时间从 02:00 变为 03:00;在 11 月的第一个星期日从太平洋夏令时间(PDT)切换回太平洋标准时间(PST),时间从 02:00 变为 01:00。

由于那天的时间多了一个小时,xiaodao 和 poteko 没有错过航班,但他们觉得这仍然有点令人困惑。有趣的是,xiaodao 回到上海后,在工作中也遇到了一个完全由同样问题引起的程序错误。你将来也可能会遇到夏令时带来的麻烦,所以这道题应运而生,希望它能对你有所帮助。

在不指明是 PST 还是 PDT 的情况下,加利福尼亚州的当地时间在某些情况下可能会产生歧义(例如 2016-11-06 01:25:00)。在本题中,给定一个加利福尼亚州的当地时间,请判断它是“PST”、“PDT”、“Both”(两者皆可)还是“Neither”(两者皆不可)。

输入格式

输入的第一行包含测试用例的数量 $T$。

接下来有 $T$ 个测试用例。每个测试用例包含一行,为一个格式为 YYYY-MM-DD HH:MM:SS 的日期字符串。

输出格式

对于每个测试用例,首先输出一行 Case #x:,其中 $x$ 是测试用例编号(从 1 开始),随后输出结果字符串,结果字符串应为 “PST”、“PDT”、“Both” 或 “Neither” 中的一种。

数据范围

  • $1 \le T \le 1000$
  • 日期合法,且在 “2007-01-01 00:00:00” 到 “2100-12-31 23:59:59” 之间。

样例

样例输入 1

4
2016-03-13 01:59:59
2016-03-13 02:00:00
2016-11-06 00:59:59
2016-11-06 01:00:00

样例输出 1

Case #1: PST
Case #2: Neither
Case #3: PDT
Case #4: Both

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.