Submission #171677


Source Code Expand

Copy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class A
    {
        static void Main(string[] args)
        {
            int y = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int day1 = calc(y, m, d);
            int day2 = calc(2014, 5, 17);
            Console.WriteLine(day2 - day1);
            Console.ReadLine();

        }

        public static int calc(int y, int m, int d)
        {
            if (m <= 2)
            {
                y--;
                m += 12;
            }

            int ans = 365 * y;
            ans += y / 4;
            ans -= y / 100;
            ans += y / 400;
            ans += (306 * (m + 1)) / 10;
            ans += d;
            ans -= 429;
            return ans;
        
        }
    }
}

Submission Info

Submission Time
Task A - 経過日数
User moheiji
Language C# (Mono 2.10.8.1)
Score 100
Code Size 963 Byte
Status AC
Exec Time 134 ms
Memory 7764 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 24
Set Name Test Cases
Sample subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt
All subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt
Case Name Status Exec Time Memory
subtask0_sample01.txt AC 131 ms 7704 KB
subtask0_sample02.txt AC 134 ms 7696 KB
subtask0_sample03.txt AC 130 ms 7708 KB
subtask0_sample04.txt AC 131 ms 7708 KB
subtask1_01.txt AC 133 ms 7704 KB
subtask1_02.txt AC 130 ms 7712 KB
subtask1_03.txt AC 131 ms 7756 KB
subtask1_04.txt AC 131 ms 7708 KB
subtask1_05.txt AC 132 ms 7720 KB
subtask1_06.txt AC 132 ms 7716 KB
subtask1_07.txt AC 130 ms 7752 KB
subtask1_08.txt AC 129 ms 7712 KB
subtask1_09.txt AC 131 ms 7708 KB
subtask1_10.txt AC 131 ms 7692 KB
subtask1_11.txt AC 130 ms 7756 KB
subtask1_12.txt AC 131 ms 7708 KB
subtask1_13.txt AC 132 ms 7744 KB
subtask1_14.txt AC 132 ms 7704 KB
subtask1_15.txt AC 133 ms 7696 KB
subtask1_16.txt AC 132 ms 7704 KB
subtask1_17.txt AC 128 ms 7696 KB
subtask1_18.txt AC 131 ms 7708 KB
subtask1_19.txt AC 133 ms 7764 KB
subtask1_20.txt AC 133 ms 7704 KB