灵异事件
  • 板块灌水区
  • 楼主lucy2012
  • 当前回复13
  • 已保存回复13
  • 发布时间2024/4/27 16:55
  • 上次更新2024/4/27 19:18:31
查看原帖
灵异事件
1252442
lucy2012楼主2024/4/27 16:55

给组数据

10 3
1 9 2 60 8 17 11 4 5 14
1 5 9

用这个代码试试

#include<bits/stdc++.h>
using namespace std;
int n,m,a[10000010],b;
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	    cin>>a[i];
	for(int i=1;i<=m;i++){
		cin>>b;
		cout<<a[b]<<endl;
	} 
    return 0;
}

奇迹诞生了(why

2024/4/27 16:55
加载中...