結果

問題 No.810 割った余りの個数
コンテスト
ユーザー pasoconhoshii
提出日時 2019-04-13 07:07:04
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 580 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 345 ms
コンパイル使用メモリ 79,584 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-04 18:01:04
合計ジャッジ時間 1,181 ms
ジャッジサーバーID
(参考情報)
judge5_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>

typedef long long ll;
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
template<class T> T    abs(const T& a) { if(a<0) return -a; else return a; }

// long long func(long long n, long long M)
// {
//   if (n == 0) return 0;
//   return n / M;
// }

int main()
{
    long long L,R,M;
    scanf("%lld %lld %lld", &L, &R, &M);

    long long ans  = 0;

    if (R-L+1 >= M) {
      ans = M;
    } else {
      ans = R-L+1;
    }
    printf("%lld\n", ans);


    return 0;
}
0