Search found 48 matches

by triplemzim
Wed Oct 30, 2013 1:14 pm
Forum: Volume 102 (10200-10299)
Topic: 10229 - Modular Fibonacci
Replies: 53
Views: 17043

Re: 10229 - Modular Fibonacci

Its the 1st problem i solved on matrix exponentiation. To learn it,read this fine tutorial: http://zobayer.blogspot.com/search/label/matrix%20exponentiation. Dont forget to use long long as intermediate calculation can cross int limit. it is also my first problem... on Matrix exponentiation. Nice t...
by triplemzim
Tue Oct 29, 2013 12:02 pm
Forum: Volume 5 (500-599)
Topic: 544 - Heavy Cargo
Replies: 32
Views: 14489

Re: 544 - heavy cargo

still TLE... :( here is my updated code: #include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<queue> #include<cstring> #include<map> using namespace std; struct data { int u,e,cst; bool operator<(const data &p)const { return cst<p.cst;} }; vector<int>v[210]; int cost[210...
by triplemzim
Mon Oct 28, 2013 10:06 pm
Forum: Volume 6 (600-699)
Topic: 615 - Is It A Tree?
Replies: 71
Views: 23361

Re: 615 - Is It A Tree?

For those who are getting WA::
If there is no node then it is a tree.... so

for test case:
input:

Code: Select all

0 0 -1 -1
output:

Code: Select all

Case 1 is a tree.
by triplemzim
Sun Oct 27, 2013 10:54 pm
Forum: Volume 5 (500-599)
Topic: 544 - Heavy Cargo
Replies: 32
Views: 14489

Re: 544 - heavy cargo

problem id: 544 , heavy cargo why getting TLE... please help: #include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<queue> #include<cstring> #include<map> using namespace std; class data { public: int u,e,cst; bool operator<(const data &p)const { return cst<p.cst;} }; vec...
by triplemzim
Sun Oct 27, 2013 10:23 pm
Forum: Volume 3 (300-399)
Topic: 336 - A Node Too Far
Replies: 121
Views: 39748

Re: 336 WA

brianfry713 wrote:Try the I/O I posted in this thread.

got AC thanks... :)
by triplemzim
Wed Oct 23, 2013 9:54 pm
Forum: Bugs and suggestions
Topic: submission error
Replies: 8
Views: 3715

Re: submission error

brianfry713 wrote:gets returns NULL if EOF is reached.
http://www.cplusplus.com/reference/cstdio/gets/
thank you, got AC
by triplemzim
Wed Oct 23, 2013 8:21 pm
Forum: Volume 4 (400-499)
Topic: 469 - Wetlands of Florida
Replies: 63
Views: 21105

Re: Wetlands Of Florida - 469

Code: Select all

AC :)
thanks, shuvokr and brianfry713
the most important thing is that after the last case there is no blank line. so you have to terminate that program when EOF reached... :)
by triplemzim
Wed Oct 23, 2013 6:57 pm
Forum: Volume 3 (300-399)
Topic: 336 - A Node Too Far
Replies: 121
Views: 39748

Re: 336 WA

please help why getting WA???? in problem: 336 , A node too far: here is my code: #include<iostream> #include<cstdio> #include<map> #include<vector> #include<queue> #include<cstring> using namespace std; int main() { vector<long long int> v[110]; vector<long long int> :: iterator it; map<long long i...
by triplemzim
Tue Oct 22, 2013 10:06 am
Forum: Bugs and suggestions
Topic: submission error
Replies: 8
Views: 3715

Re: submission error

Most probably there won't be any blank line after the last input (for the above problem 469), but my program is not ending without getting that blank line so can you please tell me that how can i decide that this is the last input and terminate my program???
by triplemzim
Tue Oct 15, 2013 9:06 am
Forum: Bugs and suggestions
Topic: submission error
Replies: 8
Views: 3715

Re: submission error

problem: 469 why getting submission error?? please help #include<iostream> #include<cstdio> #include<cstring> #include<stdlib.h> using namespace std; char cell[100][100]; int length[100],result[10010]; int color[100][100]; int r,s; int get_len(int i,int j) { if(i>r || j>=length[i] || i<0 || j<0) ret...
by triplemzim
Tue Aug 27, 2013 2:01 am
Forum: Volume 113 (11300-11399)
Topic: 11362 - Phone List
Replies: 19
Views: 9012

Re: 11362 - Phone List

yup got it!!!! it's called lexicographical sorting
by triplemzim
Mon Aug 19, 2013 1:53 am
Forum: Volume 5 (500-599)
Topic: 514 - Rails
Replies: 79
Views: 24499

Re: 514 - RE

thanks... brianfry713
by triplemzim
Sun Aug 18, 2013 10:37 pm
Forum: Volume 113 (11300-11399)
Topic: 11362 - Phone List
Replies: 19
Views: 9012

Re: 11362 - Phone List

why i am getting TLE please help First find out the sorted form of strings in O(nlgn) time . U can sort it by qsort too. Then scan previous and next string to find if the previous string is a substring of next string. Hope it will help... ############################################## I have expres...
by triplemzim
Sun Aug 18, 2013 10:34 pm
Forum: Volume 113 (11300-11399)
Topic: 11362 - Phone List
Replies: 19
Views: 9012

Re: 11362 - Phone List

Why getting TLE please help??? here is my code... #include<iostream> #include<cstdio> #include<math.h> #include<string.h> using namespace std; int min(int a,int b) { if(a<b) return a; else return b; } int main() { char ch[10009][11]; int cases,n; scanf("%d",&cases); while(cases--) { scanf("%d",&n); ...
by triplemzim
Fri Aug 16, 2013 1:40 am
Forum: Volume 5 (500-599)
Topic: 514 - Rails
Replies: 79
Views: 24499

Re: 514 - RE

Thanks.. i got the point... But would you please tell me how to find out such kind of errors (if there is any specific process to find) ??

Go to advanced search