結果

問題 No.1307 Rotate and Accumulate
ユーザー NyaanNyaanNyaanNyaan
提出日時 2020-12-04 00:37:03
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3,423 ms / 5,000 ms
コード長 535 bytes
コンパイル時間 1,242 ms
コンパイル使用メモリ 136,580 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-12 11:22:10
合計ジャッジ時間 26,270 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 1 ms
4,356 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,356 KB
testcase_08 AC 574 ms
4,348 KB
testcase_09 AC 812 ms
4,352 KB
testcase_10 AC 1,157 ms
4,352 KB
testcase_11 AC 293 ms
4,352 KB
testcase_12 AC 1,105 ms
4,352 KB
testcase_13 AC 81 ms
4,348 KB
testcase_14 AC 293 ms
4,348 KB
testcase_15 AC 3,329 ms
4,352 KB
testcase_16 AC 3,325 ms
4,348 KB
testcase_17 AC 3,423 ms
4,352 KB
testcase_18 AC 2,419 ms
4,348 KB
testcase_19 AC 3,326 ms
4,352 KB
testcase_20 AC 3,168 ms
4,376 KB
testcase_21 AC 1 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *  date : 2020-12-04 00:36:54
 */

#define NDEBUG
#include <immintrin.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx2")

#include <cstdio>

int a[100000], b[200000];
int main() {
  int N, Q;
  scanf("%d%d", &N, &Q);
  for (int i = 0; i < N; i++) scanf("%d", a + i);
  while (Q--) {
    int i;
    scanf("%d", &i);
    if (i != 0) i = N - i;
    for (int j = 0; j < N; j++) b[i + j] += a[j];
  }
  for (int i = N, j = 0; j < N; i++, j++) {
    if (j) printf(" ");
    printf("%d", b[j] += b[i]);
  }
  printf("\n");
}
0