結果
| 問題 |
No.537 ユーザーID
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-05 16:05:31 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 810 bytes |
| コンパイル時間 | 2,249 ms |
| コンパイル使用メモリ | 104,448 KB |
| 実行使用メモリ | 22,912 KB |
| 最終ジャッジ日時 | 2024-11-06 22:19:29 |
| 合計ジャッジ時間 | 5,340 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 7 TLE * 1 -- * 16 |
コンパイルメッセージ
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)
{
// 入力
long N = long.Parse(Console.ReadLine());
// 割れる組み合わせの確認
var ans = divPattern(N);
Console.WriteLine(ans);
Console.ReadKey();
}
static long divPattern(long N)
{
long cnt = 0;
var max = N / 2;
cnt += 2; // 1,N
List<string> ans = new List<string>();
ans.Add(string.Format("{0}{1}" , 1 , N));
ans.Add(string.Format("{1}{0}" , 1 , N));
for (var i = 2; i <= max; i++)
{
if (N % i == 0)
{
string x = i + (N / i).ToString();
if (ans.Contains(x) == false)
{
cnt++;
}
}
}
return cnt;
}
}
}