結果

問題 No.1307 Rotate and Accumulate
ユーザー NyaanNyaanNyaanNyaan
提出日時 2020-12-04 00:35:50
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 395 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 31,644 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-10-12 11:18:42
合計ジャッジ時間 28,303 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,348 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,348 KB
testcase_08 AC 2,765 ms
4,348 KB
testcase_09 AC 3,904 ms
4,348 KB
testcase_10 TLE -
testcase_11 AC 1,380 ms
4,352 KB
testcase_12 TLE -
testcase_13 AC 369 ms
4,348 KB
testcase_14 AC 1,404 ms
4,348 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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