結果
| 問題 |
No.1307 Rotate and Accumulate
|
| コンテスト | |
| ユーザー |
Haa
|
| 提出日時 | 2020-12-04 00:35:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 598 bytes |
| コンパイル時間 | 3,938 ms |
| コンパイル使用メモリ | 231,548 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 10:10:01 |
| 合計ジャッジ時間 | 7,608 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 6 RE * 12 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=998244353;
constexpr ll INF=1e18;
int main(){
int n, q; cin >> n >> q;
VI a(n); REP(i,n) cin >> a[i];
VI p(n,0); int r;
REP(i,q){
cin >> r;
p[r]++;
}
reverse(ALL(a));
copy(ALL(p),back_inserter(p));
VI ans=convolution_ll(a,p);
for(int i=n*2-1;i>=n;i--)
cout << ans[i] << " ";
cout << endl;
return 0;
}
Haa