結果

問題 No.1081 和の和
ユーザー mag
提出日時 2020-07-02 17:20:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 1,612 ms
コンパイル使用メモリ 167,844 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-15 01:07:42
合計ジャッジ時間 2,372 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)
#define mod 1000000007

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  int n;
  cin>>n;
  ll a[n];
  rep(i,n)cin>>a[i];
  rep(i,n-1){
    rep(j,n-i-1){
      a[j]+=a[j+1]%mod;
    }
  }
  cout<<a[0]<<endl;
}
0