結果
問題 | No.1336 Union on Blackboard |
ユーザー |
![]() |
提出日時 | 2022-10-13 23:55:29 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 384 bytes |
コンパイル時間 | 379 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 12:13:31 |
合計ジャッジ時間 | 1,285 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 31 |
ソースコード
#include<stdio.h>long long int a[102];int main(){int t;scanf("%d", &t);long long int n;long long int i;const long long int p = 1000000007;long long int ans;for (; t > 0; t--){scanf("%lld", &n);for (i = 0; i < n; i++)scanf("%lld", &a[i]);ans = 0;for (i = 0; i < n; i++)ans = (ans + a[i] + ans * a[i]) % p;printf("%lld\n", ans);}return 0;}