Search found 13 matches

Wed Jan 21, 2004 9:47 am
Forum: Volume 105 (10500-10599)
Topic: 10515 - Powers Et Al.
Replies: 124
Views: 31902
Master wrote:Yes, I agree with seadoo.
one digit of m and two digits of n are enough.

M H Rasel
CUET Old Sailor
I know the trick of finding the repeated sequence of [the last digit of m] poweres n to get the same correct answer, but could anyone please explain why the last two digits of n is enough?
Sun Oct 19, 2003 4:52 am
Forum: Volume 4 (400-499)
Topic: 445 - Marvelous Mazes
Replies: 93
Views: 12114
This is my WA code. [code] int number=0; char printchar; string line; getline(cin, line); while(cin.good()){ int len = line.length(); for(int i=0; i<len; i++){ if(isdigit(line[i])) number += int(line[i]-'0'); else{ printchar = line[i]; if(printchar == 'b') printchar = ' '; else if(printchar == '!'){...
Tue Jun 03, 2003 5:56 am
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 22688
Thank you. I got AC.
I should have examined my code more carefully.
Mon Jun 02, 2003 11:26 am
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 22688
My code is: #include <iostream> using namespace std; int FindMinBase(char *number) { int max=0, temp; char *current=number; while(*current!='\0') { if(*current>='0' && *current<='9') temp=(int)(*current-'0'); else temp=10+(int)(*current-'A'); if(temp>max) max=temp; current++; } if(max==0) return 2; ...
Wed May 07, 2003 1:02 pm
Forum: Volume 4 (400-499)
Topic: 445 - Marvelous Mazes
Replies: 93
Views: 12114

The following is my code, could anyone figure out why I always got WA? [cpp] #include <iostream> #include <cctype> using namespace std; void main() { char read_in[3000], *ptr; short repeat, i; cin.getline(read_in, 3000); while(cin.good()) { ptr=read_in; repeat=0; while(*ptr!='\0') { if(isdigit(*ptr)...
Sat May 03, 2003 10:33 am
Forum: Volume 2 (200-299)
Topic: 264 - Count on Cantor
Replies: 47
Views: 14756
[quote="xenon"]No, the sample output is right. The order in which the terms are counted is:
[code]
1 2 6 7 15
3 5 8 14
4 9 13
10 12
11
[/code]
for the first 15 terms. It's a zig-zag![/quote]

I thoutht I made the same mistake!
But I think the description should be a little clearer.
Sat May 03, 2003 10:28 am
Forum: Volume 102 (10200-10299)
Topic: 10298 - Power Strings
Replies: 31
Views: 14161

10298-Run Time Error

Invalid memory reference!!
I declared a char array that contains 1 million units.
I wonder if it caused the error!
Tue Feb 04, 2003 4:48 am
Forum: Volume 3 (300-399)
Topic: 382 - Perfection
Replies: 95
Views: 21544

help on q382

I got a WA. Can anyone help me figure out why? [cpp]#include<iostream> #include<iomanip> #include<math.h> using namespace std; void main() { long input, sum, factor, factor2, sq; cout << "PERFECTION OUTPUT" << endl; cin >> input; while(input) { sum=1, factor=2; sq=(long)sqrt(input); if((sq+1)*(sq+1)...
Tue Feb 04, 2003 4:04 am
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 24836

I'm sure I've prevented "t_base" from being 1, since before this part I have an "if" to handle the problem directly when there is only ONE working cat. For example, when I input "64 1", I will get "6 127", right answer, isn't it? Or did I ignored any other "except" situations?
Mon Feb 03, 2003 4:50 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 24836

Floating point exception

I have tried lots of inputs (partly from the Problemset Archive and partly from some discussions about q107) by hand and it always gave me right answers. I can't figure out why I should get "float point exception." The followings are the considered most "fragile" part in my code. I hope someone can ...
Fri Jan 31, 2003 11:14 am
Forum: C
Topic: Invalid Memory Reference
Replies: 3
Views: 2335

The discription of the problems

Sometimes the description of the problems really confuses me. For example, q477 should be a very easy one; after I enlarged my array size (for example, double something[10000]), I got "accepted" response. However, the description didn't mention it would be rejudged. Insted, it clearly mentioned ther...
Thu Jan 30, 2003 4:17 am
Forum: C
Topic: Invalid Memory Reference
Replies: 3
Views: 2335

Invalid Memory Reference

Some of my programs work well in my computer, but I will get a "Invalid Memory Reference" crash message. What does it mean? How could I fixed the problem?
Thu Jan 30, 2003 4:12 am
Forum: Volume 4 (400-499)
Topic: 477 - Points in Figures: Rectangles and Circles
Replies: 11
Views: 1974

477 - Points in Figures: Rectangles and Circles

My program works well in my computer, but I always get a "Inavlid memory reference" crash message. I can't figure out why. Maybe someone could help me? --------------------------------------------------------------------------- #include<stdio.h> #include<stdlib.h> #define RECTANGLE 1 #define CIRCLE ...