結果

問題 No.316 もっと刺激的なFizzBuzzをください
コンテスト
ユーザー testestest
提出日時 2015-12-09 09:47:27
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 195 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 138 ms
コンパイル使用メモリ 29,256 KB
最終ジャッジ日時 2026-02-23 19:59:37
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:3:8: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    3 | main(){scanf("%d%d%d%d",&n,&a,&b,&c);
      |        ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | long n,a,b,c,s;
main.c:3:16: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=]
    3 | main(){scanf("%d%d%d%d",&n,&a,&b,&c);
      |               ~^        ~~
      |                |        |
      |                int *    long int *
      |               %ld
main.c:3:18: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long int *’ [-Wformat=]
    3 | main(){scanf("%d%d%d%d",&n,&a,&b,&c);
      |                 ~^         ~~
      |                  |         |
      |                  int *     long int *
      |                 %ld
main.c:3:20: warning: format ‘%d’ expects argument of type ‘int *’, but argument 4 has type ‘long int *’ [-Wformat=]
    3 | main(){scanf("%d%d%d%d",&n,&a,&b,&c);
      |                   ~^          ~~
      |                    |          |
      |                    int *      long int *
      |                   %ld
main.c:3:22: warning: format ‘%d’ expects argument of type ‘int *’, but argument 5 has type ‘long int *’ [-Wformat=]
    3 | main(){scanf("%d%d%d%d",&n,&a,&b,&c);
      |                     ~^           ~~
      |                      |           |
      |                      int *       long int *
      |                     %ld
main.c:6:4: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
    6 | n=!printf("%d",s+n/(a/gcd(a,b)*b));
      |    ^~~~~~
main.c:6:4: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:6:13: warning: format ‘%d’ expects argument of type

ソースコード

diff #
raw source code

long n,a,b,c,s;
gcd(a,b){return b?gcd(b,a%b):a;}
main(){scanf("%d%d%d%d",&n,&a,&b,&c);
s=n/a-n/(a/gcd(a,b)*b)+n/b-n/(c/gcd(c,b)*b);
s+=n/c-n/(a*=c/gcd(a,c));
n=!printf("%d",s+n/(a/gcd(a,b)*b));
}
0