hi guys, Im new to codeforce. My question is for problem# 318A EVEN ODD I've used ordered map in this question but not getting the answer. Please do let me know where Im wrong........
int main() { int i, j; map<int, int> m; int n, k; cin>>n>>k;
for (i =1, j=1; j <=n; i++, j+2) { m[i]= j; } for (i, j=2; j <=n; i++, j+2) { m[i]= j; } auto it= m.find(k); if(it!=m.end()) { cout<<endl<<(*it).second; }
}