結果

問題 No.300 平方数
ユーザー trineutron
提出日時 2019-09-26 04:56:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 294 bytes
コンパイル時間 1,617 ms
コンパイル使用メモリ 166,740 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-23 07:03:43
合計ジャッジ時間 2,861 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    long x, y = 1;
    cin >> x;
    for (long i = 2; i * i <= x; i++) {
        int n = 0;
        while (x % i == 0) {
            n++;
            x /= i;
        }
        if (n % 2 == 1) y *= i;
    }
    cout << x * y << endl;
}
0