QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#277997#6348. Egor Has a Problempaul2008#WA 46ms9084kbC++23648b2023-12-07 10:33:332023-12-07 10:33:35

Judging History

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

  • [2023-12-07 10:33:35]
  • 评测
  • 测评结果:WA
  • 用时:46ms
  • 内存:9084kb
  • [2023-12-07 10:33:33]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

long long a[500005];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%lld",&a[i]);

	if(n<=100)
	{
		for(int i=1;i<=n;i++)
			for(int j=i+1;j<=n;j++)
				for(int k=j+1;k<=n;k++)
					for(int p=k+1;p<=n;p++)
						if(a[p]/a[k]==a[j]/a[i])
						{
							printf("YES\n");
							printf("%d %d %d %d\n",i,j,k,p);
							return 0;
						}
		printf("NO\n");
		return 0;
	}

	vector <int> pos;
	for(int i=2;i<=n;i++)
		if(a[i]/a[i-1]==1)
			pos.push_back(i);

	printf("YES\n");
	printf("%d %d %d %d\n",pos[0]-1,pos[0],pos[1]-1,pos[1]);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3672kb

input:

6
2 6 11 21 47 120

output:

YES
1 3 4 6

result:

ok OK

Test #2:

score: 0
Accepted
time: 1ms
memory: 3608kb

input:

5
1 2 6 30 210

output:

NO

result:

ok OK

Test #3:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

4
7 13 77 143

output:

YES
1 2 3 4

result:

ok OK

Test #4:

score: 0
Accepted
time: 1ms
memory: 3664kb

input:

4
10 29 31 100

output:

NO

result:

ok OK

Test #5:

score: -100
Wrong Answer
time: 46ms
memory: 9084kb

input:

500000
627045176858 4817409059014 6288122580263 11138485427254 14292718094002 14799874839768 16926890883539 17617152313162 17645472255619 18208915248631 22963632241827 24466999302606 25551903318615 26091633648017 38200644379849 39885775205129 40036378248650 40309675851194 40773414900416 408933438176...

output:

YES
2 3 3 4

result:

wrong answer 4 indices should be in increasing order