結果
問題 | No.1063 ルートの計算 / Sqrt Calculation |
ユーザー |
|
提出日時 | 2020-05-29 21:23:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 504 bytes |
コンパイル時間 | 1,687 ms |
コンパイル使用メモリ | 167,888 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 02:18:10 |
合計ジャッジ時間 | 2,298 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;constexpr char newl = '\n';int main() {cin.tie(nullptr);ios::sync_with_stdio(false);ll n;cin >> n;ll m = n;ll a = 1, b = 1;for (ll i = 2; i * i <= n; i++) {int cnt = 0;while (m % i == 0) {m /= i;++cnt;if (cnt % 2 == 0) a *= i;}if (cnt & 1) b *= i;}b *= m;cout << a << " " << b << newl;return 0;}