mrTux's blog

By mrTux, 6 years ago, In English,

some times ago i learned LCA and now i am looking for some problems which are solved by the idea to find lca by segment tree to absorb the idea better.does anybody have a suggestion??if you wanna read more about this idea you can read the LCA article in topcoder.

Read more »

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

By mrTux, 7 years ago, In English,

[problem:166e]in the problem 166e i can't have more than 32mb while it's written in the memory part of the problem "memory limit per test:256 megabytes"!!

this is the report when i unexpectedly faced the Compilation error: "Can't compile program.cpp:Compiled file is too large [80663040 bytes], but maximal allowed size is 33554432 bytes [CompileRequest {id='program.cpp', description='', file='program.cpp', type='cpp.g++0x'}].".i'm sure that the only problem my code can contain is memory limit as when i reduced the memory of my code it compiled & passed 12 tests.and this is my code.

Read more »

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

By mrTux, 7 years ago, In English,

guys I was using double in my code but unexpectedly it's printed "nan" in output!!! can anyone tell me where did it originated form??

double y;

cout<<1-y; __ wrong output format Expected double, but "nan" found

Read more »

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

By mrTux, 7 years ago, In English,

First of all I wanna notice that because I'm not an English person there may be some English problems,I fully apologize for it & I would appreciate if U could tell me.

I've gotta question about my code.when I test it on dev cpp(v 4.9.9.2) it returns the answer but the problem is not only it doesn't even run but also it doesn't even output an endl!!when you see the code below I would appreciate if you could find the bug & tell me.and I don't wanna you debug it to me I only wanna make it work on the server.(you can check my submission on this link for the history of not running the code.)

include

include

include

include

include

include

include

include

include

include

include

include

include

include

include

include

include

include <assert.h>

include

include

include

include

include <conio.h>

using namespace std;

define FOR(i, a, n) for (register int i = (a); i < (int)(n); ++i)

define Size(n) ((int)(n).size())

define ll long long

define pb push_back

define X first

define Y second

define EPS 1e-10

define mp make_pair

define MFOR(i,m,n) for(int i=m;i>n;i--)

define error(x) cerr<<endl<<x<<endl;

define st return 0;

void error2(const string &s,const int &t){ cerr<<endl<<" "<<s<<" = "<<t<<endl; }

int main(){

int n;
cin>>n;
pair <int,int> a[n];

n*=2; cout<<1; vector <pair<int,int> > pee; cout<<21; FOR(i,0,n){ cin>>a[i].X; a[i].Y=i+1; } cout<<321; sort(a,a+n); cout<<4231; cout<<endl; for (int i=0;i<n;i+=2){ if(a[i].X != a[i+1].X){ cout<<-1; st; } else{ pee.pb(mp(a[i].Y,a[i+1].Y)); } } cout<<54321; FOR(i,0,Size(pee)) cout<<pee[i].X<<" "<<pee[i].Y<<endl; #ifndef ONLINE_JUDGE cout<<endl; #endif st; }

Read more »

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