結果

問題 No.810 割った余りの個数
ユーザー funakoshifunakoshi
提出日時 2019-08-29 09:32:58
言語 C
(gcc 13.3.0)
結果
MLE  
実行時間 -
コード長 472 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 32,000 KB
実行使用メモリ 1,566,144 KB
最終ジャッジ日時 2024-11-17 16:46:40
合計ジャッジ時間 60,016 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 8 MLE * 22
権限があれば一括ダウンロードができます

ソースコード

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[200000000]={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