結果
問題 |
No.1162 Many Quotients hard
|
ユーザー |
![]() |
提出日時 | 2020-08-12 16:16:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 425 bytes |
コンパイル時間 | 2,164 ms |
コンパイル使用メモリ | 192,212 KB |
最終ジャッジ日時 | 2025-01-12 21:26:27 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 42 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include <bits/stdc++.h> using namespace std; int main(){ ll n; cin>>n; ll cnt=0,tmp,pre=-1; ll t=(sqrt(1+4*n)-1)/2; for(ll i=t+1;i*i<=n;i++){ tmp=n/i; if(tmp!=pre){ cnt++; pre=tmp; } } cnt+=t; if(n/pre==pre) cout<<2*cnt-1<<endl; else cout<<2*cnt<<endl; return 0; }