結果
| 問題 |
No.1307 Rotate and Accumulate
|
| コンテスト | |
| ユーザー |
penguinman
|
| 提出日時 | 2020-12-04 04:16:20 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 458 bytes |
| コンパイル時間 | 1,459 ms |
| コンパイル使用メモリ | 29,184 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-14 14:46:36 |
| 合計ジャッジ時間 | 23,531 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 TLE * 1 -- * 6 |
ソースコード
#include<stdio.h>
int i,j,N,Q,A[100000],B[100000],cnt[100000];
int main(){
scanf("%d%d",&N,&Q);
for(i=0;i!=N;i++) scanf("%d",&A[i]);
while(Q--){
int now; scanf("%d",&now);
cnt[now]++;
}
for(;i;i--){
if(cnt[i-1]){
int now=i-1;
for(j=0;j!=N;j++){
B[j]+=A[now]*cnt[i-1];
if(++now==N) now=0;
}
}
}
for(;i!=N;i++) printf("%d ",B[i]);
}
penguinman