Общий форум| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | | wa 12 | unlucky [Vologda SPU] | 1408. Умножение многочленов | 4 фев 2010 21:21 | 1 | wa 12 unlucky [Vologda SPU] 4 фев 2010 21:21 Try to check your output in case, were coefficient's are negative. For example: 0*z^2-z^1 ans -z It's very important to check output of singums! | | for 6 test | unlucky [Vologda SPU] | 1408. Умножение многочленов | 4 фев 2010 19:56 | 1 | | | what is answer for ... ? | Zayakin Andrey[PermSU] | 1745. Ещё Один Ответ | 4 фев 2010 12:54 | 2 | 4 )(( ( )) ))((( 20 )(( ( )) ))((( )(( ( )) ))((( )(( ( )) ))((( )(( ( )) ))((( )(( ( )) ))((( 200 ())()))))((((((()()())())())(()()()((()(() ()((()())(((((())()))))))))()()))(()(())))))())()(()))((((()))()()(()))(((()))()((()()))()))((((((((((()()))))())()()()()((())())))()( )()(())))(()()((()(()()(()(())()))(()(((((()()))))))(()(()))))()()(() ()))())))((()))())(((())(()))((()(((()()())(())()(()())(()(()())(((()(((()(((())())())()()((((()))(()()))()))((()())()(()))(()())))(()()(())))))(()(()(()())( )(()(((()()((()(((())))))()()))((())(()))()(())))())(()))())()))()()(())())((()((()()))()(((())))))(((( ))))()()()())((())(()()()((()))()()()()))(()))()((((())()()((((((())(()))))(()(((((()()())(((((()))(())((()())()())()(((())(()))()()(()))())((())()(()(()( ))(()()(((())(()((((()()((((())()())()()))(()((()()(()))((())))(((())())()((()))()((()()()))(()))()((((()((()(()(((((())))()))))(()))()(()()( ))((())())((((())())(())))))(( ())(( ))()))))))((()(((()))))(())))()()()))((())))))(()()(()(())()))((()()((((())(()())()())((((((())()(((()())))())))((((())()())(()()(())))(()((((()()())(()))(()()(())))) ()))()()(()()(()(())))((())))()))()))())()()()))()(()())())))())))((())()))))())))(()()( ()())(()()))()(()() ))))()(((((()))()()()(()()(()()()()))((((()(())))(()())))))())((((((((())(())()()(((()))()))))()))(())))()))()((((())()())()))()()(()))()()))()()))((()()()())))()))())((()())()()()(()(()()()(((())()( )(((((())))()(()))()((((((()))))())()()())))))()((()(())))(()()(((())()))))())()(())))())))()())(((((()))(()(()))(())())(((())()()))((()(())()((((()()))))()((())))()(()()))((())(()))()()))()()) )())())()(()((())))()()(((())(()(())(())((())()))((())(())((((()))(())(())((((())))((()(()((())())()))(((((()(()))(()))()))(()((()(())()(((())())())()(()()())))((((()(((())(((()(()(())(()(())()(()()) )())())()()()(()))))())(()())(((())((())()()()()(((()()))())())((((()((((()((())((()()))(()))(()()())(((((()(())())((()()))()()()))())))))()))(()())( )()()()(())()()()))))()))((((()(((((()(((()(())))(())()(()())()()))((()((()())(()()((())(((((()(()(())))())(())((()(((((((()(())(((()())))(()))())(())()(()) ((())()(((()))()))(()()))()(())(((()()()(((()() ()))(())())((()))((()((((((()((())((((())))(()((()(()()(()((())))())())(()()())))(((((()(()((()()()))( (()(()(()(()()()(((()()))(((()()()(())()())()())))(()())( ))((((()())((())()()())()))()(()()(((())()((())())))()()())))())(((())))))(())(())(((()((())(())))(()())(()(()((())()(())(((()()()(((()((()((())((((((()()))()())())))(()(()()))))((()))((()( (()()(((()())()()(((((()()(((()()(( ())()())()()())(( ()()) )((()))()(()))))(()((((()))(())())())())()((()()(()(()(())(())))()(()()()()()()(()(((()(()(()())())())((()())())()()((()()()))())((())(()()((((()(()(((()(())((()())))(()))()()(())(()(((()))) (())))))()())()(()))))()))()))))(())())()))()))(()(())()))()()(((()()()((()))(()((()()()()() )(( (())((((()(())()()()()(())(()()((()()))())()(((()(()(()))))()(()()) )((()))(()(()(()))())())))()()))()(((((()))(())))()()))(()()()(((())(()((()(()()(((((()((())((())(((())((()((((())) ))()))(())))(((((()))())()()))))()(()((())(()(())))))((()(()()(((()(()((()() ())(((())()())()())))()()))(()((((()(()()()))()((())((()))))))()(((()(((())(((()()(())(())))))( ))))(()()))))((())(()))))(((()()(()())((()((()()())(()(())(((())))((((((())()(()))(()()))))()()(((()(((()(())()())))(()(())(()))((())()()())(())(((()()))(()((())()()) ()()()())((())))(()(()((()((()((()))(()(((((((( )))))))(()())())()(())(((()()((()(()(()))))()))))(()))(()(()(()((()(())))()(())()()(((()))(((()))()()())(()(()()()()(())()()(( ))())()((())()())(())((()(()(()))((())))((())())())))())(())()(((((())))(())())))))())()((()()))(((((()))(()((())(()((())((()(()())()()))((())((()())((((())(())))()()(((()))()))((((() (())))(())))))(()()))(())(()((()(())(())()())))()()(((()())(()()(()(()(())(()))()()))()((()(())(()))()(()))))())))()()))()()()))()()()( ))))()(())))()())))())(()))())))())()((()))()(()(((((()()(()())(()))())()(((((())))((((((())))(()(()(()()()(())((())(())))())))(((()())))))()))))(()(((((()()())(())())()(()()()()()())((()))))) )())()())()))))))())))(()))(())(())()((()())(((((((())((()((())((())()))((()))))()())()))))()))))(((((())(()()((()())(((()))))(((((())((()(()(())())))( )())(()((((((((()(())))()))))(()()()))())(()))(((()()()))()(())))()(()()((())()))) ()))))()))(()())(())))(()()(()))(()()))(((()(((()))((()(()(()((((((()))()())))())())))()(()())()()))())())(((()(())))() ()()))()))(()))))))))()(((()(((((()()(()(())(()(((((())))))(()))))(((((((())(((()((())(()(()(()(((()((((()())(()(()(()(((()()()())(()))(()((())()()((()))))()))(()))())) )))()()))))(((()(()))))(()())(())())()))()))())))()(())((((())(((()( )()))))(()))))(()))))()))())))()()((())()()(( ((()()(())())( ()(())))()())(((()))()())))()))((()((((()((())())))(((())))())))))(()())))(())()(())(()))()(((()()))(((()(()())()))))(())))()))(()()((())())())))))((())(()()((()))()))(()))())(())(())))(()) ())(()()))(()((())(((()())()((())()()(()()((()()))((( (()((()))))))(()((()()(()())))()())))()()(((()())()()( )(()))(()()((()()(()((()((()(((()))()(()(())))()))((( ))()()())(((((())))((())())))(()((()))()()(((((((((()(())())))(()((((((((((()()((()(()(()))()())()) ))))))((())())))))())()))))))))()()()())()))(()))(()()))(((())()))(())))((((())))(())((()(()))))))((((((()(())))()))))))((((((((()())))((()()()))()((((()(()((())))()( ()()()))(()))(()())(((()((())()((()))((()))))()))()()(()(((()())))((()()()))))(()((()())())(((()))))())()))(()((()()(()))()(()()))()((())))()))()()(()))(( )()))())))()((()((()((()()))(()(()))))((((()()))(((()))()(((((()((((())()))(()((()(()()()()())))((((()()))))())))))((((()())())))))()((((())(()()))()((( )()))))()(((())()()((((((()()())))()())())()(())(((((())()))()((())()()))(()((((((()())()()))((()()())))()((()((()(()(()())((((((((() ))))(()(()()())))))(((()(((()((()))(((()())((())(()((( ))(((()((()))(()))())((()()()((((())())(((())((()))))())()(((()()))(((()))( )))(())))())(()(())())())))(()(())()()(()()())))))())()))((()( ))((())()(()))(()(()))()()()((((()((()))))((((()(((()))()()))())()))(()))()()((()))()(((()(((())())()(())()))(()(())()))(((((((())((((((()(())))(( )()))())() )))))(())()(())()(()))(())(()(((((()(()(()) )( )(()(())()())))((())()(())(())(()()(()))))()(()()()()(((())(((((()())((())))((())))()))(()())))())()))))()))(()()()(((( ()())((()()()()(())()(((())(( )()())))(((())()(())())()))))((((((()))(())))()((()(()(()(())))))()()(())((()((()))()))()(())))))((((()(()())()))(())))()((()))(()()()())(((()(()()))()())(()(()()(()(((((()(()()((()(( )(())(() ((()((()))())(()))()(())()())())))())())(((()))))))(())((()())()))()))()()(()()()))()(())())()((()))))((()()())(())((((())(())())()()))))())))())()))))))))))((((()((())())())(()))((())((()(())(()()()) )(()((()())(((()()()))())(())(()(((((()(()()))())(((()((() )(()()))))()(())()(()))))(()()()()((()))((()(()(()(((()(((()((())(()(((((())()()(()((()(()(()())()())()((())(((())()(())))(()(()()((()(()())))((())())()(()()())()((()()(()(()(((())(((()))))))())(( (()((())()(((((())))))()()(()(((()(()((())((())(()))(()()()()))))(()())()))))(()(((())()))((())())()((()())()(((()()))())()(()((()()(((()((())(()())(()))(())()(()()()( (()(()())(()))))()()(((())))(()(((()(((((())()))(())())(((((()()(()((()((((((()(()())( )(())(((((()))()()(((()(()))()())()(())(()(()))())())(((())()))()()(((()((()))))((((()))) )(()())(())))(()(((()(((()(()())()()))))))((()))())())))(())()(((())()(((()))())))))))(()()())))()(()())())))(())()())(())))((()(())()()())(()))(((())(((()((((()()()())(()()))((()()))(()())(( ()))))))(((())())(((()(()()()(()())(((((()()())))(()()())())((()() ()())((()((()()((((((())(()((()())()())()(())(()))))())()()()))()())()()())))()())())())((()))(()(((()((()(((((((()))((()))))())()()()(()))()(((())((()())()))((()()((((()()(()(()()((()))())))() )()(()()(((())((())())()))()((((()(()(()))((()()()))()())()()))())(())))))(()((((((()()()))()(((()))())))())))))((())((()(())))(((()()(())))))(()(()()(())) )))())()(()(()))((()())((( (())))((()))))))(()())()()((())())((((()))(()()())((()())(())()()))))(())))))()))(((()()()(())))())(())))(())())()()(()((()((((((()))()))()())((()()(((() (((()())()((((())))(())()())(( (())())())((())(())(())(()()(()(())(()(())()(()))((()(()()())))((())()())())(())())))(((((()(()))((()()())(((()((())))((()()()())(()))))))((( ))())(()))))))))()())(())(()()(()()()())()((()((())(()))())(()(((((())()((())()()(((((( )(()(((())((())())))()(()()))()))()))((()(()))(()())((()(()())))()()(())())(()))))(((()))()(()()(((()((( )()((((()()))(()))(()()(()()((((()(())((())()))))))()(()))()()())((((()(()))((()))()))))))))(()(())))))))(((((()))()))))((((()() )(()))))((())))(((((()(((()(()())()))))))((()))())(((((())()())((())(((())))(())()((()()))())((()))(()(((()))())))((((()())()))()()())(()(())()()(()(())()((((())( )())()(()()))())()(())(()))))()())))(()))()))()())))))))))(())()(((((())))))(())()())()((((()(()((()(()()()))(((((())())(()())()((()(()((() (((())()()()))))))))(((((())()()))()(())()()(()))(())))))((()))( ()))(()()(()))() ((((())))((((())(()()()(((((())()) (()(((())((((()(()()))))()))(((()()())((( (()()(())(())((())))()(())()()))))()())((())()())()((()))))()))))((((()))))(((())((((((() ))(()()((())())((((()()))(()(()))((( )()()())))((())))))())()(()())())()(())))))((()())()()))))()()()(())(()(( (())(())())())())))(()()()(()()))))(((()))((()((())(()()(()())))())())))(()(()(()())()()()(()))()( ()))()))(((((()(())))((()()((()))(())()()(())((((()((())))()()())(())))(()((())(())()()()((())((((((((()(((()())()(((()((()( ())((((())())(((((() )((()(())))()(((()((()))))))(()(())())())(()))(())))))())(((()))))(()()(())()) (((()(((()()(((()))())()())(())(()))(()))))((()((()()(()))))()))(()()()(()())))()(((())(())))()))()))))((()()((((()((()()(()))(()))((((()(())) )(((()))())(()()(()()(()())(()()((((())(())(())(((()((())((()))()())((( ))((())()))))))()()()))))()())()()()()(())))()()))()))(()())((())((())())(()()))()()))(()())(((())((()((((((()()(())))()()))))(((((())()())())((((( ))(())(((()()()()((((((())))(()((()(((()))()))))(()(()((())))(()(()()()(())(())))(())(())))((((()(()))(()((()())))((())()))))() ())()) ))))()())()(()((()((()())()((((((((()))(()()())(()((()))()(())())(((())()))())((()()))(()())(()()()(()))(()(()())))()()())))()(()) ()()(()((()))))))(())))()())(()((()())))()()(()(()(()()))))))))()(()(((((((())))(()(())()()))((()(((()()(()(()))()))))()((()((( ()()()(()()))))()()))))(()))(()))(((()))())))(())(((())))(((()()(())(((()()((()(()((((((((())())))()()))((((()))())(()(((((()(())()((()))()(()(()()(()())((((()))((((()()))())()()((( )()(()())))(()()))()(())( )((()()((()))(()))()))()()((())((()())))((((())()()(()((((((() ))) (((()))((())()((((((()))))()()((()((())())))((()))))( )((((((((()))((()(()())))()()))()))(())(()()))(((()))))()())(()(()))(()))))())()))))))())()(()))()()))()()))(((()())))))(()(()))()()()()((( ()(()))()))())))())())))()( ))()))()()))(((()()))()((())(())(()(()()()(()))()))((())()(()()(())()(()())())((()))()))()(((())())))(()()(()()(()()(()))((( )))))))()())(()((()()(((((()((()))(()()((())()))()(()(()((()))()()((()((()(()))))()((())(()))()())())(())))()())()()))((()((())))(((()))(((()())(()()(()()) ((()(())(()((()(()(()(()))))(((()()))())()))))((()()))(())))((())((())((())((((()())))(()((())))(( ))))))()((())))))((()(((((())())()(()(((()))()()((((()(()()))))(()()()())(((()(()())((()))()((()(()))(((())(()((()))((())()((((())()( ))))((((()())()((())((()))())(((()))))(((()())((())))))()))()()))(()(()())))((())())(((((())()())()()))))())())())))))()))(())()()(()()))(()()()))((())((()((()()(((((()))((())()(((((()()(())(((( ))))(())())((()(()())()(()()()))())))()()))(((()))(( ((()())(()()()(()))())()))))((()(()))(())()(())))))())(())()(((()(())())()))))())())((())((()())(()(())))()()(()))((())()()())(()()()))())()) )((()()()((((()())))(()(((())))((() )))))()())))()()())()(()))()()())(()(((()))())()()(()))))((())(()()())))(()()())))()(())(((()(((())()(((()))()))(((())()))())())(((())))()))((((((())(()(())))(((()(())())))))(()((()())( ))()))()((())()())))(()(((((()(()))()(()))()))(())))((()())()))()( )()()((((()))(()))()(()))))(((())(()())((((((()((()()())())((()())())(()())(())))))))()))))(()()))()(()())(())()(((((((()))(())))()(()())())((()(()())(() ()(()((()((((()()((()(((()))))))))((()))()(((()()())))(()((((((())()()(())))()(()()( ))))))()()(())(()()(())(()))()))(()))))()()((()((())))))(((())()))())()(())()(( ))))))()(()())))((() )(())()()))))(()((()(()()(()())))))))((((()(())))()((())() )()))(()(()))))())((((((()())((())())))())(()(()()())(())((((()))))))((()())))))))())(()())(()(()(((( ))())()))())(())()))))((((((())(((())))((()()())()((()()))()() ())())()()))()(((()()())(()()(())((())((()))(()()()())(()())(((())))()(())(()()))))(()(((()(()())))())(()((()(((()(()()())(()())(((((((()((()((()())(() ())())()(((()())) )()))()(()(()())))()))())))()(()((((()()))(())()()(((()))((((()))()) ))))((())((()(()))))(())(())((()()(())((((()())())(()))()()()()))()()(((()())))()(()((()(()(((((()(())((())())(()( (())))))()())()((()(()()()(()()()()(())(())()(()(())()))(((((((()))())((((((()(()()))())))(()((((((((()((())((()(((())(())()(((((((()))()(())))))()()()((()()))((())))()()((()((()())()())())()((()(())) )(()()))()))(()())()(()))(()))(()))()((())(())))))()())))((((()))()(()((()((()()()()())(((()()))))()(()(()))(()(()(()(()))))))(((()(())()(((( ((())())(()()((()(((((((((())(()(((())()))()(((((()()())()())()()())())(()))(()()))((()(()(())((()))()))( (()())())))()))()((((()))))(())(())()()()((()())(()(()((())((((())())(()())(())(()(()(()))()(())((()())(())()))))(()(()()())((()()))()()(((())))()))()((()())))(((()))))))))))))))((())))(()) ())())(()(() ((())())(()))((()(()()(((((((((()()))())()(()(((()))))()()((()))(((()()((((())(()))((()(()))(()((((()(()((()))))(())()((()))()())()((()()( ))((()(())))(()))))))))())))(()))())))((()))()((((()()(()()())()))())((((((()))(())())()())((())(())(()))()))()((())()(())())()(()))()())())(()(())()((() ))()))((())( )))((( ))()(((())(()())(((()()((((())))(((((()((()()(())((())())(()))))()((((((()((()())()())()()(()(((()(()()(())(()())()((((()((((())(()(()))))()()(((()(((())(()))(())))()()())((()()())()())(()))))())) (((((()())(((()))()()())(()()(()())(()()((((((((((())))(()(()()(())((()()(((()))(())()(()((())(((()))(()))))())()())))(())()))())()(()(()()((( ))()()())())()()((()()(((()()()(()(((((((())()))((()(( ()())(()((()(()))())(((()()))))((()) (((())))())()((())()))(((())())))))(((()((((((()()))(()())))(())(((()(())))))()(((((((())))()()((())())(()())( ((()())))))()()))()((())()(() ())(())()()((((()))))))(()))()())))))(()(((((())())())(()))(((()((((()((()))(()()())(()((()))))))()()()((())(()))())()))))(((((()()((()()))()))()))(()())((((()()(()))((()()())())())( ))))())(()(((()(()()()))()()((((()()))())(()))())())()))((()())()()( )()()(()(())(((((((())((()))))))()()())())))((())()))()(()()())) (((()( ()()))(())()()()(((())()((()((((())))(((()))())))()()((()()(()((()((()(()()())))) )()((()))((((())()(( ())()))())(()()()))()))(()))())))()()() () (())()())((()))))))())((()(()))()((()(()()(()))))))()(()(())())()()))))))())(()))((())(((()(()())))((((())()())))))(()())()())()(()()(()((()(((())()((((((())())(()()) )(())))((()()(()))())(((())((()))((())()))((((()(()(()(((( )(()))()))((()(((((()()()()()))((()(()))))()(()(()))()()))))()(((((()())()(()((()))()((())((((()())))((())()()()()(((((((()))))(((((())))(())())))(())()()))())())()))()(()))()))(()()(()()((())() ))()())(()))()))()))())())))()(()(()))))))((()()((()((((()((((()())(()(()()((()()((()())())((()()(((()(())()()((((()()((((())()()()())))))) )()())((())))))(())))(()(())(( ))())()())()(((()())()())())( ((()(())(()()(())(()(()()(((()))())((((()()))())()((()()()))(()))))))((()()())((((( )(())(()())()()))(())()()))()(()))))) ) ((()))))((()(()((((())(((()()((()))(())(((((())(( ()))()())))(()()((())(()))))(()))())())))(())())))((((()()())))))((()(())(()))))())())(())((())))))(()()()(()()(())((())(())))))))(()((((( (())()((()((()(())))())((((((() (()))(()((())()((()()()(())))())))(()())()))()())())))( ()())()))())((()())))()))()()())()((())())()(()(()))))))((())))(()(())())())(()(()(()()()(()(())())(()(()())((()()))))()()(())))))) ()(()))))((()(((())))(((((())()(()(()))((( ()())()(())))()())())(()()))))())))()))(((()()())())((((())(((()((()))))())(())()((()()(((((()(((())(((()(()))(())())((()( ((()))))()(())((())())()))))()())((((( ()(())))((((()(()))(()()((()((((())(()()())(()))))))(()))()()())()))))(((((((()())()(()(()))))(((()((((()))()(())))(()()((())())()))(()()()()()()()(()()))(()))())(()())())(((()(())(((())(( ))))())(()))()((((())))((())((((()(()(())()(())((()())))( (())())())(((((())((()((())()((()()()((())())(()))(())))(())()))())((((((()())(()))))())))(()()()(())(())()(()(()())(())()((((()()())))())()())())()((((()(()))( ((())()())()()(()(())(()))(()))))((())((((())))())()))())()))()()())))()())())((((()()))((()((((()(())()(()()())))))(()()()))(()(( ((()))(((()))())()))())))((()()()()))(()()((())))((((())()))()(()))))))())())()) ((((())((()()()(()(((()(()()()())))()))))(((())()(((())) (((())())(())()(()))())()))(((())()()()))(((()())()()()((())()(()(((((()(((()))(()))((()(()())(()))())))((((((())())(((((()(((()((()(()())())(())()((( ))()(())))()((((((())))())()(()((((()())())(())(()))(()(((()((((((((())())))()()())())((()((())()(())))( ))()(()()((()((()( )))(((()())) ((((((()()))))(()(())))))(())()))()(((()))))())()))(()(()())())()((((((()((())))(()))()()()(()))))(())())()()())()(()())) ((((()()(((()))(((())(((())(()(()()()))))())()(()() (((())()())(()))()(()) )))((()))(()(((()))()))()))(()())())())))))(()(()))()(()())((()()()()((()())))()((())))(()())((((()())))()()(()(((()(((()))()()()(())(())) (())()(())()() )((()(()()()))((())((()(()))())((()())))))))))))(()) )((()((((()))))())())(()()((())()(())(((())(()))()()()()()))((()))()(()(((()))))(()))())))((())())((())())()))))))))))))(())(((()(()()(()))())(((((()(()(()())()(())((())))(()()))()()(()(( )())))(())((())))))())(()(()()))))))())(((())()())))))() )(())()(()())))())())(())(())()()()))(())(()(()(()))))))))() (())(((()))(()()())()(((()())())(()((())))))(()()((()((())()(()(()(((()()(()()()(()()((()))) (((((()(()))()))())))))((()()(((()()(((((()()(()()))()((((()(()))(()))(((()((((()))()()()))(()(((((()()))()()))())()())))()() ()()))()())(((()(()))(()()()()()((()(())(((()((((()(())))()())))(()(())))())(((((((((()))((()((())((((((())(((((()((())(()()()())(((((()()((()()()))()(()))()(())(((())))(((())((((()()))())((( ()())(()()(())))(()((()(())(( ((()((()))(((())()()(()()((())(())()()))(())())(()()()((()())(())()()())()))() ((((())(()))((()((()((()))))())()))()))(())()((((())()())()(((((()))()())()(()()(())((((()())((()()()()))(())())(()(()()(())(()))()((())()()(()))(()())((()())((((())))()())()())(((()))())()( ())))()(((((())))(()((()))()((())(()))((())(((( (()((()())) )) )))()(((((())(((())()(())((()))()(((()))())()))()))()())))(()))()()))())()()))))()()(()(((())(())))(()(()))())))))()(( )))()((())((((((((())(()())())(((())))((((()))))(((())(()((())())))((((()((())())((())(((())))()()))(()))((()))))())))(())((((((()(()(()((())(((((())))()((((())(()))))))())) )()()((((())((((()()( Edited by author 04.02.2010 11:20 6 3 2 1 3 48 15 18 5 9 13 17 4 8 12 16 20 3 7 11 15 19 18272 184 120 152 106 196 193 184 175 28 182 181 159 189 132 68 140 20 77 9 96 194 60 18 116 135 70 64 142 62 172 57 55 46 139 48 134 104 98 7 192 111 149 89 176 78 19 49 154 138 15 167 190 191 195 199 75 126 92 170 155 25 177 129 73 82 1 100 130 143 31 53 21 72 6 171 4 59 52 54 17 67 95 29 80 110 32 63 30 112 35 102 41 79 168 156 113 83 97 38 50 101 131 153 71 76 186 10 88 34 42 16 173 124 125 163 13 26 109 117 145 169 128 119 65 61 183 5 2 81 123 157 56 43 47 37 90 107 136 114 121 122 3 40 8 11 51 91 146 137 144 198 23 36 108 12 165 118 74 84 179 127 103 158 161 14 166 151 39 147 185 160 187 188 45 58 133 85 174 99 115 24 197 94 105 180 | | Please write answer for test "2 1" | VasilySlesarev | 1359. Стройка | 4 фев 2010 00:47 | 4 | My program writes 0.8561 and gets WA I`ve found stupid mistake and got AC! Doski ne mogut bit raspologeni gorizontalno! Thanks, i had this mistake too :) It was WA #3 | | java.util.Scanner | Konstantin Yovkov | 1510. Порядок | 3 фев 2010 23:24 | 3 | I got AC with O(n) ! Several times I got TL, but when I stopped reading the input with java.util.Scanner and started using java.io.BufferedReader it worked. java.util.Scanner is too slow, don't use it ! class Scanner { StreamTokenizer in; Scanner(InputStream stream) { in = new StreamTokenizer(new BufferedReader(new InputStreamReader(stream))); } void asserT(boolean e) { if (!e) { throw new Error(); } } int nextInt() { try { in.nextToken(); asserT(in.ttype == in.TT_NUMBER); asserT((int) in.nval == in.nval); return (int) in.nval; } catch (IOException e) { throw new Error(e); } } } ".. and nothing else matters ..." (c)Metallica | | where is my mistake? | ooo | 1407. Раз-два, раз-два | 3 фев 2010 21:00 | 2 | #include <iostream.h> bool z(int); void main() {int n,i,q=1; cin>>n; for(i=1;i<=n;i++) q*=2; for(i=0;i<10000;i++) if((z(i)) && (i%q==0)) {cout<<i; break;} if(i==10000) cout<<"No solution";} bool z(int x) {int j=0; while(x!=0) {if((x%10!=1) && (x%10!=2)) j++; x=x/10;} if(j==0) return true; else return false;} Imagine that n is 100. q (2 ^ 100) will be overflowed. You must have 10000 digits but not number under 10000=) | | Please help me!I have MLE #8 | Tigran Hakobyan(1 course RAU) | 1423. Басня о строке | 3 фев 2010 14:12 | 1 | Here is mu code(C++): #include <iostream.h> void sdvig(char a[],int n) { char *y; y=new char [n]; int i,j,total=0; for(i=0,j=1;i<n,j<=n;i++,j++) { if(j==n) { y[0]=a[n-1]; } else { y[j]=a[i]; } } for(i=0;i<n;i++) { a[i]=y[i]; } } bool proverka(char x[],char y[],int n) { int total=0,i; for(i=0;i<n;i++) { if(x[i]==y[i]) { total++; } } if(total==n) return true; return false; } const int N=250000; int main() { char x[N],y[N]; int n,i,total=0; cin>>n; for(i=0;i<n;i++) { cin>>x[i]; } for(i=0;i<n;i++) { cin>>y[i]; } if(proverka(x,y,n)==true) { cout<<"0"<<endl; } else { while(true) { total++; sdvig(x,n); if(proverka(x,y,n)==true) { cout<<total; break; } else { if(total==n) { cout<<"-1"<<endl; break; } } } } return 0; } | | WA4,here is the test.. | mariam kupatadze | 1576. Телефонные тарифы | 3 фев 2010 12:08 | 2 | When sum<=T (which means that the limit is not exceeded ) you should write just a monthly fee N2. In C++ : if (sum<=T) cout<<"Combined: "<<N2<<endl; Good Luck Friends!!! | | What is with the damn 10 test? | Gheorghe Stefan | 1154. Сражение магов | 3 фев 2010 01:26 | 5 | I got WA at test 10... I compared my source with an AC one and got same results on many tests... oh God I've wrote if (H == 13) H = M = S = 0 and got AC ! In test 10 you may have a precision problem. When comparing double values use some epsilon like 1e-9. It worked for me at least... I rewrote everything to long arithmetics and fair fractions, still WA10. The problem is that the answer is 00:00:00. I checked only control points (moments of power and weakness for all 4 forces), but if resulting function is minimal and constant on range [x2;24*60*60) U [0;x1), then the answer should be 0. Simply adding 0 to list of points to check gave me AC. I believe solution with 'double' type would also do it :) Edited by author 11.08.2008 08:58 Oh, thank you very much! I added zero to my check list and at last i have AC now too :) (I had WA #10 before it) | | How to get AC | OleGG | 1059. Выражение | 2 фев 2010 20:28 | 2 | Well, everybody here knows, that best scheme is 0(X*i+) . But lot of us get WA1. I've found why we fail like this. The last line of output shouldn't contain line break, so I've changed string "X\n*\ni\n+\n" to "\nX\n*\ni\n+" and got AC. OMG. It is very strange :) for (int i = 1; i <=n; i++ ){ out.printf("X%n*%n%d%n+%n",i); } (Java) | | wa5 with O(N) | wRabbits_AlMag(VNTU) | 1130. Никифор на прогулке | 2 фев 2010 15:01 | 1 | any hint? while i have more than two vectors, i find two of them with |sum|<=L. in the end i have two of them and try to sum in different ways, but wa5 | | Why WA on 4 test? SPS | Дмитрий | 1020. Ниточка | 2 фев 2010 01:00 | 9 | This code dont worked! Why? I dont know what i should to change. type TPoint = record X, Y: Extended; end; var N, R: integer; Points: array of TPoint; Sum: Extended; function GetR(Index: integer): Extended; begin Result := sqrt( sqr(Points[Index].X - Points[Index + 1].X) + sqr(Points[Index].Y - Points[Index + 1].Y)); end; var i: integer; begin Readln(N, R); SetLength(Points, N + 1); for i := 0 to N - 1 do with Points[i] do Readln(X, Y); Points[N] := Points[0]; // зацикл Sum := 2*pi*R; for i := 0 to N - 1 do Sum := Sum + GetR(i); Writeln(Sum:0:2); end. Thanks; I think that following formula correct: Sum := 2*pi*R + R(1, 2) + R(2, 3) + ... + R(N - 1, N) + R(N, 0) ; Where R(i, j) - is function which returns distance between i and j nail's. Where i'm wrong? Edited by author 21.08.2008 13:57 Edited by author 21.08.2008 13:57 Anybody, give me please same test's OOOOOOoo :). My solution is correct. :0 My bug was here .... R: integer; .... but should be float type. unattentive thanks, my error was the same :) //81674XO #include <iostream> #include <cmath> using namespace std; int main(){ double PI=acos(-1.0); int N; double r, perimeter; cin>>N>>r; double *pointx, *pointy; pointx = new double[N+1]; pointy = new double[N+1]; for(int a=0; a<N; a++){ cin>>pointx[a]>>pointy[a]; } pointy[N]= pointx[0]; pointx[N] = pointy[0]; cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2); if(N==1){ perimeter=2*PI*r; cout<<perimeter;
} else{ if(N==2){ perimeter=2*(pow((pow((pointx[0]-pointx[1]),2)+pow((pointy[0]-pointy[1]),2)),0.5)) + 2*PI*r; cout<<perimeter;
} else{ double angle; for(int a=0; a<N; a++){ perimeter += pow((pow((pointx[a]-pointx[a+1]),2)+pow((pointy[a]-pointy[a+1]),2)),0.5); }
double p1x, p2x, p3x, p1y, p2y, p3y, m1, m2;
p1x=pointx[N-1]; p2x=pointx[0]; p3x=pointx[1]; p1y=pointy[N-1]; p2y=pointy[0]; p3y=pointy[1]; if(p3x==p2x) m1=tan(PI/2.0); if(p2x==p1x) m2=tan(PI/2.0); if(p2x!=p3x) m1=(p3y-p2y)/(p3x-p2x); if(p2x!=p1x) m2=(p1y-p2y)/(p1x-p2x); angle = 2*PI - (PI + fabs(atan(m1)-atan(m2))); for(int a=1; a<N; a++){ p1x=pointx[a-1]; p2x=pointx[a]; p3x=pointx[a+1]; p1y=pointy[a-1]; p2y=pointy[a]; p3y=pointy[a+1]; if(p3x==p2x) m1=tan(PI/2.0); if(p2x==p1x) m2=tan(PI/2.0); if(p2x!=p3x) m1=(p3y-p2y)/(p3x-p2x); if(p2x!=p1x) m2=(p1y-p2y)/(p1x-p2x);
angle += 2*PI - (PI + fabs(atan(m1)-atan(m2))); }
perimeter += r*angle; cout<<perimeter; }} return 0;}
// please run my program and also, for some test cases and check for difference in answers !! pizdos u teb9 proga)) 9 dumau 4to delo nemnogo v kode) program project1; var n, i : shortint; r, res, x, y, x1, y1, x0, y0 : extended; begin readln(n, r); readln(x, y); x0:=x; y0:=y; res:=2*pi*r; for i:=1 to n-1 do begin readln(x1, y1); res:=res+sqrt(sqr(x1-x)+sqr(y1-y)); y:=y1; x:=x1; end; write((res+sqrt(sqr(x1-x0)+sqr(y1-y0))):1:2); end. | | WA 8:((( | THE_SCORPION | 1452. Pascal против C++ | 2 фев 2010 00:09 | 2 | Why WA 8? Please help me ! I tested my programm many times, but did'not find a mistake. Maybe someone tell me where is wrong or give me same test. Sorry for my bad english. Here is my code: program Project2; {$APPTYPE CONSOLE} uses windows; type din=array of longint; type IntMas=array[1..2000] of longint; var mas,mas2:din; pre,rez:intMas; n,i,dlin,dlin2,kol,u,y,save,KOLM,a,b,sr,MAX,num,del,l,r:longint; f:text; // lMas:array[1..2000,1..2000] of longint; DELTA:array[0..1000000000] of boolean; T:BOOLEAN; t1,t2,t3,t4:_SYSTEMTIME; procedure sort(var d,d2:din;var l:longint); var dlin,dlin2:longint; mas2,mas3,Dmas2,Dmas3:din; begin t:=false; dlin:=l div 2; dlin2:=l-dlin; setlength(mas2,dlin+1); setlength(Dmas2,dlin+1); for i:=1 to dlin do mas2[i]:=d[i]; for i:=1 to dlin do Dmas2[i]:=d2[i]; setlength(mas3,dlin2+1); setlength(Dmas3,dlin2+1); for i:=1 to dlin2 do mas3[i]:=d[i+dlin]; for i:=1 to dlin2 do Dmas3[i]:=d2[i+dlin]; if dlin>1 then begin sort(mas2,Dmas2,dlin); end; if dlin2>1 then begin sort(mas3,Dmas3,dlin2); end; kol:=0; i:=1; u:=1; L:=dlin+dlin2; while kol<l do begin if mas2[i]<mas3[u] then begin inc(kol); d[kol]:=mas2[i]; d2[kol]:=Dmas2[i]; if i+1<=dlin then inc(i) else begin for y:=u to dlin2 do begin d[kol+y-u+1]:=mas3[y]; d2[kol+y-u+1]:=Dmas3[y]; end; break; end; end else begin inc(kol); d[kol]:=mas3[u]; d2[kol]:=Dmas3[u]; if u+1<=dlin2 then inc(u) else begin for y:=i to dlin do begin d[kol+y-i+1]:=mas2[y]; d2[kol+y-i+1]:=Dmas2[y]; end; break; end; end end; //sort() end; begin {assign(f,'input.txt'); reset(f);} readln({f,}n); setlength(mas,n+1); setlength(mas2,n+1); for i:=1 to n do begin read({f,}mas[i]); mas2[i]:=i; end; t:=false; if n>1 then sort(mas,mas2,n); rez[1]:=1; kolM:=1; DELTA[0]:=true; for i:=1 to n do for u:=i+1 to n do if not DELTA[mas[u]-mas[i]] then begin del:=mas[u]-mas[i]; DELTA[del]:=true; num:=mas[u]; num:=num+del; kol:=2; pre[1]:=mas2[u]; pre[2]:=mas2[i]; l:=u; r:=n; while true do begin if mas[l]=num then begin inc(kol); pre[kol]:=mas2[l]; num:=num+del; l:=l; r:=n; // break; end; if mas[r]=num then begin inc(kol); pre[kol]:=mas2[r]; num:=num+del; l:=r; r:=n; // break; end; if (mas[r]<>num) and(mas[l]<>num) then begin if ((abs(r-l)=1) or (abs(r-l)=0)) then begin if kol>kolM then begin for l:=1 to kol do rez[l]:=pre[l]; kolm:=kol; end; break; end; if mas[(l+r)div 2]<num then l:=(l+r)div 2 else r:=(l+r)div 2; end; end; end; writeln(kolM); for i:=1 to kolM do begin write(rez[i]); write(' '); end; //readln;
end. 9 1 3 5 11 2 3 4 7 9 answer: 6 1 2 3 8 9 4 | | hint about WA#11 | melkiy | 1688. Team.GOV! | 1 фев 2010 15:04 | 2 | People, __int64 not needed! I quickened my program from 0.31 to 0.15 when returned __int64 to int (if that was not a fluctuation). Listen here. During one meal Ivan can save about 2*10^6/3 ~ 666667 rub. This is maximum increment of saved money. So at maximum the saved sum will be 2*10^9 + 666667, which is much less than 2^31-1. My trouble (and most likely yours too) was connected with that i checked if saved sum is strictly greater than n fogetting of the fractional part. This is the case when ( integer part of saved money == n) BUT ( integer part == n AND fractional part > 0) | | if u have wa35, wa82 | wRabbits_AlMag(VNTU) | 1093. Дартс | 1 фев 2010 12:24 | 1 | 1) i had wa35 with eps = 1e-15 2) i had wa82 with eps = 1e-11 3) ac with simple eps = 1e-9 | | Why WA#1? | Artem Khizha | 1106. Две команды | 31 янв 2010 19:20 | 1 | I've already solved this problem in Pascal, but now I'm trying to get through with my C++ code. I see no difference to my accepted solution and interested, what the point. Can someone help me to understand? Compiled with Gnu C++ compiler. #include <cstdio> #include <vector> #define ___MAXN 1000 typedef unsigned int uint; std::vector< std::vector<int> > G(0); int col[___MAXN] = {0}; void dfs(uint u, uint c) { col[u] = c; for (uint v=0; v<G[u].size(); v++) if (!col[G[u][v]]) dfs(G[u][v], 3-col[u]); } void colorize() { for (uint u=0; u<G.size(); u++) if (!col[u]) dfs(u, 1); } int main() { uint n; scanf("%u", &n); G.resize(n);
for (uint i=0; i<n; i++) { static uint x; scanf("%u", &x); do { G[i].push_back(x-1); scanf("%u", &x); } while (x); } colorize(); n = 0; for (uint i=0; i<G.size(); i++) switch (col[i]) { case 0: printf("0\n"); return 0; case 1: n++; break; } printf("%u\n", n); char c = 0; for (uint i=0; i<G.size(); i++) if (col[i]==1) { printf("%c%u", c, i+1); c = ' '; } } | | To ADMINS!!! Test #10 check it please! | Sasha Bar [TNU] | 1111. Квадраты | 31 янв 2010 02:42 | 4 | Is test 10 correct? A couple old AC solutions now have WA 10, and my new solution too. Edited by author 29.04.2009 21:16 Test 10 is correct, but because of server error all AC solutions since April,14,2009 have received verdict WA#10. Now this error is fixed and all these submits are rejudged. I had Crash on test #10. In this test, point P coincides with some vertex of some square. (i had division by zero it this test) | | how an i concrete this prog, here is code. | Bobur | 1075. Нитка в пространстве | 30 янв 2010 23:22 | 4 | program Project1075_chala; {$APPTYPE CONSOLE} uses SysUtils, math; const EPS = 0.0000001; var xa, xb, xc, ya, yb, yc, za, zb, zc, r : integer; AB, BC, AC, cos_gamma, cos_gamma1, yoy, vatar, d, h : real; begin read(xa, ya, za); read(xb, yb, zb); read(xc, yc, zc); read(r); AB := sqrt(sqr(xb-xa)+sqr(yb-ya)+sqr(zb-za)); AC := sqrt(sqr(xc-xa)+sqr(yc-ya)+sqr(zc-za)); BC := sqrt(sqr(xb-xc)+sqr(yb-yc)+sqr(zb-zc)); if AB + BC <= AC+EPS then d := AB-2*r+PI*r else if (AC+EPS >= BC + AB) or (BC+EPS >= AC + AB) then d := AB else begin cos_gamma := (AC*AC+BC*BC-AB*AB)/(2*AC*BC); h := AC*BC*sqrt(1 - sqr(cos_gamma))/AB; if h+EPS >= r then d := AB else begin vatar := 2 * sqrt(sqr(r)-sqr(h)); cos_gamma1 := (2*sqr(r)-sqr(vatar))/(2*r*r); yoy := arccos(cos_gamma1) * r; d := AB - vatar + yoy; end; end; writeLn(d:0:2); end. thanks const EPS = 0.000001; var xa, xb, xc, ya, yb, yc, za, zb, zc, r : integer; c, a, b, yoy, vatar, d, h : real; begin read(xa, ya, za); read(xb, yb, zb); read(xc, yc, zc); read(r); c := sqr(xa-xb)+sqr(ya-yb)+sqr(za-zb); //AB^2 d := sqrt(c); b := sqr(xa-xc)+sqr(ya-yb)+sqr(za-zc); //AC^2 a := sqr(xb-xc)+sqr(yb-yc)+sqr(zb-zc); //BC^2 h := (4*a*b-sqr(a+b-c))/(4*c); if sqrt(h) < r then if sqrt(b-h)+sqrt(a-h)-EPS<=d then begin vatar := 2*sqrt(sqr(r)-h); yoy := r*arccos((2*h-sqr(r))/(r*r)); d := d - vatar + yoy; end; writeLn(d:0:2); end. Solution is wrong, because you must search for kasatelnye(russian word) | | WA 41 | Orfest (Novosibirsk SU) | 1724. Тайна происхождения человека | 30 янв 2010 13:51 | 3 | WA 41 Orfest (Novosibirsk SU) 20 окт 2009 13:57 Cannot beat test 41. Please share any ideas, tricky tests. Me too. I would really appreciate some help. This test failed me when I got wa 41: Input: TAaGgTtCcAaGgt 3 1 14 2 3 2 13 Output: 111 Now I have accepted | | Why for n=4 answer is 30? | bsu.mmf.team | 1747. Осмотр владений | 30 янв 2010 02:03 | 3 | In my opinion, for n=4 the correct answer is 20 if I understood the condition of the problem correctly, i.e for n=3 there are exists 2 ways: 123231 and 132321. Please, explain me my mistake if I'm wrong. 12324341 12342341 12342431 12343241 12343421 12423431 12432341 12432431 12434231 12434321 13234241 13242341 13242431 13243241 13243421 13423241 13423421 13424231 13424321 13432421 14232341 14232431 14234231 14234321 14243231 14323241 14323421 14324231 14324321 14342321 Oh! Now I understood my mistake. Thank you! |
|
|