結果

問題 No.1162 Many Quotients hard
ユーザー kekenx
提出日時 2022-11-17 19:33:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 1,619 ms
コンパイル使用メモリ 191,956 KB
最終ジャッジ日時 2025-02-08 20:52:44
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 24 TLE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;


int main() {
  long long n;
  cin >> n;

  long long ans = 0;
  long long cur = 1;
  long long prev = n * 2;
  while (1) {
    long long d = n / cur;
    if (prev - d > 1) {
      cur++;
      ans++;
      prev = d;
    } else {
      ans += d - 1;
      break;
    }
  }
  cout << ans << '\n';
  return 0;
}
0