結果
問題 |
No.1162 Many Quotients hard
|
ユーザー |
👑 ![]() |
提出日時 | 2020-12-08 19:16:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 379 bytes |
コンパイル時間 | 2,073 ms |
コンパイル使用メモリ | 191,304 KB |
最終ジャッジ日時 | 2025-01-16 19:51:16 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 WA * 23 |
ソースコード
#include<bits/stdc++.h> using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0;i<(n);i++) ULL sqrt_int(ULL x){ ULL l=0, r=x+1; while(r-l>1){ ULL m=(l+r)/2; if(m*m<=x) l=m; else r=m; } return l; } int main(){ ULL N; cin>>N; ULL Q = sqrt_int(N); ULL ans=Q*2; if(Q*Q==N) ans--; cout<<ans<<endl; return 0; }