結果
| 問題 |
No.414 衝動
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2016-08-27 14:20:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 1,000 ms |
| コード長 | 826 bytes |
| コンパイル時間 | 872 ms |
| コンパイル使用メモリ | 109,804 KB |
| 実行使用メモリ | 17,920 KB |
| 最終ジャッジ日時 | 2024-11-15 09:06:27 |
| 合計ジャッジ時間 | 2,011 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
using System.Linq;
class Program {
static int ReadInt() { return int.Parse(Console.ReadLine()); }
static int[] ReadInts() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
static string[] ReadStrings() { return Console.ReadLine().Split(); }
static void Calc(long m) {
if (m % 2 == 0) {
Console.WriteLine("{0} {1}", 2, m / 2);
return;
}
int n = (int)Math.Sqrt(m) + 1;
for (int i = 3; i <= n; i += 2) {
if (m % i == 0) {
Console.WriteLine("{0} {1}", i, m / i);
return;
}
}
Console.WriteLine("{0} {1}", 1, m);
}
static void Main() {
long m = long.Parse(Console.ReadLine());
Calc(m);
}
}
norioc