結果
問題 | No.810 割った余りの個数 |
ユーザー |
![]() |
提出日時 | 2019-04-21 13:40:42 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 531 bytes |
コンパイル時間 | 1,037 ms |
コンパイル使用メモリ | 159,008 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-05 12:55:06 |
合計ジャッジ時間 | 1,830 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long const int INF = 1e9; const int MOD = INF+7; #define rep(i,N) for(int (i)=0;(i)<(N);++(i)) #define rrep(i,N) for(int (i)=(N-1);(i)>0;--i) #define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i)) #define put(n) cout<<(n)<<endl; #define all(v) v.rbegin(),v.rend() #define MP make_pair #define pb push_back using P = pair<int,int>; signed main(){ int L,R,M; cin >> L >> R >> M; int ans; if((R - L + 1) / M) ans = M; else ans = (R - L + 1) % M; cout << ans << endl; }