Submission #1240614


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC052FofF
{
    class Program
    {
        static Dictionary<int, int> primeDic = new Dictionary<int, int>();

        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            

            for(int i = 2; i <= N; i++)
            {
                int x = i;
                int j = 2;
                while (j * j <= i)
                {
                    if (x % j == 0)
                    {
                        x /= j;
                        //Console.WriteLine("{0} is a factor of {1}", j, i);
                        if (primeDic.ContainsKey(j))
                        {
                            primeDic[j]++;
                        }
                        else
                        {
                            primeDic[j] = 1;
                        }
                    }
                    else
                    {
                        j++;
                    }
                }

                if (x != 1)
                {
                    //Console.WriteLine("{0} is a factor of {1}", x, i);
                    if (primeDic.ContainsKey(x))
                    {
                        primeDic[x]++;
                    }
                    else
                    {
                        primeDic[x] = 1;
                    }
                }


            }

            /*
            foreach (var key in primeDic.Keys)
            {
                Console.WriteLine("{0}:{1}", key, primeDic[key]);
                
            }
            */

            long ans = 1;
            foreach(var val in primeDic.Values)
            {
                ans = ans * (val+1) % 1000000007;
            }

            Console.WriteLine(ans);
        }
    }
}

Submission Info

Submission Time
Task C - Factors of Factorial
User hogeki
Language C# (Mono 4.6.2.0)
Score 300
Code Size 1964 Byte
Status AC
Exec Time 24 ms
Memory 11104 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 10
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_certain_01.txt, subtask_1_certain_02.txt, subtask_1_certain_03.txt, subtask_1_certain_04.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_rand_03.txt
Case Name Status Exec Time Memory
sample_01.txt AC 22 ms 11092 KB
sample_02.txt AC 22 ms 11104 KB
sample_03.txt AC 24 ms 11104 KB
subtask_1_certain_01.txt AC 21 ms 11104 KB
subtask_1_certain_02.txt AC 22 ms 11104 KB
subtask_1_certain_03.txt AC 23 ms 9172 KB
subtask_1_certain_04.txt AC 23 ms 11104 KB
subtask_1_rand_01.txt AC 23 ms 11104 KB
subtask_1_rand_02.txt AC 23 ms 11104 KB
subtask_1_rand_03.txt AC 22 ms 9056 KB