蒟蒻求助,为什么TLE了qwq
查看原帖
蒟蒻求助,为什么TLE了qwq
161892
lufroloc楼主2020/10/25 21:38
#include <cstdio>
#include <vector>
using namespace std;
#define f(a) for(int i=1;i<=a;i++)
inline int read(){
    int s=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
        if(ch=='-') f=-1;
        ch=getchar();
    while(ch>='0'&&ch<='9')
        s=s*10+ch-'0';
        ch=getchar();
    return s*f;
}
int n,m;
vector<int> v(1);
int main(){
    n=read(); m=read();
    f(n) v.push_back(read());
    f(m) printf("%d\n",v[read()]);
    return 0;
}
2020/10/25 21:38
加载中...