版本比较
题解 P1315 【观光公交】
正文
增加 6 行删除 6 行
19 行未改动202122232425262724252627282930313233343536363738394024 行未改动6566676869697071727329 行未改动19 行未改动#include<bits/stdc++.h>using namespace std;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;24 行未改动 x=(x<<1)+(x<<3)+c-'0'; c=getchar(); } return x;
}int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);29 行未改动