結果
問題 | No.414 衝動 |
ユーザー |
![]() |
提出日時 | 2016-09-09 06:00:54 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 29 ms / 1,000 ms |
コード長 | 1,191 bytes |
コンパイル時間 | 1,010 ms |
コンパイル使用メモリ | 113,040 KB |
実行使用メモリ | 18,048 KB |
最終ジャッジ日時 | 2024-11-15 09:08:31 |
合計ジャッジ時間 | 2,215 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
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;//YukiCoder414 衝動class Program{static string InputPattern = "InputX";static List<string> GetInputList(){var WillReturn = new List<string>();if (InputPattern == "Input1") {WillReturn.Add("4");//2 2}else if (InputPattern == "Input2") {WillReturn.Add("18");//6 3}else if (InputPattern == "Input3") {WillReturn.Add("2");//1 2}else {string wkStr;while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);}return WillReturn;}static void Main(){List<string> InputList = GetInputList();long M = long.Parse(InputList[0]);//偶数の場合if (M % 2 == 0) {Console.WriteLine("{0} {1}", 2, M / 2);return;}for (long I = 3; I * I <= M; I += 2) {if (M % I == 0) {Console.WriteLine("{0} {1}", I, M / I);return;}}Console.WriteLine("{0} {1}", 1, M);}}