結果
問題 |
No.537 ユーザーID
|
ユーザー |
|
提出日時 | 2017-09-05 16:26:54 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 868 bytes |
コンパイル時間 | 920 ms |
コンパイル使用メモリ | 104,320 KB |
実行使用メモリ | 18,304 KB |
最終ジャッジ日時 | 2024-11-06 22:19:52 |
合計ジャッジ時間 | 3,378 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 6 WA * 26 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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()); // 割れる組み合わせの確認 Int64 ans = divPattern(N); Console.WriteLine(ans); Console.ReadKey(); } static Int64 divPattern(Int64 N) { var max = Math.Sqrt(N); List<string> ans = new List<string>(); ans.Add(string.Format("{0}{1}" , 1 , N)); if (ans.Contains(string.Format("{1}{0}" , 1 , N)) == false){ ans.Add(string.Format("{1}{0}" , 1 , N)); } for (Int64 i = 2; i <= max; i++) { if (N % i == 0) { string x = i + (N / i).ToString(); if (ans.Contains(x) == false) { ans.Add(x); } } } return ans.Count; } } }