結果
| 問題 |
No.1618 Convolution?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-22 22:22:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 2,419 bytes |
| コンパイル時間 | 1,814 ms |
| コンパイル使用メモリ | 170,188 KB |
| 実行使用メモリ | 13,880 KB |
| 最終ジャッジ日時 | 2024-07-17 18:24:32 |
| 合計ジャッジ時間 | 6,050 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 1 -- * 14 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ld long double
#define vi vector<ll>
#define pi pair<ll,ll>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define dbg(x) cout << #x << ": " << x
#define clr(x,v) memset(x, v, sizeof(x))
#define fix(x) cout << setprecision(x) << fixed;
#define fo(i,a,b) for(int i=(a);i<=(b);i++)
template<typename T1, typename T2>istream& operator>>(istream& in, pair<T1, T2> &a) {in >> a.fr >> a.sc; return in;}
template<typename T1, typename T2>ostream& operator<<(ostream& out, pair<T1, T2> a) {out << a.fr << " " << a.sc; return out;}
template<typename T, typename T1>T amax(T &a, T1 b) {if (b > a)a = b; return a;}
template<typename T, typename T1>T amin(T &a, T1 b) {if (b < a)a = b; return a;}
const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const ld r = 1e9;
const ll inf = 1e17;
const int MAXN = 105;
const int N = 1e5 + 5;
ll max(ll a, ll b)
{
if (a > b) return a;
else return b;
}
ll min(ll a, ll b)
{
if (a < b) return a;
else return b;
}
ll power(ll a, ll p) {
ll res = 1;
while (p) {
if (p & 1) {
res = ((res) * (a) ) ;
}
a = ((a ) * (a));
p >>= 1;
}
return res;
}
bool p(string str)
{
int j = str.length() - 1;
for (int i = 0; i < j; i++, j--)
{
if (str[i] != str[j])
{
return false;
}
}
return true;
}
void solve() {
ll n, i, j, k, x;
cin >> n;
vi a(n + 1), b(n + 1), ans((2 * n) + 1, 0);
for (i = 1; i <= n; i++) {
cin >> a[i];
}
for (i = 1; i <= n; i++) {
cin >> b[i];
}
for (i = 1; i <= n; i++) {
for (j = 1; j <= n; j++) {
ans[i + j] += (j * b[i] + i * a[j]);
}
}
for (i = 1; i < 2 * n + 1; i++) {
cout << ans[i] << " ";
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// #ifndef ONLINE_JUDGE
// // For getting input from input.txt file
// freopen("input.txt", "r", stdin);
// // Printing the Output to output.txt file
// freopen("output.txt", "w", stdout);
// #endif
ll t = 1;
//cin >> t;
//ll tt = 0;
while (t--) {
//tt++;
solve();
}
return 0;
}