Submission #3816358
Source Code Expand
#include<iostream> using namespace std; int main(){ int N; cin >> N; int t[110000], x[110000], y[110000]; t[0] = x[0] = y[0] = 0; for(int i = 0; i < N; i++){ cin >> t[i+1] >> x[i+1] >> y [i+i]; } bool can = true; for(int i = 0; i < N; i++){ int dist = abs(x[i]-x[i+1]) + abs(y[i]-y[i+1]); int dt = t[i+1] - t[i]; if(dt < dist) can = false; if(dist % 2 != dt % 2) can = false; } if(can) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | ABC086C - Traveling |
User | shimiyu_zuya |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 517 Byte |
Status | RE |
Exec Time | 146 ms |
Memory | 1152 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 | 1 ms | 256 KB |
0_001.txt | AC | 1 ms | 256 KB |
0_002.txt | AC | 1 ms | 256 KB |
1_003.txt | AC | 1 ms | 256 KB |
1_004.txt | RE | 146 ms | 1152 KB |
1_005.txt | RE | 145 ms | 1152 KB |
1_006.txt | RE | 138 ms | 1152 KB |
1_007.txt | WA | 12 ms | 512 KB |
1_008.txt | WA | 1 ms | 256 KB |
1_009.txt | AC | 16 ms | 640 KB |
1_010.txt | AC | 1 ms | 256 KB |
1_011.txt | AC | 11 ms | 512 KB |
1_012.txt | AC | 1 ms | 256 KB |