Search found 17 matches

by himanshu
Fri Nov 23, 2007 9:08 am
Forum: Volume 8 (800-899)
Topic: 880 - Cantor Fractions
Replies: 24
Views: 17251

TLE

I get TLE for this. #include<iostream> #include<cmath> long long sum_n(long long n) { return (n*(n+1))/2; } int main() { long long i; while(std::cin >> i) { long long n; for(n = (long long)(sqrt(i)); sum_n(n) < i; n*=2) ; n /= 2; for(; sum_n(n) < i; n++) ; n--; long long x = i-sum_n(n); long long y ...
by himanshu
Wed Nov 21, 2007 2:00 pm
Forum: Volume 112 (11200-11299)
Topic: 11219 - How old are you?
Replies: 117
Views: 33599

Re: Wrong Answer 11219!!!

Did you try this test case posted earlier in this thread?

Code: Select all

1

01/02/1984
02/01/1984 
Thank You,
HG
by himanshu
Wed Nov 14, 2007 2:16 pm
Forum: Volume 9 (900-999)
Topic: 924 - Spreading The News
Replies: 17
Views: 10231

Amazing

You are amazing. May I ask you the secret.

Thank You,
++imanshu
by himanshu
Tue Nov 06, 2007 7:05 pm
Forum: Volume 9 (900-999)
Topic: 924 - Spreading The News
Replies: 17
Views: 10231

924 WA

The following works for the sample posted in this thread but the judge gives WA. #include<iostream> #include<map> #include<list> #include<queue> #include<algorithm> void post_process(std::map<int, int>& d, std::map<int, int>& p) { // count how many times each depth appears std::map<int, int> c; for(...
by himanshu
Tue Oct 30, 2007 7:41 pm
Forum: Volume 112 (11200-11299)
Topic: 11220 - Decoding the message.
Replies: 54
Views: 20464

WA

Please help me with this. I have tried samples posted in this thread. Judge gives me WA #include<iostream> #include<string> #include<sstream> using namespace std; int main() { int T; cin >> T; string s; getline(cin, s); getline(cin, s); for(int i = 1; i <= T; i++) { cout << "Case #" << i << ":" << e...
by himanshu
Mon Oct 29, 2007 1:45 pm
Forum: Volume 112 (11200-11299)
Topic: 11219 - How old are you?
Replies: 117
Views: 33599

Greater than 130?

Code: Select all

1

01/01/2031
02/01/1900 
Shouldn't the above output "Check birth date" because the age is greater than 130 even though it is not 131 years.

The judge accepts 130.

Thank You,
HG
by himanshu
Sun Oct 28, 2007 8:27 am
Forum: Volume 9 (900-999)
Topic: 962 - Taxicab Numbers
Replies: 16
Views: 10250

Thanks it compiled

:D
by himanshu
Sat Oct 27, 2007 7:21 pm
Forum: Volume 9 (900-999)
Topic: 962 - Taxicab Numbers
Replies: 16
Views: 10250

962 Compilation Error

Judge gives me CE but my compiler doesn't :( #include<iostream> using namespace std; /* STORE THE OFFSETS OF CUBIC SUMS FROM n1 HERE */ int count[100001]; void find_sum_of_cubes(unsigned long int n1, unsigned long int rg) { int i; /* init the counter of combinations */ for(i = 0; i < 100001; i++) co...
by himanshu
Sat Oct 20, 2007 8:09 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 51322

Can it have two answers

If several x satisfy the criteria above, choose the first one in alphabetical order.
Can this problem have two answers or that is just to confuse the extra cautions.

Thank You,
HG
by himanshu
Fri Oct 19, 2007 1:02 pm
Forum: Volume 102 (10200-10299)
Topic: 10209 - Is This Integration ?
Replies: 37
Views: 12213

Thanks

It worked!
by himanshu
Fri Oct 19, 2007 11:56 am
Forum: Volume 102 (10200-10299)
Topic: 10209 - Is This Integration ?
Replies: 37
Views: 12213

10209 TLE!

Could you please tell me why this gives me TLE

Code: Select all

#include<stdio.h>

int main()
{
    //snipped
    while(scanf("%lf", &r))
    {
        //snipped
    }
}
by himanshu
Tue Oct 16, 2007 7:00 am
Forum: Volume 102 (10200-10299)
Topic: 10219 - Find the ways !
Replies: 33
Views: 10287

The judge gives me Run Time Error for the following code :- #include<iostream> #include<cmath> #include<vector> using namespace std; long double logNfactorial(unsigned long int n) { //static to reuse past stored results static vector<long double> logNf(2, 0); for(int i = logNf.size(); i <= n; i++) l...
by himanshu
Wed Nov 15, 2006 4:57 pm
Forum: Volume 100 (10000-10099)
Topic: 10004 - Bicoloring
Replies: 93
Views: 29330

10004 WA

Hi, My code works on the sample input and also the test cases supplied in this board for this problem. I don't think I need an explicit DFS. Kindly help:- #include<iostream> int G[200][200]; // graph's adjacency matrix int n; // nodes bool valid(int k, int color, int colored[]) { for(int v = 0; v < ...
by himanshu
Tue Aug 29, 2006 12:50 pm
Forum: Bugs and suggestions
Topic: Java Compiler
Replies: 1
Views: 1486

Java Compiler

Hello, I was wondering what it takes to use the Sun's Java Compiler in the online-judge. It appears as if it is not too much of an effort if we keep the constraints of the classname as Main etc, but I could be wrong. Nevertheless, I am ready to sponsor the inclusion to the extent it is affordable. T...
by himanshu
Tue Jun 13, 2006 8:42 am
Forum: Volume 2 (200-299)
Topic: 282 - Rename
Replies: 19
Views: 8243

Hello, For the following input:- a.c ab.c end rename a*.c ab*.c end b.d a.c end rename *d *txt rename a* x* end abFile001.c abFile001.cxx abprog001.c abfile.c abFile.c abFileprog.c end rename abFile*.c bprog*.cxx end acm.c end rename ac*.c ib*.cpp end ab abab end rename ab*ab asd*asd end my program ...

Go to advanced search