結果

問題 No.1307 Rotate and Accumulate
ユーザー penguinmanpenguinman
提出日時 2020-12-04 01:34:17
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 1,946 ms
コンパイル使用メモリ 198,616 KB
実行使用メモリ 8,744 KB
最終ジャッジ日時 2023-10-12 12:50:53
合計ジャッジ時間 16,248 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
unsigned char A[100000];
int B[100000];
int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    int N,Q; cin>>N>>Q;
    for(int i=0;i<N;i++) cin>>A[i];
    int r;
    while(Q--){
        cin>>r;
        for(int i=0;i<N;i++,r++){
            if(r==N) r=0;
            B[i]+=A[r];
        }
    }
    cout<<B[0];
    for(int i=1;i<N;i++) cout<<" "<<B[i];
}
0