问题标题: 酷町堂:2834 截取字符串

0
0
已解决
王文博
王文博
缔造者之神
缔造者之神

70分分分分??????

代码如下:

#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;
st**ng a,b;
int x,y;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>a>>b;
    cin>>x>>y;
    st**ng c=a.substr(x,3),d=b.substr(y,3);
    if(c>d) cout<<a;
    else cout<<b;
}

哪里错了?我看了一个测试点,是A和a比较,输出A的字符串???????

a>A???

A>a???

我理解有什么偏差吗?


0
已采纳
袁宇泽
袁宇泽
高级守护
高级守护

substr时x和y分别要-1

 

求采纳

0
0
袁宇泽
袁宇泽
高级守护
高级守护

tmpa=a.substr(x,3);

tmpb=b.substr(y,3);

我这样写就AC

我要回答