版本比较
题解 P1315 【观光公交】
正文
增加 23 行删除 11 行
16 行未改动1718192021212322232526272824252627282930313233343537363738394015 行未改动56575859616260616263646566676869707172737475647677787968808182838418 行未改动16 行未改动## 代码:
```#include<bits/stdc++.h>#define int long longusing namespace std;const int N=1e5+10;const int N=1005;int n,m,k;int d[N];//通过一段路径的时间 int gt[N];//公交车的到达时间 int tim[N];//乘客到达时间的最大值 int cnt[N];//下车的人数 int d[N];//通过一段路径的时间int gt[N];//公交车的到达时间int tim[N];//乘客到达时间的最大值int cnt[N];//下车的人数int ans=0,del=0;struct node{ int l,r,val,sum; bool operator <(const node &aa) const{ return val<aa.val; }};priority_queue<node>q;void calc(int l,int r){//在路段 l 使用,影响到 l+1~r 的站点 void calc(int l,int r){//在路段 l 使用,影响到 l+1~r 的站点 if(l>=r)return; if(!d[l]){ calc(l+1,r); return;15 行未改动 gt[i]-=T; } return;}signed main(){ cin>>n>>m>>k;inline int read(){ char c;int x=0; c=getchar(); while(c<'0'||c>'9')c=getchar(); while(c>='0'&&c<='9'){ x=(x<<1)+(x<<3)+c-'0'; c=getchar(); } return x;
}int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); n=read();m=read();k=read(); for(int i=1;i<n;i++){ cin>>d[i]; d[i]=read(); } for(int i=1;i<=m;i++){ int t,a,b; cin>>t>>a>>b; t=read();a=read();b=read(); tim[a]=max(tim[a],t); del+=t; cnt[b]++; }18 行未改动