結果
| 問題 | 
                            No.300 平方数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             srup٩(๑`н´๑)۶
                         | 
                    
| 提出日時 | 2016-07-05 17:43:53 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 604 bytes | 
| コンパイル時間 | 642 ms | 
| コンパイル使用メモリ | 67,828 KB | 
| 実行使用メモリ | 10,496 KB | 
| 最終ジャッジ日時 | 2024-10-12 20:16:32 | 
| 合計ジャッジ時間 | 3,570 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 TLE * 1 -- * 22 | 
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
typedef long long ll;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
int main(void){
    ll x, y = 1;
    cin >> x;
    for (int 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;
    printf("%lld\n", y);
    return 0;
}
            
            
            
        
            
srup٩(๑`н´๑)۶