結果

問題 No.537 ユーザーID
ユーザー TrimozGit
提出日時 2017-09-05 16:37:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 714 bytes
コンパイル時間 2,083 ms
コンパイル使用メモリ 112,056 KB
実行使用メモリ 19,636 KB
最終ジャッジ日時 2024-11-06 22:21:16
合計ジャッジ時間 3,378 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yukicorder537
{
	class Program
	{
		static void Main(string[] args)
		{
			// 入力
			Int64 N = long.Parse(Console.ReadLine());

			// 割れる組み合わせの確認
			long ans = divPattern(N);

			Console.WriteLine(ans);
			Console.ReadKey();
		}

		static long divPattern(Int64 N)
		{
			var max = Math.Sqrt(N);

			List<string> cnt = new List<string>();

			for (Int64 i = 1; i <= max; i++)
			{
				if (N % i == 0)
				{
					cnt.Add(string.Format("{0}{1}" , i , N / i));
					cnt.Add(string.Format("{0}{1}" , N / i , i));
				}
			}
			return cnt.Distinct().Count();
		}
	}
}
0