QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#549252 | #9229. Juliet Unifies Ones | clearlove13# | Compile Error | / | / | C++23 | 1.7kb | 2024-09-06 13:25:21 | 2024-09-06 13:25:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
typedef double db;
#define vel vector<long long>
#define ves vector<string>
typedef unsigned long long ull;
const double pi= std::acos(-1.0);
const ll lens=1e4+5;
const ll MAXN5=1e5+5;
//typedef pair<ll,ll> PLL;
ll xi[lens];
const ll M = 1e9+7;
ll yi[lens];
//ll bo[lens];
ll l,r,y;
ll n,m,r1,r2,i,j,sum2,cn,d,x0,y0,k;
string na,te,ss,s;
void sol(){
cin>>s;
stack<char> st;
string gd="";
string ans="";
for (ll i = 0; i < s.size(); ++i){
if (gd.size()==0){
gd+=s[i];
}
else{
if (s[i]==gd[gd.size()-1]){
gd+=s[i];
}
else{
if (ans.size()==0){
if (gd[0]=='1'){
ans+='1';
}
}
else{
ans+=gd[0];
}
gd="";
gd+=s[i];
}
}
}
if (gd.size()!=0){
if (gd[0]=='1'){
if (ans[ans.size()-1]=='0'){
ans+='1';
}
}
}
ll rq=0;
for (ll i = 0; i < ans.size(); ++i){
if (ans[i]=='0'){
if (i==ans.size()-1){
continue;
}
else{
if (ans[i+1]=='1'&&ans[i-1]=='1'){
rq++;
}
}
}
}
cout<<rq<<"\n";
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll t=1;
//cin>>t;
while (t--){
sol();
}
return 0;
}
详细
answer.code:18:31: error: ‘ll y0’ redeclared as different kind of entity 18 | ll n,m,r1,r2,i,j,sum2,cn,d,x0,y0,k; | ^~ In file included from /usr/include/features.h:461, from /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:679, from /usr/include/c++/13/cassert:43, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:33, from answer.code:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:220:1: note: previous declaration ‘double y0(double)’ 220 | __MATHCALL (y0,, (_Mdouble_)); | ^~~~~~~~~~