Submission #2202425


Source Code Expand

Copy
#include <iomanip>
#include <random>
#include <time.h>
#include <vector>
#include <queue>
#include <functional>
#include <map>
#include <string>
#include <cstdlib>
#include <typeinfo>
#include <math.h>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll n, t, x, y;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> n;
	ll nt, nx, ny;
	nt = nx = ny = 0;
	bool f = 0;
	for (int i = 0; i < n; i++) {
		cin >> t >> x >> y;
		ll T = t - nt, X = abs(x - nx), Y = abs(y - ny);
		if (T < X + Y) {
			f = 1;
			break;
		}
		T -= X;
		if (T % 2 != Y % 2) {
			f = 1;
			break;
		}
		nt = t, nx = x, ny = y;
	}
	cout << (f ? "No" : "Yes") << endl;
	return 0;
}

Submission Info

Submission Time
Task ABC086C - Traveling
User littlegirl112
Language C++14 (GCC 5.4.1)
Score 300
Code Size 763 Byte
Status
Exec Time 21 ms
Memory 256 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 21 ms 256 KB
1_005.txt 1 ms 256 KB
1_006.txt 19 ms 256 KB
1_007.txt 4 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