結果

問題 No.87 Advent Calendar Problem
コンテスト
ユーザー 6soukiti29
提出日時 2017-08-16 14:59:40
言語 Nim
(2.2.6)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 402 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,267 ms
コンパイル使用メモリ 67,228 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-19 19:54:41
合計ジャッジ時間 3,147 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #
raw source code

import sequtils,strutils

var
    N = stdin.readline.parseBiggestInt
    d = 3
    m = min(N, 2014 + 400 * 7)
    cnt : int64= 0
for i in 2015..m:
    if i mod 400 == 0:
        d = (2 + d) mod 7
    elif i mod 100 == 0:
        d = (1 + d) mod 7
    elif i mod 4 == 0:
        d = (2 + d) mod 7
    else:
        d = (1 + d) mod 7
    if d == 3:
        cnt += (N - i.int64) div (400 * 7) + 1
echo cnt
0