結果
| 問題 |
No.1307 Rotate and Accumulate
|
| コンテスト | |
| ユーザー |
penguinman
|
| 提出日時 | 2020-12-04 01:52:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 576 bytes |
| コンパイル時間 | 2,102 ms |
| コンパイル使用メモリ | 195,864 KB |
| 最終ジャッジ日時 | 2025-01-16 15:28:59 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 10 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int N,Q,r,x;
short A[100000],B[100000];
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
cin>>N>>Q;
vector<int> A(N),B(N);
for(int i=0;i<N;i++) cin>>A[i];
while(Q--){
cin>>r;
x=r;
for(int i=0;i<N;i++){
B[i]+=A[r];
r++;
if(r==N) r=0;
}
}
cout<<B[0];
for(int i=1;i<N;i++) cout<<" "<<B[i];
}
penguinman