結果

問題 No.1307 Rotate and Accumulate
ユーザー penguinmanpenguinman
提出日時 2020-12-04 02:13:27
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 437 bytes
コンパイル時間 1,545 ms
コンパイル使用メモリ 28,740 KB
実行使用メモリ 6,348 KB
最終ジャッジ日時 2023-10-12 14:02:01
合計ジャッジ時間 16,278 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 0 ms
4,348 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 3,205 ms
4,352 KB
testcase_09 AC 4,528 ms
4,348 KB
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<stdio.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int N,Q,A[100000],B[100000];
int main(){
    scanf("%d%d",&N,&Q);
    for(int i=0;i<N;i++) scanf("%d",&A[i]);
    while(Q--){
        int now; scanf("%d",&now);
        for(int i=0;i<N;i++){
            if(now==N) now=0;
            B[i]+=A[now];
            now++;
        }
    }
    for(int i=0;i<N;i++) printf("%d ",B[i]);
}
0