Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62011 头像本人 水下探测器 C++ Wrong Answer 1 MS 272 KB 275 2023-12-16 16:49:19

Tests(0/5):


Code:

# include<iostream> using namespace std; int main(){ int b,h,n,s,i=0; char a[100]; cin>>h>>s; cin>>a[100]; for(i=0;a[i]!='\0';i++){ if(s>0 and a[i]=='u'){ s--; } if(s<h and a[i]=='d'){ s++; } }cout<<s; return 0; }


Run Info:

------Input------
100 50 ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
------Answer-----
100
------Your output-----
50