Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41451 Andrew宥杨 水下探测器 C++ 编译错误 0 MS 0 KB 249 2024-02-21 09:06:04

Tests(0/0):


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


测评信息: