QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#57487 | #4388. C++ to Python | qinjianbin# | WA | 1ms | 1740kb | C++17 | 701b | 2022-10-22 14:07:31 | 2022-10-22 14:07:32 |
Judging History
answer
#include<cstdio>
typedef long long LL;
LL n;
const LL x0=-22,y0=5;
LL min(LL x,LL y)
{
if (x==-1) return y;
return x<y?x:y;
}
void standing_by()
{
int i;
LL tot;
LL tmp;
LL ans=-1;
LL x,y;
scanf("%lld",&n);
tmp=0;
for(i=1;tmp!=1;i++)
{
tmp=(tmp+31)%7;
//printf("%d %lld\n",i,i*31);
}
tot=n/365;
for(i=0;i<=tot&&i<=100000;i++)
{
tmp=n-(tot-i)*365;
x=x0*tmp;
y=y0*tmp;
x=x%31;
if (x<0) x+=31;
y=(tmp-x*7)/31;
if (y>=0)
{
ans=min(ans,x+y+tot-i);
}
}
printf("%lld\n",ans);
}
void complete()
{
}
int main()
{
int t;
scanf("%d",&t);
for(;t;t--)
{
standing_by();
complete();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 1740kb
input:
100 std::make_tuple(-2,-2,4,-5,std::make_tuple(std::make_tuple(2,1,-4,5,-3),std::make_tuple(std::make_tuple(std::make_tuple(std::make_tuple(5,std::make_tuple(std::make_tuple(-4,std::make_tuple(std::make_tuple(std::make_tuple(0,std::make_tuple(std::make_tuple(std::make_tuple(1,-1,-3,-5,4),std::make_t...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
wrong answer 1st lines differ - expected: '(-2,-2,4,-5,((2,1,-4,5,-3),(((...4,5)),5)),1),5,4),4,-1)),-5,-3)', found: '0'