Submission #2202650


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

#define FOR(var,start,end) for(int var=start; var<end; var++)
#define REP(var,cnt) FOR(var,0,cnt)

int main(void) {


	int N;
	cin >> N;
	
	int pt = 0;
	int px = 0;
	int py = 0;
	
	REP(i, N) {
		int t, x, y;
		cin >> t >> x >> y;
		
		int dx = abs ( px - x );
		int dy = abs ( py - y );
		int dt = t - pt;
		
		if ( dx+dy > dt || (dt-dx-dy)%2 ) {
			cout << "No" << endl;
			return 0;
		}
	}
	
	cout << "Yes" << endl;
}

Submission Info

Submission Time
Task ABC086C - Traveling
User yokoyama10
Language C++14 (GCC 5.4.1)
Score 300
Code Size 634 Byte
Status
Exec Time 88 ms
Memory 764 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 8 ms 764 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 88 ms 256 KB
1_005.txt 1 ms 256 KB
1_006.txt 75 ms 256 KB
1_007.txt 12 ms 256 KB
1_008.txt 1 ms 256 KB
1_009.txt 1 ms 256 KB
1_010.txt 1 ms 256 KB
1_011.txt 1 ms 256 KB
1_012.txt 1 ms 256 KB