提交时间:2023-01-13 12:58:11
运行 ID: 4968
#include<bits/stdc++.h> using namespace std; int main(){ int h,t; cin>>h>>t; string s; cin>>s; for(int i=0;i<s.size();i++) if(s[i]=='u')t=max(t-1,0); else t=min(t+1,h); cout<<t; return 0; } /* #include<cstdio> freopen("文件名.in","r",stdin); freopen("文件名.out","w",stdout); */