結果
| 問題 | 
                            No.1336 Union on Blackboard
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Nachia
                         | 
                    
| 提出日時 | 2021-01-15 21:24:46 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 399 bytes | 
| コンパイル時間 | 1,946 ms | 
| コンパイル使用メモリ | 191,548 KB | 
| 最終ジャッジ日時 | 2025-01-17 18:32:05 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 31 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |   int T; scanf("%d",&T);
      |          ~~~~~^~~~~~~~~
main.cpp:10:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |     int N; scanf("%d",&N);
      |            ~~~~~^~~~~~~~~
main.cpp:11:31: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |     ULL X[100]; rep(i,N) scanf("%llu",&X[i]);
      |                          ~~~~~^~~~~~~~~~~~~~
            
            ソースコード
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
  int T; scanf("%d",&T);
  while(T--){ 
    int N; scanf("%d",&N);
    ULL X[100]; rep(i,N) scanf("%llu",&X[i]);
    const ULL M=1000000007;
    ULL ans=1;
    rep(i,N) ans=ans*(X[i]+1)%M;
    ans+=M-1;
    printf("%llu\n",ans%M);
  }
  return 0;
}
            
            
            
        
            
Nachia