We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C++
- Introduction
- Variable Sized Arrays
- Discussions
Variable Sized Arrays
Variable Sized Arrays
Sort by
recency
|
1404 Discussions
|
Please Login in order to post a comment
am i wrong to say that the sample answers are incorrect? seems 0,1 and 1,3 should access 1 and 8 respectively rather than 5 and 9. Sample Input
2 2 3 1 5 4 5 1 2 8 9 3 0 1 1 3 Sample Output
5 9
I just implemented without vector!
Please be careful about Memory Leaks!!!
include
include
using namespace std;
int main() { int n, q; cin >> n >> q;
}
//easy solution using array of vectors
include
include
include
include
include
using namespace std;
int main() {
int n,q; cin>>n>>q; int a; int i,j; vectorarr[n]; int col=0; for(int i=0;i>col; for(int j=0;j>a; arr[i].push_back(a); } } for(int m=0;m>i>>j; cout<