民间数据65,实测爆零qwq

P6188 [NOI Online #1 入门组] 文具订购

ParanoidMO @ 2020-03-20 09:14:11

qwq哪位大佬解答一下


by DeepSkyBlue__ @ 2020-03-20 09:14:41

民间数据玄学(


by Hexarhy @ 2020-03-20 09:14:46

可能是freopen


by KaguyaH @ 2020-03-20 09:15:15

文件读写错误


by function_of_zero @ 2020-03-20 09:15:18

申诉一下罢


by ParanoidMO @ 2020-03-20 09:20:13

那个,为什么它公布成绩上的文件名是“order_”


by ParanoidMO @ 2020-03-20 09:21:11

我写的是order.cpp,是这个的问题吗


by Hexarhy @ 2020-03-20 09:25:19

@ParanoidMO 放心我也是order.cpp跑出来有分

怀疑可能是编译错误?你有用C++11吗


by ParanoidMO @ 2020-03-20 09:32:16

#include<iostream>
using namespace std;
int n, a=0, b=0, c=0; 
int main()
{
    freopen("order.in", "r", stdin);
    freopen("order.out", "w", stdout);
    cin>>n;
    for (int i=0; i<=350; i++)
    {
        for (int j=0; j<=350; j++)
        {
            for (int k=0; k<=350; k++)
            {
                if (7*i+4*j+3*k == n)
                {
                    if (a == 0 && b == 0 && c == 0) a=i, b=j, c=k;
                    if (min(min(i, j), k) > min(min(a, b), c)) a=i, b=j, c=k;
                    else if (min(min(i, j), k) == min(min(a, b), c)&&i+j+k > a+b+c) a=i, b=j, c=k;
                }
            }
        }
    }
    if (7*a+4*b+3*c != n) cout<<-1;
    else cout<<a<<" "<<b<<" "<<c;
}

by ParanoidMO @ 2020-03-20 09:33:05

这是本蒟蒻的忘了优化的代码(但冥间数据)也有65,大佬能麻烦看看吗


by SIXIANG32 @ 2020-03-20 09:34:29

@ParanoidMO 你的……freopen?


| 下一页