为什么样例不通过还能拿满分?
查看原帖
为什么样例不通过还能拿满分?
790898
shenwentao楼主2023/8/3 13:09

这道题目我尝试了好几遍,样例全对只有60分(后面成功了),但样例不通过却AC了。

  • AC代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    if((a>60 and b>60 and c>60) || (a>60 and b>60 and c<60) || (a>60 and b<60 and c>60) || (a<60 and b>60 and c>60))
        cout<<"PASS"<<endl;
    else
        cout<<"FAIL"<<endl;
    if((a*d+b*e+c*f)/(d+e+f)>60)
        cout<<"PASS"<<endl;
    else
        cout<<"FAIL"<<endl;
    return 0;
}

这很明显,连第一个样例也过不了

2023/8/3 13:09
加载中...