警示后人,如果你 #1 第二行WA,输出76 C+
查看原帖
警示后人,如果你 #1 第二行WA,输出76 C+
613794
jianhe楼主2024/12/29 20:01

注意输入的性别是字符而不是 bool。

不要像我一样写如下抽象代码:

ll chang(bool sex,ll x){
    if(sex) return nan(x);
    else return nv(x);
}
...
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
      ...
      sc[i]=s+chang(sex,to_sec(ti))+10*(pass=='P')+f,ci[i]+=c;
      //sc[i]=s+chang(sex=='M',to_sec(ti))+10*(pass=='P')+f,ci[i]+=c;
    }
    ...
    return 0;
}

虚空调试 0.5h。

2024/12/29 20:01
加载中...