Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
83758 sh25_huangse 水下探测器 C++ 解答错误 0 MS 248 KB 268 2026-02-01 20:49:14

Tests(0/1):


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


测评信息: