結果
| 問題 | No.300 平方数 |
| コンテスト | |
| ユーザー |
RIGIH
|
| 提出日時 | 2017-07-19 16:51:24 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 1,000 ms |
| コード長 | 556 bytes |
| コンパイル時間 | 745 ms |
| コンパイル使用メモリ | 63,908 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 14:27:05 |
| 合計ジャッジ時間 | 2,026 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define LL long long
#define mass 1000000007
using namespace std;
int main(){
ll x;
cin>>x;
ll y=1;
int cnt=0;
while(x%2==0){
x/=2;
cnt++;
}
if(cnt%2!=0){
y*=2;
}
for(ll i=3;i*i<=x;i+=2){
cnt=0;
while(x%i==0){
x/=i;
cnt++;
}
if(cnt%2!=0){
y*=i;
}
}
if(x>1){
y*=x;
}
cout<<y<<endl;
return 0;
}
RIGIH