若第 行是数字,显然输出它即可,因为其小于国家限速;
若第 行是 /,则最低国家车速为大于前面所有限速最大值的最小整十数,因为:
- 最低国家车速大于限速
- 最低国家车速为整十数
AC Code
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,ans=0;
cin>>n;
while(n--){
string s;
cin>>s;
if(s=="/"){
int tem=ans+1;
while(tem%10!=0)tem++;
cout<<tem<<endl;
}else{
int t=stoi(s);
ans=max(ans,t);
cout<<t<<endl;
}
}
return 0;
}