evilbuggy's blog

By evilbuggy, history, 3 years ago, In English

We invite you to participate in CodeChef’s Starters 14 this Wednesday, September 29th, rated for division 3 coders.

Time: 8 PM — 11 PM IST.

Joining me on the problem setting panel are:

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating.

Good Luck!

Full text and comments »

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

By evilbuggy, history, 6 years ago, In English
#include <bits/stdc++.h>

using namespace std;

bool overflow(long long int a, long long int b){
    long long int c = a*b;
    cout<<a<<" "<<b<<" "<<c<<" "<<c/a<<" "<<c/b<<endl;
    return (c/b) != a;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long int a = 847288609443LL; // 3^25
    cout<<overflow(a, a)<<endl;
}

When I run the above code in my PC I get the following output...

847288609443 847288609443 6048575297968530377 7138742 7138742
1

But when I run it on codeforces I get the following output....

847288609443 847288609443 6048575297968530377 7138742 847288609443
0

What could be the problem here? Btw Why c/a and c/b different in codeforces output though a and b have same value?

Please help me out.

Full text and comments »

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

By evilbuggy, history, 7 years ago, In English

Broken Profile DP

My first blog post :) Any constructive feedback is welcome.

Full text and comments »

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