結果
問題 |
No.1063 ルートの計算 / Sqrt Calculation
|
ユーザー |
|
提出日時 | 2020-11-03 18:11:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 1,020 bytes |
コンパイル時間 | 1,785 ms |
コンパイル使用メモリ | 191,924 KB |
最終ジャッジ日時 | 2025-01-15 19:24:40 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define all(x) (x).begin(),(x).end() using ll = long long; using P = pair<ll, ll>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, -1, 0, 1}; string char_to_string(char val) { return string(1, val); } int char_to_int(char val) { return val - '0'; } char inverse_char(char c) { if(isupper(c)) return tolower(c); else return toupper(c); } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } struct edge { ll to, cost; }; int main() { ll n; cin >> n; ll a = 0; ll b = pow(10, 9) + 1000000; for(ll i = 1; i <= 100000; ++i) { ll _a = i * i; // cout << _a << " " << i << endl; if(n % _a == 0) { if((n / _a) <= b) { a = i; b = n / _a; } } } cout << a << " " << b << endl; }