結果

問題 No.810 割った余りの個数
コンテスト
ユーザー hitowhoknowknow
提出日時 2019-04-16 17:50:25
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
MLE  
実行時間 -
コード長 776 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 712 ms
コンパイル使用メモリ 96,444 KB
実行使用メモリ 1,306,112 KB
最終ジャッジ日時 2026-04-10 14:16:59
合計ジャッジ時間 7,364 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 RE * 2 MLE * 3 -- * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <bitset>
#include <list>
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define rrep(i,a,n) for(ll i=n;i>=a;i--)
#define elif else if
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF = 1e+17;
const ll MODcdf = 998244353;
bool pairCompare(const P& firstElof,const P& secondElof){
    return firstElof.first<secondElof.first;
}
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    ll l,r,m;cin>>l>>r>>m;
    ll md[m];
    rep(i,0,m)md[i]=0;
    rep(i,l,r+1){
        if(md[i%m])continue;
        else md[i%m]++;
    }
    ll ans=0;
    rep(i,0,m){
        if(md[i])ans++;
    }
    cout<<ans<<endl;
}
0