asim2005's blog

By asim2005, 3 months ago, In English

https://codeforces.com/problemset/problem/1016/A

Why should I modulo the variable ? I couldn't understand the mathematical things they have used in the tutorial.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By asim2005, 3 months ago, In English

https://codeforces.com/problemset/problem/903/A

In the tutorial, they are saying "For example, you could just iterate on the values of a and b from 0 to 33 and check if 3a + 7b = x." Why is it 33 and no other number ? Please explain it to me.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By asim2005, 3 months ago, In English

https://codeforces.com/problemset/problem/412/B

I couldn't understand the logic behind the first tutorial (**not** the bruteforce one). Can anyone help me?

Read more »

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

By asim2005, 4 months ago, In English

https://codeforces.com/contest/1398/problem/A

I couldn't understand the tutorial of the problem, particularly the first line (The triangle with side a >= b >= c is degenerate if a >= b + c. So we have to maximize the length of the longest side (a) and minimize the total length of other sides (b + c).)

Please explain it to me.

Read more »

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

By asim2005, 4 months ago, In English

https://codeforces.com/contest/1345/problem/A

I have read the editorial and tried to implement a code. But it was incorrect. Can anybody please help me?

Read more »

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

By asim2005, 4 months ago, In English

https://codeforces.com/problemset/problem/1323/A

I have found something confusing in this problem.

This is the solution mohammadmahdi.hamidzadeh wrote.

include <bits/stdc++.h>

using namespace std;

int main(){ int t;cin>>t;while(t--){ int n,a=0,x;cin>>n; for(int i=1;i<=n;i++){ cin>>x; if(x%2==0)a=i; } if(a)cout<<1<<endl<<a<<endl; else{ if(n==1)cout<<-1<<endl; else cout<<2<<endl<<1<<" "<<2<<endl; } } }

I changed a little bit in this code.

include <bits/stdc++.h>

using namespace std;

int main(){ int t; cin>>t; while(t--){ int n,a = 0,x; cin>>n; for(int i=1;i<=n;i++){ cin>>x; if(x%2==0)a=i; } if(a)cout<<1<<endl<<a<<endl; else{ if(n==1)cout<<-1<<endl; else cout<<2<<endl<<1<<" "<<2<<endl; } } return 0; } // This is my code

But after this change, the outputs I am getting are wrong. I cannot understand this.

My question is : Where did I messed up?

Read more »

 
 
 
 
  • Vote: I like it
  • +7
  • Vote: I do not like it

By asim2005, 4 months ago, In English

https://codeforces.com/problemset/problem/1323/A

I have been trying for a long time but couldn't get a correct code for this problem. Is there anybody who can help me in solving this problem ?

Read more »

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

By asim2005, 4 months ago, In English

https://codeforces.com/problemset/problem/1405/A

In this problem, I couldn't understand the "adjacent" thing. Can anybody please help me ? Thanks in advance.

Read more »

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

By asim2005, 4 months ago, In English

https://codeforces.com/problemset/problem/1180/A

Isn't the time complexity of the problem I mentioned above is o(1) ? In the tutorial they are saying o(n) ?

Read more »

 
 
 
 
  • Vote: I like it
  • +2
  • Vote: I do not like it

By asim2005, 4 months ago, In English

https://codeforces.com/problemset/problem/1250/F

Can anybody please help me in solving this problem?

Read more »

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