【题目链接】:
【题意】
让你从n辆车中选一辆车; 每一辆车有3个属性 1.到达车的身边的时刻 2.车什么时候开始能够被使用 3.车到达它家所需时间; 问你到家的最早时刻.【题解】
车如果晚于可用时间,a+c 否则b+c 取最小值就好 【Number Of WA】 0 【反思】 手速题 【完整代码】#includeusing namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define LL long long#define rep1(i,a,b) for (int i = a;i <= b;i++)#define rep2(i,a,b) for (int i = a;i >= b;i--)#define mp make_pair#define pb push_back#define fi first#define se second#define ms(x,y) memset(x,y,sizeof x)#define Open() freopen("F:\\rush.txt","r",stdin)#define Close() ios::sync_with_stdio(0)typedef pair pii;typedef pair pll;const int dx[9] = { 0,1,-1,0,0,-1,-1,1,1};const int dy[9] = { 0,0,0,-1,1,-1,1,-1,1};const double pi = acos(-1.0);const int N = 1000;struct abc{ int x,y,z;};int n;abc a[N+100];int main(){ //Open(); Close(); cin >> n; rep1(i,1,n){ cin >> a[i].x >> a[i].y >> a[i].z; } int ans = 3e5+10; rep1(i,1,n){ if (a[i].x <= a[i].y){ ans = min(ans,a[i].y+a[i].z); }else{ ans = min(ans,a[i].x+a[i].z); } } cout << ans << endl; return 0;}