結果
問題 | No.1063 ルートの計算 / Sqrt Calculation |
ユーザー |
|
提出日時 | 2020-06-05 18:29:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 263 bytes |
コンパイル時間 | 1,578 ms |
コンパイル使用メモリ | 165,540 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-16 05:25:06 |
合計ジャッジ時間 | 2,370 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:16:17: warning: 'x' may be used uninitialized [-Wmaybe-uninitialized] 16 | cout<< x << " " << y <<endl; | ^~~ main.cpp:8:9: note: 'x' was declared here 8 | int x,y=n,p=1; | ^
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>> n; int x,y=n,p=1; while(p*p<=n){ if(n%(p*p)==0){ y=n/(p*p); x=p; } p++; } cout<< x << " " << y <<endl; return 0; }