結果

問題 No.810 割った余りの個数
ユーザー funakoshi
提出日時 2019-08-29 09:33:56
言語 C
(gcc 13.3.0)
結果
MLE  
実行時間 -
コード長 472 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 32,000 KB
実行使用メモリ 784,824 KB
最終ジャッジ日時 2024-11-17 16:48:20
合計ジャッジ時間 38,672 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 1 TLE * 9 MLE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
int main(void)
{
    long long int left,right,mod,surplus,cnt=0;
    int numofmod[100000000]={0};
    scanf("%lld %lld %lld",&left,&right,&mod);
    for(int i=left;i<=right;i++)
    {
        surplus=i%mod;
        numofmod[surplus]++;
    }
    for(int i=0;i<100000;i++)
    {
        if(numofmod[i]>0)
        {
            cnt++;
        }
    }
    printf("%lld",cnt);
}
0