結果

問題 No.87 Advent Calendar Problem
ユーザー mban
提出日時 2017-01-07 20:44:36
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,088 bytes
コンパイル時間 940 ms
コンパイル使用メモリ 110,268 KB
実行使用メモリ 27,972 KB
最終ジャッジ日時 2024-12-17 17:09:07
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;


class Magatro
{
    static long N = long.Parse(Console.ReadLine());
   static void Main() {
       long  cnt = 0;
        long year = N - 2014;
        long loop = year/400;
        long amari = year % 400;
        long a = 0;
        for(int i = 1; i <= 400; i++)
        {
            if (i%4==0)
            {
                if (1 % 400 == 0 || i % 100 != 0)
                {
                    cnt++;
                }
            }
            cnt++;
            if (cnt % 7 == 0) a++;
        }
        long ans = 0;
        ans += loop * a;
        cnt = 0;
        for(int i = 1; i <= amari; i++)
        {
            if (i % 4 == 0)
            {
                if (1 % 400 == 0 || i % 100 != 0)
                {
                    cnt++;
                }
            }
            cnt++;
            if (cnt % 7 == 0) ans++;
        }
        Console.WriteLine(ans);
    }
    
}
0