結果
問題 | No.300 平方数 |
ユーザー |
![]() |
提出日時 | 2016-01-11 10:29:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 10 ms / 1,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 722 ms |
コンパイル使用メモリ | 66,336 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 18:45:16 |
合計ジャッジ時間 | 1,747 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <iostream>#include <map>using namespace std;int main(){long x; cin>>x;map<long, int> f;for(long i=2;i*i<=x;++i) {while (x%i==0) { f[i]++; x/=i; }}if (x>1) f[x]++;long res=1;for(auto& v: f) if (v.second&1) res*=v.first;cout<<res<<endl;}