結果

問題 No.810 割った余りの個数
ユーザー funakoshifunakoshi
提出日時 2019-08-30 14:45:05
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 1,986 ms
コンパイル使用メモリ 31,616 KB
実行使用メモリ 392,412 KB
最終ジャッジ日時 2024-05-01 06:26:41
合計ジャッジ時間 10,847 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:18:18: warning: iteration 99999999 invokes undefined behavior [-Waggressive-loop-optimizations]
   18 |         if(modcnt[i]>0)
      |            ~~~~~~^~~
main.c:16:28: note: within this loop
   16 |     for(long long int i=0;i<1000000000;i++)
      |                           ~^~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
int main(void)
{
    int l,r,m,cnt=0;
    int modcnt[99999999]={0};
    scanf("%d %d %d",&l,&r,&m);
    for(int i=l;i<=r;i++)
    {
        int ans = i%m;
        modcnt[ans]++;
    }
    for(long long int i=0;i<1000000000;i++)
    {
        if(modcnt[i]>0)
        {
            cnt++;
        }
    }
    printf("%d",cnt);
}
    
0