結果
| 問題 |
No.1307 Rotate and Accumulate
|
| コンテスト | |
| ユーザー |
penguinman
|
| 提出日時 | 2020-12-04 04:13:31 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 29,312 KB |
| 実行使用メモリ | 13,888 KB |
| 最終ジャッジ日時 | 2024-09-14 14:44:08 |
| 合計ジャッジ時間 | 14,467 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | WA * 12 TLE * 1 -- * 6 |
ソースコード
#include<stdio.h>
short A[100000];
int i,j,N,Q,B[100000],cnt[100000];
int main(){
scanf("%d%d",&N,&Q);
for(i=0;i!=N;i++) scanf("%o",&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