Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
83759 sh25_huangse 水下探测器 C++ Accepted 0 MS 252 KB 295 2026-02-01 20:50:34

Tests(1/1):


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


Judgement Protocol: