結果
問題 | No.810 割った余りの個数 |
ユーザー |
![]() |
提出日時 | 2019-04-13 07:07:04 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 580 bytes |
コンパイル時間 | 537 ms |
コンパイル使用メモリ | 57,176 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 06:49:31 |
合計ジャッジ時間 | 1,371 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:20:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 20 | scanf("%lld %lld %lld", &L, &R, &M); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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;}