Submission #2544617
Source Code Expand
import sys N = int(input()) place_info_list = list() for _ in range(N): t, x, y = list(map(int, input().split())) place_info_list.append({ 't': t, 'x': x, 'y': y, }) place_info_list.sort(key=lambda place: place["t"]) current_place_info = { 't': 0, 'x': 0, 'y': 0, } for place_info in place_info_list: distance = abs(place_info['x'] - current_place_info['x']) +\ abs(place_info['y'] - current_place_info['y']) necessary_time = distance / 1.0 remained_time = place_info['t'] - current_place_info['t'] if remained_time < necessary_time: print("No") sys.exit() if (remained_time - necessary_time) % 2 == 1: print("No") sys.exit() current_place_info['t'] += place_info['t'] current_place_info['x'] = place_info['x'] current_place_info['y'] = place_info['y'] print("Yes")
Submission Info
Submission Time | |
---|---|
Task | C - Traveling |
User | shink0120 |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 947 Byte |
Status | WA |
Exec Time | 421 ms |
Memory | 40788 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 19 ms | 3188 KB |
0_001.txt | AC | 17 ms | 3064 KB |
0_002.txt | AC | 17 ms | 3064 KB |
1_003.txt | AC | 17 ms | 3064 KB |
1_004.txt | WA | 421 ms | 40788 KB |
1_005.txt | AC | 399 ms | 39092 KB |
1_006.txt | WA | 389 ms | 37604 KB |
1_007.txt | WA | 73 ms | 8252 KB |
1_008.txt | WA | 18 ms | 3064 KB |
1_009.txt | AC | 95 ms | 10276 KB |
1_010.txt | AC | 18 ms | 3064 KB |
1_011.txt | AC | 65 ms | 7480 KB |
1_012.txt | AC | 18 ms | 3064 KB |