B. The Same Calendar 题目连接: http://www.codeforces.com/contest/678/problem/B Description The girl Taylor has a beautiful calendar for the year y. In the calendar all days are given with their days of week: Monday, Tuesday, Wednesday, Thursday, Friday,…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequ…
传送门 Description You are given names of two days of the week. Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next mon…
题目链接:http://codeforces.com/problemset/problem/331/C1 这是第一次参加codeforces比赛(ABBYY Cup 3.0 - Finals (online version))成功AC的题目(n ≤ 106),解题的突破口是:Take the magic number, subtract a digit from it (the digit must occur in the number) and get a new magic number.…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given names of two days of the week. Please, determine whether it is possible that during some non-leap year the first day of some month…
题目链接: http://codeforces.com/contest/724 A. Checking the Calendar time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given names of two days of the week. Please, determine whether it is…
Codeforces Round #117 (Div. 2) 代码 Codeforces Round #117 (Div. 2) A. Battlefield any trench in meters numerically does not exceed b. 这个条件意味着每次都是在蓄能开始时走向下一条线段,也就是说每条线段相当于花费了\(a+b\)的时间. bfs,用\(d_i\)表示到达线段i需要经过最少的线段条数,到达\(B\)的时候直接计算欧几里得距离. B. Vasya's Cal…
A. Checking the Calendar 题目连接: http://codeforces.com/contest/724/problem/A Description You are given names of two days of the week. Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the f…
B - Calendar Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 304B Appoint description: System Crawler (2015-05-23) Description Calendars in widespread use today include the Gregorian c…
1.Date 类 java.util.Date是一个"万能接口",它包含日期.时间,还有毫秒数,如果你只想用java.util.Date存储日期,或者只存储时间,那么,只有你知道哪些部分的数据是有用的,哪些部分的数据是不能用的. 1.1 Date的构造方法 Date 是我们使用的最多的一个日期类,Date提供的构造方法在官方API中有一下几种: Date 类提供了多种构造方法,但是目前有很多方法都已经不建议使用 public Date() { this(System.currentTi…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters. There is…