QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#57487#4388. C++ to Pythonqinjianbin#WA 1ms1740kbC++17701b2022-10-22 14:07:312022-10-22 14:07:32

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-22 14:07:32]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:1740kb
  • [2022-10-22 14:07:31]
  • 提交

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'