摘要: Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries 阅读全文
posted @ 2017-04-20 18:20 walfy 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Judge Bahosain was bored at ACM AmrahCPC 2016 as the winner of the contest had the first rank from the second hour until the end of the contest. Bahos 阅读全文
posted @ 2017-04-19 22:41 walfy 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更 阅读全文
posted @ 2017-04-19 11:45 walfy 阅读(128) 评论(0) 推荐(0) 编辑
摘要: There are a group of students. Some of them may know each other, while others don't. For example, A and B know each other, B and C know each other. Bu 阅读全文
posted @ 2017-04-18 23:05 walfy 阅读(178) 评论(0) 推荐(0) 编辑
摘要: onsider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible 阅读全文
posted @ 2017-04-18 21:54 walfy 阅读(581) 评论(0) 推荐(0) 编辑
摘要: You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9) end poin 阅读全文
posted @ 2017-04-10 14:58 walfy 阅读(444) 评论(0) 推荐(0) 编辑
摘要: Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top s 阅读全文
posted @ 2017-04-09 21:29 walfy 阅读(272) 评论(0) 推荐(0) 编辑
摘要: We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no in 阅读全文
posted @ 2017-04-08 18:47 walfy 阅读(462) 评论(0) 推荐(0) 编辑
摘要: Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on i 阅读全文
posted @ 2017-04-08 16:46 walfy 阅读(412) 评论(0) 推荐(0) 编辑
摘要: Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put 阅读全文
posted @ 2017-04-08 13:53 walfy 阅读(457) 评论(0) 推荐(0) 编辑