Submission #2202535


Source Code Expand

Copy
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int t[N], x[N], y[N];
    rep(i, N) cin >> t[i] >> x[i] >> y[i];
    int t0 = 0, x0 = 0, y0 = 0;
    int t1, x1, y1;
    rep(i, N) {
        int t1 = t[i], x1 = x[i], y1 = y[i];
        int dt = t1 - t0;
        int dx = x1 - x0;
        int dy = y1 - y0;
        int d = abs(dx) + abs(dy);
        if (dt < d || dt % 2 != d % 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;


    return 0;
}

Submission Info

Submission Time
Task ABC086C - Traveling
User toame
Language C++14 (GCC 5.4.1)
Score 300
Code Size 876 Byte
Status
Exec Time 24 ms
Memory 1408 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_000.txt, 0_001.txt, 0_002.txt
All 300 / 300 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 1 ms 256 KB
0_001.txt 1 ms 256 KB
0_002.txt 1 ms 256 KB
1_003.txt 1 ms 256 KB
1_004.txt 24 ms 1408 KB
1_005.txt 23 ms 1408 KB
1_006.txt 22 ms 1408 KB
1_007.txt 4 ms 384 KB
1_008.txt 1 ms 256 KB
1_009.txt 6 ms 512 KB
1_010.txt 1 ms 256 KB
1_011.txt 4 ms 384 KB
1_012.txt 1 ms 256 KB