結果

問題 No.87 Advent Calendar Problem
ユーザー is_eri23
提出日時 2014-12-22 21:52:31
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 768 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,680 KB
最終ジャッジ日時 2024-06-12 03:46:35
合計ジャッジ時間 1,681 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 RE * 22
権限があれば一括ダウンロードができます

ソースコード

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