Hi
Would it be possible that there is an error in the test set for the 10343d problem ?
I would usually never dare to ask such a thing, but given that this problem is brand new on the server, it could be possible, couldn't it ? Already 97 posts have been made (10 of mine), 72 of them Wrong Answer.
I'm looking for somebody who could assure me that the test set is good (getting an Accepted would be a good proof or for a judge to verify the test set... Once again, I usually would'nt ask such a thing, wouldn't the problem be brand new.
Thanks
See sticky thread in misc section. There is a post about this problem.
Ivor
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
I read all posts about problem 10343 but always get WA.
The description of the problem says that "Each dataset consists of a valid Base64 encoding of some (possibly binary) data".
But how can i take this binary data into account ?
Here the code i have submitted
Thanks for any help
[cpp]
#include <stdio.h>
char Buffer[200000] ;
class CBase64Decoding
{
public:
CBase64Decoding( const char* buffer ) ;
char CBase64Decoding::Decode( char c ) const
{
if ( c >= 'A' && c <= 'Z' ) return c-'A' ;
if ( c >= 'a' && c <= 'z' ) return 26+c-'a' ;
if ( c >= '0' && c <= '9' ) return 52+c-'0' ;
if ( c == '+' ) return 62 ;
if ( c == '-' ) return 63 ;
return -1 ;
}
inline void CBase64Decoding::Putchar( unsigned char c ) const
{
m_OutBuffer[m_OutCount++] = c ;
if ( m_OutCount==OutSize)
{
fwrite( m_OutBuffer, OutSize, sizeof( unsigned char ), stdout) ;
m_OutCount=0 ;
}
}
inline bool ValidChar( char c )
{
return
( c >= 'A' && c <= 'Z' ) ||
( c >= 'a' && c <= 'z' ) ||
( c >= '0' && c <= '9' ) ||
( c == '+' ) ||
( c == '-' ) ||
( c == '=' ) ;
}
int main()
{
char c ;
char* pc ;
//_setmode( _fileno( stdout), _O_BINARY );
do
{
pc = Buffer;
while ( ( c = getchar() ) != '#' )
{
if ( ValidChar( c ) )
*pc++ = c ;
}
if ( pc != Buffer )
{
*pc = 0 ;
CBase64Decoding( Buffer).Decode() ;
}
} while ( pc != Buffer ) ;
}
[/cpp]
hi...
I had summitted my source several times..
But. I always got RTE...
would you please tell why it is..??
And... would you tell me some inputs and outputs ?
would you tell me the approach for solving this problem.. ??
in my thought, this quiz is very terrible ...
greetings....
i have submitted my source several times...
but, i always got WA...
i dont really know why it is wrong..
who help me ?
please explain to me the reason..
the source is .....
well...
note that your input is char by char:
dont forget that '\n' is a character, so if there is a line with 76 chars + '\n', the next lines can have many chars more.
"A machine can do the work of fifty ordinary men, but no machine can do the work of one extraordinary man.", Shahriar Manzoor
as you might have seen it already ... else if (ch >='A' && ch <='z')... shouldn't it be 'a' instead of 'A' ? [ and there are characters possible between 'Z' and 'a' in ascii exclusive]
moverover... don't print any newline at the end .... it will give you Wrong Answer... and please remove your code after you've got Accepted.