This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| num_races = int(input()) | |
| race_info = [tuple(map(int, input().split())) for _ in range(num_races)] | |
| connections = [[] for _ in range(num_races)] | |
| for i in range(num_races): | |
| x1, y1, day1 = race_info[i] | |
| for j in range(num_races): | |
| x2, y2, day2 = race_info[j] | |
| if day2 > day1 and abs(x1 - x2) + abs(y1 - y2) <= (day2 - day1): | |
| connections[i].append(j) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #define SIZE 205 | |
| char grid[SIZE][SIZE]; | |
| int rows, cols; | |
| void fallDown() { | |
| for (int c = 0; c < cols; c++) { |