Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
43014 | Hyma | 水下探测器 | C++ | Compile Error | 0 MS | 0 KB | 275 | 2024-03-05 21:10:11 |
#include<bits/stdc++.h> using namespace std; int main() { int a[105]; int n,s; cin>>a>>n>>s; for(int i=0;i<strlen(a);i++){ if(a[i]=='u'){ if(s>0) s--; } } else if(a[i]=='d'){ if(s<n){ s++; } } return 0; }