Submission #2544597
Source Code Expand
#include <iostream> #include <algorithm> #include <numeric> #include <string> #include <cstdlib> #define rep(i, n) for(long i=0; i<(long)(n); ++i) using namespace std; // Globals int n; const int N=10000; int ts[N], xs[N], ys[N]; void input() { cin >> n; rep(i, n) cin >> ts[i] >> xs[i] >> ys[i]; } void solve() { int now_x=0, now_y=0, now_t=0; rep (i, n) { int x=xs[i], y=ys[i], t=ts[i]; int dist = abs(now_x-x) + abs(now_y-y); int dur = t-now_t; bool ok = dist <= dur && dist%2 == dur%2; if (!ok) { cout << "No" << endl; return; } } cout << "Yes" << endl; } int main() { input(); solve(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Traveling |
User | cottoncotton |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 706 Byte |
Status | RE |
Exec Time | 105 ms |
Memory | 384 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 | WA | 9 ms | 384 KB |
1_005.txt | AC | 9 ms | 384 KB |
1_006.txt | WA | 8 ms | 384 KB |
1_007.txt | RE | 105 ms | 384 KB |
1_008.txt | AC | 1 ms | 256 KB |
1_009.txt | RE | 104 ms | 384 KB |
1_010.txt | AC | 1 ms | 256 KB |
1_011.txt | RE | 105 ms | 384 KB |
1_012.txt | AC | 1 ms | 256 KB |