QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#240763 | #6348. Egor Has a Problem | 45645A# | WA | 19ms | 5708kb | C++17 | 788b | 2023-11-05 18:35:40 | 2023-11-05 18:35:40 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
inline int read()
{
char ch;
while((ch=getchar())<'0'||ch>'9');
int res=ch-'0';
while((ch=getchar())>='0'&&ch<='9') res=res*10+ch-'0';
return res;
}
const int N=500100;
int n,a[N];
int main()
{
n=read();
for(int i=1;i<=n;i++) a[i]=read();
if(n<=70)
{
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 l=k+1;l<=n;l++)
if(a[j]/a[i]==a[l]/a[k])
{
printf("YES\n%d %d %d %d",i,j,k,l);
return 0;
}
printf("NO\n");
return 0;
}
printf("YES\n");
int i=2;
for(;i<=n;i++)
{
if(a[i]/a[i-1]==1) printf("%d %d ",i-1,i);
break;
}
i+=2;
for(;i<=n;i++)
{
if(a[i]/a[i-1]==1) printf("%d %d",i-1,i);
break;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3792kb
input:
6 2 6 11 21 47 120
output:
YES 1 3 4 6
result:
ok OK
Test #2:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
5 1 2 6 30 210
output:
NO
result:
ok OK
Test #3:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
4 7 13 77 143
output:
YES 1 2 3 4
result:
ok OK
Test #4:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
4 10 29 31 100
output:
NO
result:
ok OK
Test #5:
score: -100
Wrong Answer
time: 19ms
memory: 5708kb
input:
500000 627045176858 4817409059014 6288122580263 11138485427254 14292718094002 14799874839768 16926890883539 17617152313162 17645472255619 18208915248631 22963632241827 24466999302606 25551903318615 26091633648017 38200644379849 39885775205129 40036378248650 40309675851194 40773414900416 408933438176...
output:
YES
result:
wrong output format Unexpected end of file - int32 expected