結果
| 問題 |
No.3027 f-列とh-列
|
| コンテスト | |
| ユーザー |
maeshun
|
| 提出日時 | 2025-02-22 11:56:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,226 bytes |
| コンパイル時間 | 9,560 ms |
| コンパイル使用メモリ | 470,996 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-02-22 11:57:04 |
| 合計ジャッジ時間 | 10,567 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;
using namespace std;
using namespace atcoder;
#define rep(i, n) for(int i=0;i<(n);++i)
#define rep1(i, n) for(int i=1;i<=(n);i++)
#define ll long long
using mint = modint998244353;
using P = pair<ll,ll>;
using lb = long double;
using T = tuple<ll, ll, ll>;
#ifdef LOCAL
# include <debug_print.hpp>
# define dbg(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
# define dbg(...) (static_cast<void>(0))
#endif
vector<vector<ll>> comb(27, vector<ll>(27));
int main()
{
int n;
cin >> n;
vector<ll> f(n+1), h(n+1);
rep(i,n+1) cin >> f[i];
rep(i,n+1) comb[i][0] = 1;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
comb[i][j] = comb[i-1][j] + comb[i-1][j-1];
}
}
rep(i,n+1) {
for(int j=0;j<=n-i;j++) {
ll ret = comb[n-i][j];
if((n-i-j)%2==1) ret *= -1;
h[n-j] += ret*f[i];
dbg(i,j,ret*f[i]);
}
}
rep(i,n+1) {
cout << h[i] << " ";
}
cout << endl;
return 0;
}
maeshun