結果
問題 | No.300 平方数 |
ユーザー |
![]() |
提出日時 | 2015-11-13 22:48:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,474 bytes |
コンパイル時間 | 1,428 ms |
コンパイル使用メモリ | 165,144 KB |
実行使用メモリ | 13,760 KB |
最終ジャッジ日時 | 2024-09-13 14:57:25 |
合計ジャッジ時間 | 4,187 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 TLE * 1 -- * 25 |
ソースコード
#ifndef MYDEBUG #include <bits/stdc++.h> #define err(...) #define errs(...) #endif using namespace std; void Calc(); #define ALL(a) begin(a),end(a) #define RALL(a) rbegin(a),rend(a) typedef long long ll; typedef unsigned long long ull; signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cin.exceptions(istream::failbit | istream::badbit); Calc(); cout.flush(); return 0; } struct Scanner { template<class A = string>static A Next() { A a; cin >> a; return a; } static string Line() { string s; getline(cin, s); return s; } template<class A = int> static vector<A> Array(int n) { vector<A> a(n); for (A& i : a) i = Next<A>(); return a; } template<class A = int> static vector<A> Array(int n, A add) { vector<A> a(n); for (A& i : a) i = Next<A>() + add; return a; } static int Int() { return Next<int>(); } template<class A> A operator-(const A &a) { return Next<A>() - a; } template<class A> Scanner& operator>>(A &a) { a = Next<A>(); return *this; } template<class A> operator A() { return Next<A>(); } operator bool() { return !!cin; } }; Scanner in; /*---------------------------------------------------------------------*/ void Calc() { ll x = in; map<int, int> m; for (int i = 2; x != 1; i++) { while (x % i == 0) { x /= i; m[i]++; m[i] %= 2; } } ll y = 1; for (auto& i : m) { if (i.second) y *= i.first; } cout << y << endl; }