|
|
Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | Test #1 (and maybe others) must be changed! | Roman Lipovsky | 1242. Оборотень | 13 ноя 2006 18:38 | 2 | Test #1 (and maybe others) must be changed! Input format : child_parent But test #1 contains extra spaces! At first submit i got WA, but my program was absolutly right. Then i include extra spaces checking and get AC. I also wa at #1,in my prog I need to know the space exact position.At first I don't know why wa at all!!!The test must be changed!!!! | for anyone who wants to solve this problem: | Koala | 1242. Оборотень | 14 окт 2004 04:48 | 5 | Maybe the format of input is not: number_number. ("_"represent a space) So please read it one character by another. readln(n); fillchar(a,sizeof(a),0); fillchar(b,sizeof(b),0); while true do begin read(ch); while ch=' ' do read(ch); if ch='B' then begin readln; break; end; x:=0; while ch<>' ' do begin x:=x*10+ord(ch)-ord('0'); read(ch); end; readln(y); insert(a[x],y); insert(b[y],x); end; Maybe you are right ! I change my reading procedure (not like you) and I got AC At first,I used String to read data. But I WA on text#1. Finally,I realized that the input formal is like this: number_number_.There may be some '_' after the second number. I improve my program and got AC. But you don't need to read character by character. You read a string, then delete all the spaces at its end, and you'll get AC. | Whether the werewolf can kill itself? | Aleksey (BMSTU IU7) | 1242. Оборотень | 14 июл 2003 21:10 | 2 | No (-) Dmitry 'Diman_YES' Kovalioff 14 июл 2003 21:10 |
|
|
|