結果
| 問題 |
No.1307 Rotate and Accumulate
|
| コンテスト | |
| ユーザー |
penguinman
|
| 提出日時 | 2020-12-04 02:13:27 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 437 bytes |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 29,952 KB |
| 実行使用メモリ | 14,016 KB |
| 最終ジャッジ日時 | 2024-09-14 12:55:55 |
| 合計ジャッジ時間 | 14,960 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 TLE * 1 -- * 11 |
ソースコード
#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]);
}
penguinman