結果
問題 | No.300 平方数 |
ユーザー |
![]() |
提出日時 | 2016-04-24 04:46:27 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 1,000 ms |
コード長 | 859 bytes |
コンパイル時間 | 994 ms |
コンパイル使用メモリ | 104,516 KB |
実行使用メモリ | 27,840 KB |
最終ジャッジ日時 | 2024-10-04 15:33:39 |
合計ジャッジ時間 | 3,786 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.
ソースコード
using System; namespace No300_1{ public class Program{ public static void Main(string[] args){ long x = long.Parse(Console.ReadLine()); long tmp = x; long result = 1; { var cnt = 0; while(tmp % 2 == 0){ tmp /= 2; cnt++; } if(cnt % 2 == 1){ result *= 2; } } for(long i = 3; i * i <= x; i += 2){ var cnt = 0; while(tmp % i == 0) { tmp /= i; cnt++; } if(cnt % 2 == 1){ result *= i; } } if(tmp > 1) result *= tmp; Console.WriteLine(result); } } }