結果
| 問題 |
No.300 平方数
|
| コンテスト | |
| ユーザー |
RIGIH
|
| 提出日時 | 2017-07-19 16:47:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 533 bytes |
| コンパイル時間 | 723 ms |
| コンパイル使用メモリ | 63,536 KB |
| 実行使用メモリ | 9,888 KB |
| 最終ジャッジ日時 | 2024-10-08 14:26:56 |
| 合計ジャッジ時間 | 3,480 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 TLE * 1 -- * 25 |
ソースコード
#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;x>1;i+=2){
cnt=0;
while(x%i==0){
x/=i;
cnt++;
}
if(cnt%2!=0){
y*=i;
}
}
cout<<y<<endl;
return 0;
}
RIGIH