| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 78536 | sh25_ganzy | 水下探测器 | C++ | Accepted | 0 MS | 252 KB | 292 | 2025-12-26 18:16:57 |
#include<bits/stdc++.h> using namespace std; int main(){ int h,s; cin>>h>>s; char c[100]; for(int i=0;i<100;i++){ cin>>c[i]; if(c[i]=='u'&&s>0){ s-=1; }else if(c[i]=='d'&&s<h){ s+=1; } } cout<<s; return 0; }