結果

問題 No.300 平方数
ユーザー しらゆき
提出日時 2015-11-23 23:44:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 37 ms / 1,000 ms
コード長 348 bytes
コンパイル時間 905 ms
コンパイル使用メモリ 108,820 KB
実行使用メモリ 25,936 KB
最終ジャッジ日時 2024-09-13 17:20:06
合計ジャッジ時間 3,340 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        long x = long.Parse(Console.ReadLine());

        for (long i = 2; i <= Math.Sqrt(x); i++)
        {
            while (true)
            {
                if (x % (i * i) == 0) x /= i * i;
                else break;
            }
        }

        Console.WriteLine(x);
    }
}
0