結果
問題 |
No.300 平方数
|
ユーザー |
![]() |
提出日時 | 2015-11-13 23:05:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 374 bytes |
コンパイル時間 | 451 ms |
コンパイル使用メモリ | 43,512 KB |
実行使用メモリ | 13,756 KB |
最終ジャッジ日時 | 2024-09-13 15:05:11 |
合計ジャッジ時間 | 3,327 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 RE * 1 TLE * 1 -- * 25 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:11:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | long long x,ans;scanf("%lld",&x); | ~~~~~^~~~~~~~~~~
ソースコード
#include <cstdio> #include <cstdlib> #include <cstring> #include <string> using namespace std; //namaega184 int main(){ long long x,ans;scanf("%lld",&x); int a[100001]={}; a[1]=1; for(int i=2;x!=1;i++){ if(x%i)continue; while(x%i==0){ a[i]++; x/=i; } } ans=1; for(int i=2;i<=100000;i++){ if(a[i]&&a[i]%2)ans*=i; } printf("%lld\n",ans); return 0; }