You are not logged in. Please login at www.codechef.com to post your questions!

×

cf 447 div2 Ralph And His Magic Field

i have understood the formula for it but i am unable to understand that when k=-1 and n and m have different parity the answer will be -1 but for k=1 answer will not be -1 why? problem

asked 20 Nov '17, 22:42

anno's gravatar image

4★anno
266211
accept rate: 12%

edited 20 Nov '17, 22:43


if we multiply all rows's product then they should be equal to multiplication of all element in the matrix same for columns. if n and m have different parity lets say n is even and m is odd then when we multiply all row's product we get even number because each row's product is equal to -1 but when we multiply all column's product then we get odd number but both should be equal to multiplication of all elements in the matrix that's why for k=-1 if n and m have different parity then solution does not exist....

link

answered 24 Nov '17, 00:56

shivam9654's gravatar image

2★shivam9654
1
accept rate: 0%

This comment shall answer your question.

link

answered 20 Nov '17, 23:04

rajashekar007's gravatar image

4★rajashekar007
313
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×890
×688
×2

question asked: 20 Nov '17, 22:42

question was seen: 513 times

last updated: 24 Nov '17, 00:56