题目:#258. vector 使用练习题 链接:https://syzoj.com/problem/258 题解:太大的数组或其他要放在主函数外面 代码:
#include<vector>
#include<cstdio>
#include<iostream>
#define maxn 100001
using namespace std
;
vector
<int>v
[maxn
];
int main()
{
int n
,m
;
int t
;
scanf("%d%d",&n
,&m
);
for(int i
=0;i
<n
;i
++)
{
v
[i
].resize(m
);
for(int j
=0;j
<m
;j
++)
{
scanf("%d",&v
[i
][j
]);
}
}
int tt
;
scanf("%d",&tt
);
while(tt
--)
{
int i
,j
;
scanf("%d%d",&i
,&j
);
printf("%d\n",v
[i
-1][j
-1]);
}
return 0;
}
转载请注明原文地址:https://blackberry.8miu.com/read-33986.html