結果
問題 | No.1307 Rotate and Accumulate |
ユーザー | kiyoshi0205 |
提出日時 | 2020-12-04 00:33:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4,728 ms / 5,000 ms |
コード長 | 426 bytes |
コンパイル時間 | 2,458 ms |
コンパイル使用メモリ | 181,376 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 10:07:33 |
合計ジャッジ時間 | 37,936 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> using namespace std; int N,Q,a[200001],b[100001]; int main(){ scanf("%d %d",&N,&Q); for(int i=0;i<N;++i)scanf("%d",&a[i]); for(int i=0;i<N;++i)a[i+N]=a[i]; for(int i=0;i<Q;++i){ int x;scanf("%d",&x); for(int j=0;j<N;++j){ b[j]+=a[x+j]; } } for(int i=0;i<N;++i)printf("%d ",b[i]); }