Submission #171471


Source Code Expand

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

class Program
{
    void Solve()
    {
        int y = reader.Int(), m = reader.Int(), d = reader.Int();
        if (m <= 2) { y--; m += 12; }
        int a = f(2014, 5, 17);
        int b = f(y, m, d);
        Console.WriteLine(a - b);
        Console.ReadLine();
    }

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



    static void Main() { new Program().Solve(); }
    static Reader reader = new Reader(Console.In);

    class Reader
    {
        private readonly TextReader reader;
        private readonly char[] separator = new char[] { ' ' };
        private string[] s = new string[0];
        private int i;
        public Reader(TextReader r) { reader = r; }
        public bool HasNext() { return Enqueue(); }
        public string String() { return Dequeue(); }
        public int Int() { return int.Parse(Dequeue()); }
        public long Long() { return long.Parse(Dequeue()); }
        public double Double() { return double.Parse(Dequeue()); }
        public int[] IntArray() { return Array.ConvertAll(Line().Split(), int.Parse); }
        public int[][] IntGrid(int H) { return Enumerable.Range(0, H).Select(i => IntArray()).ToArray(); }
        public string[] StringArray(int N) { return Enumerable.Range(0, N).Select(i => Line()).ToArray(); }
        public string Line() { return reader.ReadLine().Trim(); }
        private bool Enqueue()
        {
            if (i < s.Length) return true;
            string line = reader.ReadLine();
            if (string.IsNullOrEmpty(line)) return false;
            s = line.Split(separator, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return true;
        }
        private string Dequeue() { Enqueue(); return s[i++]; }
    }
}

Submission Info

Submission Time
Task A - 経過日数
User eitaho
Language C# (Mono 2.10.8.1)
Score 100
Code Size 1961 Byte
Status AC
Exec Time 160 ms
Memory 7776 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 142 ms 7708 KB
subtask0_sample02.txt AC 150 ms 7696 KB
subtask0_sample03.txt AC 145 ms 7708 KB
subtask0_sample04.txt AC 143 ms 7712 KB
subtask1_01.txt AC 158 ms 7700 KB
subtask1_02.txt AC 149 ms 7700 KB
subtask1_03.txt AC 155 ms 7708 KB
subtask1_04.txt AC 155 ms 7732 KB
subtask1_05.txt AC 160 ms 7712 KB
subtask1_06.txt AC 143 ms 7740 KB
subtask1_07.txt AC 155 ms 7708 KB
subtask1_08.txt AC 148 ms 7696 KB
subtask1_09.txt AC 142 ms 7712 KB
subtask1_10.txt AC 150 ms 7696 KB
subtask1_11.txt AC 152 ms 7776 KB
subtask1_12.txt AC 146 ms 7772 KB
subtask1_13.txt AC 149 ms 7696 KB
subtask1_14.txt AC 155 ms 7696 KB
subtask1_15.txt AC 148 ms 7700 KB
subtask1_16.txt AC 152 ms 7704 KB
subtask1_17.txt AC 159 ms 7696 KB
subtask1_18.txt AC 141 ms 7768 KB
subtask1_19.txt AC 141 ms 7712 KB
subtask1_20.txt AC 146 ms 7712 KB