样例都过了为什么#1过不去
查看原帖
样例都过了为什么#1过不去
1600781
Lsir_楼主2024/12/18 21:16

求助样例都过了#1过不去

#include<bits/stdc++.h>
using namespace std;
int main()
{
    unsigned long long n1,n2;
    cin>>n1>>n2;
    unsigned long long a[7];
    for(int i=0;i<5;i++)
    {
        a[i]=n1;
    }
    for(int i=5;i<7;i++)
    {
        a[i]=n2;
    }
    unsigned long long total;
    cin>>total;
    int day1=total/((n1*5)+(n2*2));
    long long re=total%((n1*5)+(n2*2));    
    int day2=0;
    int j=0;
    while(re>0)
    {
        re-=a[j];
        j++;
        day2++;
    }
    cout<<day1*7+day2;
    return 0;
}
2024/12/18 21:16
加载中...