Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
16667 Jerry38 水下探测器 C++ 通过 0 MS 260 KB 237 2023-05-07 09:22:06

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int h,s; string str; cin>>h>>s>>str; for(int i=0;i<str .size();i++){ if(str[i]=='u'){ if(s>0) s--; } else if(s<h)s++; } cout<<s; return 0; }


测评信息: