Search found 12 matches

by technogeek
Tue Jun 24, 2003 9:15 pm
Forum: Volume 105 (10500-10599)
Topic: 10515 - Powers Et Al.
Replies: 124
Views: 45278

Allright here's a hint......
Do you really have to carry out the multiplications to find the last digit ?

Example : 9^1 = 9
9^2 = ..1
9^3 = ..9
9^4 = ..1

etc. where .. denotes digits other than last digit.
by technogeek
Tue Jun 24, 2003 2:51 am
Forum: Volume 101 (10100-10199)
Topic: 10139 - Factovisors
Replies: 80
Views: 42025

(factorial == EOF) ??????????

[cpp] if(factorial == EOF)
break;[/cpp]
Are you sure that works ?

I usually use : [cpp]if(feof(stdin)) break;[/cpp]

People often use the number of fields successfully scanned, returned by scanf(), to terminate their loop.... [cpp]while(scanf("%d",&variable)==1)
{
Dostuffwithvariable();
}[/cpp]
by technogeek
Tue Jun 24, 2003 2:40 am
Forum: Volume 105 (10500-10599)
Topic: 10515 - Powers Et Al.
Replies: 124
Views: 45278

Error No 1 :

[cpp]if(!m && !m) break;[/cpp]

You probably mean [cpp]if(!m && !n) break;[/cpp]

And I can tell you there are more..... :-?
I wrote close to 150 lines to solve this problem.....takes 0.070 secs.
by technogeek
Thu Jun 19, 2003 12:15 am
Forum: Volume 7 (700-799)
Topic: 756 - Biorhythms
Replies: 32
Views: 13706

Problem Accepted with P.E.

Thanks a lot for the test cases. A little investigation reavealed you may assume that a triple peak will occur within 21252 days of the given date.

I had assumed 21252 days from beginning of year.

Also, even the extra line that you had mention gave me a WA. However even after I removed that, I ...
by technogeek
Wed Jun 18, 2003 7:44 am
Forum: Volume 7 (700-799)
Topic: 756 - Biorhythms
Replies: 32
Views: 13706

756 Biorhythms

Can't imagine why I get WA. Some nice test cases may help if you can't point out my mistake......
#include<iostream.h>

main()
{
int p,e,i,d,z,count=1,cases;

for(cin >> cases;cases--;){
while(1)
{
cin>>p>>e>>i>>d;
if(p==-1) break;

p = p % 23;
e = e % 28;
i = i % 33;

z = (d/33*33)+i ...
by technogeek
Mon Jun 16, 2003 12:10 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 116567

Remove //sign before @ sign

Perhaps // before @end_of_source_code is giving trouble.

Remove // from @begin_of_source_code also.

Take care to put both on independant lines.
by technogeek
Sun Jun 15, 2003 3:02 pm
Forum: Algorithms
Topic: Longest Increasing Subsequence
Replies: 2
Views: 2491

NO...Not LCS

Nope. Not Longest Common Subsequence. Check out this link, it has some description :

Definition : http://mathworld.wolfram.com/LongestInc ... uence.html
Analysis : http://www2.toki.or.id/book/AlgDesignMa ... NODE47.HTM

I am still searching for good info on how to solve it.
by technogeek
Fri Jun 13, 2003 5:08 pm
Forum: Algorithms
Topic: Longest Increasing Subsequence
Replies: 2
Views: 2491

Longest Increasing Subsequence

In the problem History Grading I need to use this algorithm but don't know how. Can someone plese show me how to find LIS from an array of integers (named 'answer') in C code ?
by technogeek
Thu Jun 05, 2003 11:56 am
Forum: Off topic (General chit-chat)
Topic: How old are you? Statistics.
Replies: 121
Views: 195307

Newbie

I am 18. Joined very recently. Solved only 5 problems yet. Anybody want to point out the easy questions to me ?
by technogeek
Tue Jun 03, 2003 9:00 am
Forum: Volume 8 (800-899)
Topic: 808 - Bee Breeding
Replies: 19
Views: 13329

Solved Bee Breeding yet ?

I came across an old post of yours.....if you still need help with Bee Breeding : take a hint from http://onkar.s5.com/codezone .
by technogeek
Tue Jun 03, 2003 7:26 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317862

Problem Solved

Oh hell........my mailer yahoo kept adding lines at the end. I included the @end_of_source_code and it compiles now. Thanks for your attention.
by technogeek
Sun Jun 01, 2003 12:28 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317862

Judge gives compile error but Dev C++ compiles and runs.

I tried to solve the first problem and it runs fine on my computer Win200, Bloodshed Dev C++ without errors. But the online judge says compile error. 01624693_24.c:38: syntax error before `!' . What the hell is wrong ?

/* @JUDGE_ID: xxxxxxx 100 C++ */
#include <stdio.h>

long int cycle,biggest ...

Go to advanced search