結果
| 問題 |
No.3027 f-列とh-列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-31 21:13:32 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 558 bytes |
| コンパイル時間 | 3,694 ms |
| コンパイル使用メモリ | 280,404 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-31 21:13:37 |
| 合計ジャッジ時間 | 5,255 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
void solve(){
ll N;
cin>>N;
vector<ll> F(N+1);
for(int i=0;i<=N;i++)cin>>F[i];
vector<vector<ll>> C(N+1,vector<ll>(N+1,0));
C[0][0]=1;
for(int i=1;i<=N;i++){
C[i][0]=1;
for(int j=0;j<i;j++){
C[i][j+1]=C[i-1][j]+C[i-1][j+1];
}
}
for(int i=0;i<=N;i++){
ll an=0;
for(int j=i;j>=0;j--){
an+=C[N-j][N-i]*F[j]*((i-j)%2==0?1:-1);
}
cout<<an<<" \n"[i==N];
}
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int T=1;
// cin>>T;
while(T--)solve();
}