Submission #3224860
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 | 300 |
Code Size | 559 Byte |
Status | AC |
Exec Time | 587 ms |
Memory | 86076 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 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 | 93 ms | 20564 KB |
0_001.txt | AC | 94 ms | 22608 KB |
0_002.txt | AC | 92 ms | 20948 KB |
1_003.txt | AC | 93 ms | 23636 KB |
1_004.txt | AC | 587 ms | 86076 KB |
1_005.txt | AC | 556 ms | 85732 KB |
1_006.txt | AC | 573 ms | 84048 KB |
1_007.txt | AC | 301 ms | 41504 KB |
1_008.txt | AC | 116 ms | 21972 KB |
1_009.txt | AC | 335 ms | 44964 KB |
1_010.txt | AC | 124 ms | 23508 KB |
1_011.txt | AC | 283 ms | 40900 KB |
1_012.txt | AC | 124 ms | 19280 KB |