結果

問題 No.1307 Rotate and Accumulate
ユーザー kiyoshi0205kiyoshi0205
提出日時 2020-12-04 00:33:15
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4,707 ms / 5,000 ms
コード長 426 bytes
コンパイル時間 2,333 ms
コンパイル使用メモリ 180,404 KB
実行使用メモリ 4,760 KB
最終ジャッジ日時 2023-10-12 11:14:55
合計ジャッジ時間 37,793 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,368 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 842 ms
4,368 KB
testcase_09 AC 1,184 ms
4,372 KB
testcase_10 AC 1,709 ms
4,368 KB
testcase_11 AC 431 ms
4,368 KB
testcase_12 AC 1,628 ms
4,348 KB
testcase_13 AC 114 ms
4,348 KB
testcase_14 AC 427 ms
4,352 KB
testcase_15 AC 4,653 ms
4,644 KB
testcase_16 AC 4,636 ms
4,760 KB
testcase_17 AC 4,707 ms
4,712 KB
testcase_18 AC 4,318 ms
4,656 KB
testcase_19 AC 4,612 ms
4,656 KB
testcase_20 AC 4,621 ms
4,720 KB
testcase_21 AC 1 ms
4,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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]);
}
0