結果
| 問題 | 
                            No.300 平方数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-08-12 16:41:44 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 329 bytes | 
| コンパイル時間 | 2,080 ms | 
| コンパイル使用メモリ | 191,372 KB | 
| 最終ジャッジ日時 | 2025-01-07 11:45:21 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 WA * 34 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll x;
    cin>>x;
    ll y=1;
    for (ll i=2;i*i<=x;i++) {
        int cnt=0;
        while (x%i==0) {
            x/=i;
            cnt++;
        }
        if (cnt%2!=0) y*=i;
    }
    if (x>1) y*=x;
    else cout<<y<<endl;
    return 0;
}