This is my complete code:
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define mp make_pair
#define ss second
int main(void) {
int m;
vector <string> grid;
cin >> m;
pair <int,int> foo;
pair <int,int> bar;
// bar =make_pair (10.5,'A');
foo = make_pair (1,2);
cout<<foo.ss<<endl;
for(int i=0; i<m; i++) {
string s; cin >> s;
grid.push_back(s);
int pp = s.find('p');
int mp = s.find('m');
if(pp>=0){
bar = make_pair(pp,i);
}
cout<<pp<<endl;
}
return 0;
}
This is my error:
prog.cpp: In function 'int main()':
prog.cpp:40:32: error: 'make_pair' cannot be used as a function
bar = make_pair(pp,i);
^
make_pair
gives this error when I placed it inside the for loop, it works completely fine if I place it out. Where am I going wrong?
Edit: I amtrying in codechef ide...these are the inputs
3
---
-m-
p--