結果
問題 | No.300 平方数 |
ユーザー |
![]() |
提出日時 | 2015-12-31 03:47:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 12 ms / 1,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 1,148 ms |
コンパイル使用メモリ | 159,880 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 08:55:49 |
合計ジャッジ時間 | 2,426 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){long long int x;cin >> x;long long int count = 0;long long int ans = 1;for(long long int i = 2; i*i <= x;i++){count = 0;while(x % i == 0){x /= i;count++;}if(count % 2){ans *= i;}}ans *= x;cout << ans << endl;return 0;}