結果
| 問題 | 
                            No.300 平方数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             fiord
                         | 
                    
| 提出日時 | 2015-11-26 15:53:28 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 12 ms / 1,000 ms | 
| コード長 | 222 bytes | 
| コンパイル時間 | 1,482 ms | 
| コンパイル使用メモリ | 159,240 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-13 17:40:47 | 
| 合計ジャッジ時間 | 2,862 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 43 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll x;	cin>>x;
	if(x<4){
		cout<<x<<endl;
		return 0;
	}
	for(ll i=2;i*i<=x;i++){
		while(x%(i*i)==0)	x/=i*i;
	}
	cout<<x<<endl;
	return 0;
}
            
            
            
        
            
fiord