Submission #3224853
Source Code Expand
import java.util.*; public class Main { public static void main( String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int t = 0; int x = 0; int y = 0; boolean result = true; for (int i = 0; i < n; i++) { int t2 = sc.nextInt() - t; int x2 = Math.abs(x - sc.nextInt()); int y2 = Math.abs(y - sc.nextInt()); int diff = t2 - x2 - y2; if (diff < 0) { result = false; } if (diff % 2 != 0) { result = false; } } System.out.println(result ? "YES" : "NO"); } }
Submission Info
Submission Time | |
---|---|
Task | C - Traveling |
User | lilaxuma |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 559 Byte |
Status | WA |
Exec Time | 565 ms |
Memory | 86900 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 | WA | 92 ms | 18640 KB |
0_001.txt | WA | 92 ms | 20948 KB |
0_002.txt | WA | 91 ms | 20688 KB |
1_003.txt | WA | 91 ms | 19924 KB |
1_004.txt | WA | 565 ms | 85228 KB |
1_005.txt | WA | 563 ms | 86068 KB |
1_006.txt | WA | 543 ms | 86900 KB |
1_007.txt | WA | 303 ms | 41452 KB |
1_008.txt | WA | 124 ms | 19280 KB |
1_009.txt | WA | 353 ms | 40172 KB |
1_010.txt | WA | 124 ms | 21076 KB |
1_011.txt | WA | 284 ms | 39168 KB |
1_012.txt | WA | 111 ms | 19540 KB |