0
已解决
王文博
缔造者之神
缔造者之神
样例不过??????
代码如下:
#pra**a GCC optimize(3)
#pra**a GCC target("avx")
#pra**a GCC optimize("Ofast")
#pra**a GCC optimize("inline")
#pra**a GCC optimize("-fg**e")
#pra**a GCC optimize("-fg**e-lm")
#pra**a GCC optimize("-fipa-sra")
#pra**a GCC optimize("-ftree-pre")
#pra**a GCC optimize("-ftree-vrp")
#pra**a GCC optimize("-fpeephole2")
#pra**a GCC optimize("-ffast-math")
#pra**a GCC optimize("-fsched-spec")
#pra**a GCC optimize("un**ll-loops")
#pra**a GCC optimize("-fali**-jumps")
#pra**a GCC optimize("-fali**-loops")
#pra**a GCC optimize("-fali**-labels")
#pra**a GCC optimize("-fdevirtualize")
#pra**a GCC optimize("-fcaller-saves")
#pra**a GCC optimize("-fc**ssjumping")
#pra**a GCC optimize("-fthread-jumps")
#pra**a GCC optimize("-fun**ll-loops")
#pra**a GCC optimize("-fwhole-p**gram")
#pra**a GCC optimize("-freorder-blocks")
#pra**a GCC optimize("-fschedule-insns")
#pra**a GCC optimize("inline-functions")
#pra**a GCC optimize("-ftree-tail-merge")
#pra**a GCC optimize("-fschedule-insns2")
#pra**a GCC optimize("-fst**ct-aliasing")
#pra**a GCC optimize("-fst**ct-overflow")
#pra**a GCC optimize("-fali**-functions")
#pra**a GCC optimize("-f**e-skip-blocks")
#pra**a GCC optimize("-f**e-follow-jumps")
#pra**a GCC optimize("-fsched-interblock")
#pra**a GCC optimize("-fpartial-inlining")
#pra**a GCC optimize("no-stack-p**tector")
#pra**a GCC optimize("-freorder-functions")
#pra**a GCC optimize("-findirect-inlining")
#pra**a GCC optimize("-fhoist-adjacent-loads")
#pra**a GCC optimize("-frerun-**e-after-loop")
#pra**a GCC optimize("inline-**all-functions")
#pra**a GCC optimize("-finline-**all-functions")
#pra**a GCC optimize("-ftree-switch-conversion")
#pra**a GCC optimize("-foptimize-sibling-calls")
#pra**a GCC optimize("-fexpensive-optimizations")
#pra**a GCC optimize("-funsafe-loop-optimizations")
#pra**a GCC optimize("inline-functions-called-once")
#pra**a GCC optimize("-fdelete-null-pointer-checks")
#pra**a GCC optimize(2)
#include <bits/stdc++.h>
using name** std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
st**ng s;
char c;
cin>>c;
while(c!='E')
{
s+=c;
cin>>c;
}
int a=0,b=0,n=s.size();
for(int i=1;i<n;i++)
{
if(s[i]=='A') a++;
if(s[i]=='B') b++;
if((a>=11||b>=11)&&abs(a-b)>=2)
{
cout<<a<<":"<<b<<endl;
a=0;
b=0;
}
}
if(a>0||b>0)
{
cout<<a<<":"<<b<<endl;
}
cout<<endl;
a=0;
b=0;
for(int i=1;i<n;i++)
{
if(s[i]=='A') a++;
if(s[i]=='B') b++;
if((a>=21||b>=21)&&abs(a-b)>=2)
{
cout<<a<<":"<<b<<endl;
a=0;
b=0;
}
}
if(a>0||b>0)
{
cout<<a<<":"<<b;
}
}
为什么????
王文博在2021-08-04 10:30:42追加了内容
会了,for(int i=0),随机采纳!
王文博在2021-08-04 10:31:42追加了内容