結果

問題 No.810 割った余りの個数
ユーザー yicode
提出日時 2023-05-22 19:31:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 1,789 ms
コンパイル使用メモリ 166,788 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-22 14:27:45
合計ジャッジ時間 2,698 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  long long L,R,M; cin >> L >> R >> M;
  long long x = R / M;
  long long y = L / R;
  if(x - y > 1) {
    cout << M << endl;
  }
  else {
    if(R - L + 1 > M) {
      cout << M << endl;
      return 0;
    }
    cout << R - L + 1 << endl;
    
  }
}
0