Submission #2119400
Source Code Expand
#include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
typedef long long ll;
using namespace std;
const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;
//while(x!=0){
//sum+=x%10;
// x/=10;
//}
//各桁の和
//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力
//s.find(w[i])==string::npos
//findの使い方
//for(int i=0;i<n;i++){
// b[i]=x%2;
//x/=2;
//}二進数
long long int n=1,cnt=0,ans=0,a,b,c,cmp,data,m,h,x[100000],y[100000],xcmp=0,ycmp=0,sum=0,t[100000];
string s,w;
vector<int> z;
int main(void){
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n;
rep(i,n){
cin >> t[i] >> x[i] >> y[i];
}
if(n==1){
if((t[0]-x[0]-y[0])%2!=0 || t[0]<x[0]+y[0]){
Cout("No");
return 0;
}
}
else{ rep(i,n){
xcmp=Abs(x[i],x[i+1]);
ycmp=Abs(y[i],y[i+1]);
cmp=xcmp+ycmp;
Cout(cmp);
if((t[i+1]-t[i]-cmp)%2!=0 || t[i]<cmp){
Cout("No");
return 0;
}
if(i==n-2){
break;
}
}
}
Cout("Yes");
return 0;
}
Submission Info
Submission Time |
|
Task |
C - Traveling |
User |
pianotile |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1914 Byte |
Status |
WA |
Exec Time |
174 ms |
Memory |
2816 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 |
WA |
1 ms |
256 KB |
0_001.txt |
AC |
1 ms |
256 KB |
0_002.txt |
WA |
1 ms |
256 KB |
1_003.txt |
AC |
1 ms |
256 KB |
1_004.txt |
WA |
174 ms |
2816 KB |
1_005.txt |
WA |
23 ms |
2560 KB |
1_006.txt |
WA |
170 ms |
2816 KB |
1_007.txt |
WA |
27 ms |
640 KB |
1_008.txt |
WA |
1 ms |
256 KB |
1_009.txt |
WA |
5 ms |
768 KB |
1_010.txt |
WA |
5 ms |
384 KB |
1_011.txt |
WA |
4 ms |
640 KB |
1_012.txt |
WA |
1 ms |
256 KB |