結果

問題 No.87 Advent Calendar Problem
ユーザー is_eri23is_eri23
提出日時 2014-12-22 21:52:31
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 768 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 6,716 KB
実行使用メモリ 7,108 KB
最終ジャッジ日時 2023-09-02 21:29:59
合計ジャッジ時間 2,200 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 17 ms
6,996 KB
testcase_04 AC 17 ms
6,916 KB
testcase_05 AC 17 ms
6,992 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 18 ms
7,108 KB
testcase_18 AC 17 ms
7,096 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from Queue import * # Queue, LifoQueue, PriorityQueue
from bisect import * #bisect, insort
from collections import * #deque, Counter,OrderedDict,defaultdict
#set([]) 
import math
import copy
import itertools
import string
import sys
import datetime
myread = lambda : map(int,raw_input().split())
#2014 / 7 / 23

def naive_cnt(y1,y2):
    base = datetime.date(2014,7,23)
    ret = 0
    for l in xrange(y1,y2+1):
        now = datetime.date(l,7,23)
        if now.weekday() == base.weekday():
            ret += 1
    return ret

def solver():
    N = int(raw_input())
    x = (N - 2014) / 400
    ans = x * naive_cnt(2014,2014+400-1)
    #print ans
    ans += naive_cnt(x * 400 + 2014,N)
    #print ans
    print ans - 1


if __name__ == "__main__":
    solver()
    
0