What's the catch with 4. and 7. test case?
[z-sudoku]
I would call this problem really crazy. The next 16 peoples on the ranklist who hasn't got perfect score all of them has got WA for 4 and 7 testcase (me too). I have 0 idea, my code is so simple, no trick.
Always printing YES: http://www.z-trening.com/new/www/html/submit.php?subm_stat=1&submit=7100021155
Always printing NO: http://www.z-trening.com/new/www/html/submit.php?subm_stat=1&submit=7100021158
So, the problem is obviously in character occourences:
where "chars" is
:S
Always printing NO: http://www.z-trening.com/new/www/html/submit.php?subm_stat=1&submit=7100021158
So, the problem is obviously in character occourences:
for( it = chars.begin() ; it != chars.end() ; ++it ){
putchar( *it );
}where "chars" is
set <char> znakovi;:S
something is wrong with 4. and 7. test case
lol how then someone has 100 points on that task ??? LoL
I have the same problem....
"lol how then someone has 100 points on that task ??? LoL"
Or those all of got wrong codes. Reading the discussion forum on the contest I had a feel that the admins hasn't got a valid program. But maybe I'm wrong. It's just really curious that those peoples who has got <=80 points on this problem all of them got WA for 4-th and 7-th input.
Or those all of got wrong codes. Reading the discussion forum on the contest I had a feel that the admins hasn't got a valid program. But maybe I'm wrong. It's just really curious that those peoples who has got <=80 points on this problem all of them got WA for 4-th and 7-th input.
¢7943*8£6
*86¢7£934
43£986¢7*
76*8£43¢9
8437¢9*6£
9£¢6*3487
698347£*¢
3*4£6¢798
£¢7*98643that is input 7
Isn't this Unicode?
so is solution:
YES
¢£*346789
???
YES
¢£*346789
???
cout << int( ¢ ) << endl;
prints
-101
prints
-101
(the characters can be any ASCII characters with codes in the range 32..255] )
Got all passed now.
Well i got the same result 70...
Here is Robert's outout:
NO
������������������������
�������������$&
(),234>?EGIKNQSTV^_lwy{~
NO
������������������������
�������������$&
(),234>?EGIKNQSTV^_lwy{~
the first characters are "invisible" and are not shown on the screen or in the file, you have to look at the file in hex mode.
@Admin
In the tasks it says it will be ASCII code characters. but this is Unicode. Why don't remove test-cases with Unicode characters?
In the tasks it says it will be ASCII code characters. but this is Unicode. Why don't remove test-cases with Unicode characters?
I mean on training, not on competition.
It is not unicode, it is just rendered as unicode on the forum
@admin:
What's the output for the example above that you gave??
What's the output for the example above that you gave??
YES
*346789��
or if you wanted rendered in unicode
YES
*346789¢£input not in unicode
�7943*8�6
*86�7�934
43�986�7*
76*8�43�9
8437�9*6�
9��6*3487
698347�*�
3*4�6�798
��7*98643
"Here is Robert's outout:
NO"
Pasting to cmd my result:
YES
*346789Lc
(It's converted.) It's a little pointless to post characters which ASCI codes are in 128-255, because that is NOT standard, and can be totally different depending on the computer.
NO"
Pasting to cmd my result:
YES
*346789Lc
(It's converted.) It's a little pointless to post characters which ASCI codes are in 128-255, because that is NOT standard, and can be totally different depending on the computer.
true... your output is different on the grader server though..
My output is too:
YES
*346789Lc
YES
*346789Lc
input file:
http://z-trening.com/share/sudoku.07.in
sol file:
http://z-trening.com/share/sudoku.07.sol
http://z-trening.com/share/sudoku.07.in
sol file:
http://z-trening.com/share/sudoku.07.sol
Now solved. The problem was really silly: if you read it by simple char then 128-255 ascii values coded to the range [-128,-1], so at the sorting of the characters I had a mistake, but other parts of my code was good.
Same here :)
I don't get it. Can somone explain what's wrong in my code. thx.
well i used C++ sort and it's not correct ???
my output is:
cL*346789
on my comp
int(c) = -101 and int(L) = -100
and what is with:
"the characters can be any ASCII characters with codes in the range 32..255]"
???
my output is:
cL*346789
on my comp
int(c) = -101 and int(L) = -100
and what is with:
"the characters can be any ASCII characters with codes in the range 32..255]"
???
you have to use unsigned char!
my output says:
YES
*346789Lc
YES
*346789Lc
and it doesn't work at all....
Char has 8 bit
for example, space is 00100000
If first bit of char is 1, then char value is negative. Numbers from 128 to 255 have 1 on their eighth bit, so they are negative. Even though some char value is less than zero, it's in fact greater than 128.
for example, space is 00100000
If first bit of char is 1, then char value is negative. Numbers from 128 to 255 have 1 on their eighth bit, so they are negative. Even though some char value is less than zero, it's in fact greater than 128.
thx, I solved it :)
hehee i had also WA on 4 & 7 test case...
but now i have WA on 6th...
Admin can you help me??
but now i have WA on 6th...
Admin can you help me??
when I use unsigned char*, I can't input with gets, says:
[code]
z-sudoku.cpp:63: error: invalid conversion from ‘unsigned char*’ to ‘char*’
[/code]
[code]
z-sudoku.cpp:63: error: invalid conversion from ‘unsigned char*’ to ‘char*’
[/code]
U shouldn't use gets. It's unsafe...
well, if there's empty space in line, scanf wouldn't recognize it, right ?
getchar ;)
hmm, I get WR on 6th test case :S
I thnik that you made a mistake here:
if( used[i] > 9 ) return false;
what about when every characheter apperas less than 9 times
if( used[i] > 9 ) return false;
what about when every characheter apperas less than 9 times
then I return true, see two lines lower ...
Thats wrong, it should be false.
Like this one for example
Result is NO
Like this one for example
$%&'()*+,
-./012345
6789:;<=>
?@ABCDEFG
HIJKLMNOP
QRSTUVWXY
Z[\]^_`ab
cdefghijk
lmnopqrstResult is NO
No, the task statment says :" Every character has to be used exactly 9 times."
You check only > 9, you have to check !=9 and !=0
You check only > 9, you have to check !=9 and !=0
There has to be only 9 different characters, no more, no less
oh, I see, tnx :)
My AC code is using gets. So it's enough.
ca someone help me pleease :)
i got problems with 6th test case???? :S
i got problems with 6th test case???? :S
Check if more than 9 characters are used.
First of all, I want to know how to input all the characters.
I use ReadLn and I set the chars. in array.
Also for some examples I have the correct result in my cmd, but here I have none correct. something is wrong oO
I use ReadLn and I set the chars. in array.
Also for some examples I have the correct result in my cmd, but here I have none correct. something is wrong oO
This is how you input ->
ReadLn( m, n );
For i:=1 To m Do
Begin
For j:=1 To n - 1 Do Read ( Mat [i, j] );
ReadLn( Mat [i, n] );
End;
should it be
?
cuz It comes to sudoku ?
why inputing m and n
nevermind...I have no correct result :S
for i:=1 to 9 Do
For j:=1 to 9 Do read(mat[i,j]);
?
cuz It comes to sudoku ?
why inputing m and n
nevermind...I have no correct result :S
for i:=1 to 9 do
begin
for j:=1 to 9 do
read(mat[i,j]);
readln;
end;
I know, it's 1 to 9. I didn't thought that it was sudoku, I just wrote the code for reading regular matrix.
For i:=1 To 9 Do
For j:=1 To 8 Do
Begin
Read(Mat[i,j]);
ReadLn(Mat[i,9]);
End;
Yeah...I knew that, but why I always get a Wrong result !
Can I see the tests... someone from the admins. What's going wrong ?
Can I see the tests... someone from the admins. What's going wrong ?
You need to check if every character in matrix is repeating exactly 9 times! Then you need to check if every row and column has all different elements, and finally check the 3 x 3 squares. :)
I think your program is not working correctly :)
well this is ur code:
it should be
i haven't looked at ur hole code i saw just input and i think it's wrong ...
For I:=1 to 9 Do
For j:=1 to 9 Do
Begin
readln(p[i,j]);
addC(p[i,j]);
End;
it should be
For I:=1 to 9 Do
begin
For j:=1 to 9 Do
Begin
read(p[i,j]);
addC(p[i,j]);
End;
readln;
end;
i haven't looked at ur hole code i saw just input and i think it's wrong ...
Yeah..I am checking for if there are more than 9 characters.If ther are more then 9 used, it should say NO and print all chars sorted.
And I think if the whole puzzle is filled(like this task)
you can check only the rows or only the columns to see if it is corectly or not ?
As I said...my cmd gives a correct result :S :S :S
And I think if the whole puzzle is filled(like this task)
you can check only the rows or only the columns to see if it is corectly or not ?
As I said...my cmd gives a correct result :S :S :S
Also, you don't need Clrscr. And your input is not correct like demjan said
My input was correct, but I did it like you say.
I also removed the ClrScr...
I still haven't correct test :S :@ :@ :@
I also removed the ClrScr...
I still haven't correct test :S :@ :@ :@
In your last submission its still
readln(p[i,j]);I don't know what is the difference but I corrected and It's still the same :S
Can I see at least one of the test files ?
Read only reads one character, and readln reads the whole row. You also need to have one
Readln; after you read 9 characters in a row. Check Demjan's code, it should look like that. If you don't have that readln, you will read invisible (end of line) characters into your matrix, and thats wrong.
Readln; after you read 9 characters in a row. Check Demjan's code, it should look like that. If you don't have that readln, you will read invisible (end of line) characters into your matrix, and thats wrong.
Ooo...this is nice.. only the first one is wrong..
Don't know why.
but I want to say sorry for my disobedience.
:)))))
And now a little talk for the first test :D
the only incorrect :D
Don't know why.
but I want to say sorry for my disobedience.
:)))))
And now a little talk for the first test :D
the only incorrect :D
Are you checking columns also?
No..I'm checking only the rows, but If all the rows are correctly then all the columns are correct too :)
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
Rows correct, only 9 different letters used, but columns are wrong :)
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
abcdefghj
Rows correct, only 9 different letters used, but columns are wrong :)
oh crappy :D
Where is my mind this night..
can you delete all these posts :D :D :D
Where is my mind this night..
can you delete all these posts :D :D :D
I fix that and I still can't go through the first test.
I quit.
I quit.
I think you'll have to check 3x3 sub-squares also...
I don't know how...and I give up. (whew)