社区讨论
玄
AT_abc184_b[ABC184B] Quizzes参与者 5已保存回复 17
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 15 条
- 当前快照
- 1 份
- 快照标识符
- @m0etdhsn
- 此快照首次捕获于
- 2024/08/29 12:57 2 年前
- 此快照最后确认于
- 2025/11/05 00:29 4 个月前
CPP
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int n,x;
cin>>n>>x;
char s[n+1];
cin>>s;
int l=strlen(s);
for(int i=0;i<l;i++)
{
if(s[i]=='o')x++;
if(s[i]=='x')x=max(0,x-1);
}
cout<<x;
return 0;
}
回复
共 17 条回复,欢迎继续交流。
正在加载回复...