Please read the new rule regarding the restriction on the use of AI tools. ×

ric_hagsfd's blog

By ric_hagsfd, history, 14 months ago, In English

hi guys

for these question set

https://codeforces.me/gym/104493

can u suggest solutions or editorials

Full text and comments »

  • Vote: I like it
  • -1
  • Vote: I do not like it

By ric_hagsfd, history, 20 months ago, In English

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;

}

}

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it