結果

問題 No.754 畳み込みの和
ユーザー tatyamtatyam
提出日時 2018-12-02 08:50:34
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 201 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-28 09:17:16
合計ジャッジ時間 767 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){int n,i;scanf("%d",&n);long a[n+1],b[n+1],sum=0,ans=0;R scanf("%lld",&a[i]);R scanf("%lld",&b[i]);R {sum+=a[i];ans=(ans+sum*b[n-i])%1000000007;}printf("%lld\n",ans);}
      | ^~~~
main.c: In function 'main':
main.c:2:16: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | main(){int n,i;scanf("%d",&n);long a[n+1],b[n+1],sum=0,ans=0;R scanf("%lld",&a[i]);R scanf("%lld",&b[i]);R {sum+=a[i];ans=(ans+sum*b[n-i])%1000000007;}printf("%lld\n",ans);}
      |                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define R for(i=0;i<=n;++i)
main.c:2:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | main(){int n,i;scanf("%d",&n);long a[n+1],b[n+1],sum=0,ans=0;R scanf("%lld",&a[i]);R scanf("%lld",&b[i]);R {sum+=a[i];ans=(ans+sum*b[n-i])%1000000007;}printf("%lld\n",ans);}
      |                ^~~~~
main.c:2:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:152: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | main(){int n,i;scanf("%d",&n);long a[n+1],b[n+1],sum=0,ans=0;R scanf("%lld",&a[i]);R scanf("%lld",&b[i]);R {sum+=a[i];ans=(ans+sum*b[n-i])%1000000007;}printf("%lld\n",ans);}
      |                                                                                                                                                        ^~~~~~
main.c:2:152: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:152: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:152: note: include '<stdio.h>' or provide a declaration of 'printf'

ソースコード

diff #

#define R for(i=0;i<=n;++i)
main(){int n,i;scanf("%d",&n);long a[n+1],b[n+1],sum=0,ans=0;R scanf("%lld",&a[i]);R scanf("%lld",&b[i]);R {sum+=a[i];ans=(ans+sum*b[n-i])%1000000007;}printf("%lld\n",ans);}
0