Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
56414 | yuboyuan | 水下探测器 | C++ | Wrong Answer | 0 MS | 244 KB | 264 | 2024-11-12 19:34:49 |
#include<iostream> #include<string> using namespace std; int main() { int h,s; string a; cin>>h>>s>>a; for(int i=0;i<a.size();i++) { if(a.at(i)=='u') if(s) s--; else if(h-s) s++; } cout<<s; return 0; }