結果
| 問題 | No.300 平方数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-28 12:20:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 1,000 ms |
| コード長 | 416 bytes |
| コンパイル時間 | 1,891 ms |
| コンパイル使用メモリ | 167,204 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-26 11:15:22 |
| 合計ジャッジ時間 | 2,763 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
long long x; cin >> x;
long long ans = 1, cnt = 0;
for(long long i = 2; i * i <= x; i++) {
cnt = 0;
while(x % i == 0){
cnt++;
x /= i;
}
if(cnt % 2 == 1) ans *= i;
}
if(x != 1) ans *= x;
cout << ans << endl;
return 0;
}