結果

問題 No.300 平方数
ユーザー rollman054
提出日時 2015-11-14 10:05:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 1,277 ms
コンパイル使用メモリ 158,456 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-13 16:41:34
合計ジャッジ時間 2,493 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(void){
  ll x; cin >> x;
  ll ans = 1;
  for(int i=2; i < sqrt(x); i++){
    int cnt = 0;
    while(x%i == 0){
      x /= i;
      cnt++;
    }
    if(cnt%2 == 1){
      ans *= i;
    }
  }
  cout << ans << endl;
  return 0;
}
0