- 博客(3)
- 收藏
- 关注
原创 D - Restoring Three Numbers
Polycarp has guessed three positive integers a, b and c. He keeps these numbers in secret, but he writes down four numbers on a board in arbitrary order — their pairwise sums (three numbers) and sum of all three numbers (one number). So, there are four num
2020-11-20 23:56:03 121
原创 A - Gennady and a Card Game
Gennady owns a small hotel in the countryside where he lives a peaceful life. He loves to take long walks, watch sunsets and play cards with tourists staying in his hotel. His favorite game is called “Mau-Mau”. To play Mau-Mau, you need a pack of 52 cards.
2020-11-20 23:52:34 113
原创 H - 水陆距离
给定一个N x M的01矩阵,其中1表示陆地,0表示水域。对于每一个位置,求出它距离最近的水域的距离是多少。 矩阵中每个位置与它上下左右相邻的格子距离为1。 Input 第一行包含两个整数,N和M。 以下N行每行M个0或者1,代表地图。 数据保证至少有1块水域。 对于30%的数据,1 <= N, M <= 100 对于100%的数据,1 <= N, M <= 800 Output 输出N行,每行M个空格分隔的整数。每个整数表示该位置距离最近的水域的距离。 Sample Input 4
2020-11-09 18:42:57 285
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人