Search found 8 matches

by zhartley
Tue Aug 13, 2002 12:06 am
Forum: Volume 4 (400-499)
Topic: 400 - Unix ls
Replies: 93
Views: 18374

Thanks, I got accepted! One of these days, I swear I'll learn to better test corner cases.... :lol:
by zhartley
Mon Aug 12, 2002 11:26 pm
Forum: Volume 4 (400-499)
Topic: 400 - Unix ls
Replies: 93
Views: 18374

Ok, thanks for pointing out the use of size() instead of length() and the extra two spaces at the end of the line. However, I'm afraid I'm confused by the following: And the Runtime error is because of %0 and /0. They occur because 60/(longest+2) is not the correct value. I do not have any idea what...
by zhartley
Sun Aug 11, 2002 11:26 pm
Forum: Volume 4 (400-499)
Topic: 400 - Unix ls
Replies: 93
Views: 18374

I too am having problems with this problem, namely that the online judge has told me a) compile error or b) runtime error (2 different submissions of the same exact source code). It runs perfectly for me, and I've been looking over it for a day or two and nothing stands out to me as wrong... [cpp] /...
by zhartley
Mon Aug 05, 2002 12:21 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 17946

well, i've been re-reading my copy of The C++ Programming language (and re-reading it and re-reading it...) and I'm still extremely confused (the documentation sucks (or i do :))). In any event, this is what I am working with right now (which still gets a WA) [cpp] #include <iostream> #include <cmat...
by zhartley
Mon Jul 29, 2002 11:49 pm
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 17946

Beguiling WA for 113

Yes, I know this problem already has a thread, however this is a slightly different problem... Does _anybody_ know how to explain how I get an accepted with this: [c] #include <stdio.h> #include <math.h> int main(void) { int n; double p; while (scanf("%d %lf", &n, &p) == 2) { printf("%.0lf\n", exp(l...
by zhartley
Sat Jul 27, 2002 2:42 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 17946

zth@littledaemon$ grep "exp" /usr/include/g++/cmath | grep "long double" long double exp (long doulbe); long double frexp(long double, int*); long double frexp(long double, int*); zth@littledaemon$ grep "log" /usr/include/g++/cmath | grep "long double" long double log (long double); long double log...
by zhartley
Sat Jul 27, 2002 1:38 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 17946

ok....i tried using logarithms.... [cpp] @begin_of_source_code /* @JUDGE_ID: 21301HT 113 C++ */ #include <iostream> #include <cmath> using namespace std; int main(void) { register long double n, p, k; while (cin >> n >> p) { k = exp( log(p) / n ); cout << k << endl; } return 0; } @end_of_source_code...
by zhartley
Fri Jul 26, 2002 5:45 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 17946

Any idea why I get wrong answers for both of the following?: [cpp] /* @JUDGE_ID: 21301HT 113 C++ */ #include <iostream> #include <cmath> using namespace std; int main(void) { register long long n, p, k; while (cin >> n >> p) { k = static_cast<long long>(pow(p, (1.0 / n))); cout << k << endl; } retur...

Go to advanced search