結果

問題 No.1162 Many Quotients hard
ユーザー umezo
提出日時 2020-08-12 15:42:19
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 418 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,353 ms
コンパイル使用メモリ 209,480 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-12 06:49:52
合計ジャッジ時間 11,907 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
  
  bool b=false;
  ll cnt=0,tmp,pre=-1;
  for(ll i=1;i*i<=n;i++){
    tmp=n/i;
    if(tmp!=pre){
      cnt++;
      tmp=pre;
    }
    if(i*i==n) b=true;
  }
  if(b) cout<<2*cnt-1<<endl;
  else cout<<2*cnt<<endl;
  
  return 0;
}
0