We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- NP Complete
- Spies, Revised
- Discussions
Spies, Revised
Spies, Revised
Sort by
recency
|
99 Discussions
|
Please Login in order to post a comment
There might be an error in code control, the following output matrix seems true.
"3 1 4 2 5"
Works
How old is this?
In year 2000 as a recent Computer Grad, I resolved the Queens on chess board (from Java Deitel and Deitel): That is:
How many queens can we add into a chess board so that no queen captures the other?! Output is 8, where they are a chess knight distance from each other
I test median time for N from 10 to 100 and complexity is N^5. It means, that for N=999, for 4-cores processor it take 48 full days. (can be several shorter or longer). I don't public my code and algorithm due to not spoil game.
This code is working, but after submitting it fails.Please someone help me arr = [] n=int(input()) print(n) for i in range(n): arr.append(list(map(str, input().rstrip().split()))) for i in range(n): for j in range(n): if arr[i][j]=='S': print((j+1),end=' ')