結果
| 問題 |
No.810 割った余りの個数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-12 22:35:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 397 bytes |
| コンパイル時間 | 638 ms |
| コンパイル使用メモリ | 63,168 KB |
| 実行使用メモリ | 13,760 KB |
| 最終ジャッジ日時 | 2024-09-14 20:26:52 |
| 合計ジャッジ時間 | 8,475 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 7 TLE * 1 -- * 4 |
ソースコード
#include <iostream>
using namespace std;
typedef long long LL;
int main(int argc, char* argv[])
{
LL L,R,M,i;
cin>>L>>R>>M;
if (L==R){
cout<<1<<endl;
return 0;
}
LL x0=L%M;
//cout<<x0<<endl;
LL Num;
if (M<=L){
Num=1;
}else{
Num=M-L+1;
L=M;
}
for (i=L+1;i<=R;i++){
LL x=i%M;
if (x!=x0){
//cout<<x<<endl;
Num++;
}else{
break;
}
}
cout<<Num<<endl;
return 0;
}