Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62010 刘焕群 水下探测器 C++ Wrong Answer 1 MS 276 KB 345 2023-12-16 16:48:53

Tests(0/5):


Code:

# include<stdio.h> # include<iostream> # include<string> using namespace std; int main(){ int h,s; string z; int len=z.size(); cin>>h>>s>>z; for(int i=1;i<=len;i++){ if(z[i]=='u'){ if(s>0){ s=s+1; } } if(z[i]=='d'){ if(s<h){ s=s-1; } } } cout<<s; return 0; }


Run Info:

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