QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#199341#6348. Egor Has a Problemucup-team870#WA 48ms7844kbC++14758b2023-10-04 09:30:262023-10-04 09:30:26

Judging History

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

  • [2023-10-04 09:30:26]
  • 评测
  • 测评结果:WA
  • 用时:48ms
  • 内存:7844kb
  • [2023-10-04 09:30:26]
  • 提交

answer

#include<bits/stdc++.h>
#define For(i,j,k) for(int i=j;i<=k;++i)
using namespace std;
long long a[500005];
int main(){
    int n; scanf("%d",&n);
    For(i,1,n) scanf("%d",&a[i]);
    if (n<=100){
        For(i,1,n-3)
            For(j,i+1,n-2)
                For(k,j+1,n-1)
                    For(l,k+1,n){
                        if (a[l]/a[k]==a[j]/a[i]){
                            printf("YES\n%d %d %d %d\n",i,j,k,l);
                            exit(0);
                        }
                    }
        printf("NO\n"); exit(0);
    }
    int x=0,y=0;
    For(i,1,n-1){
        if (a[i+1]/a[i]==1){
            if (!x) x=i,y=i+1,i++;
            else printf("YES\n%d %d %d %d\n",x,y,i,i+1),exit(0);
        }
    }
}

詳細信息

Test #1:

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

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: 3728kb

input:

5
1 2 6 30 210

output:

NO

result:

ok OK

Test #3:

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

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: 0
Accepted
time: 39ms
memory: 7652kb

input:

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

output:

YES
5 6 9 10

result:

ok OK

Test #6:

score: 0
Accepted
time: 43ms
memory: 7820kb

input:

500000
4296317198460 9088530306835 12761569474357 16261038279090 16941085611205 18350614838717 22480413215272 23329628179141 24312311764761 24433929342173 27221427530427 28176763451413 28796907935821 30472998712185 32522454545697 33716639435084 36803789739537 36820525380957 39761789956892 4078696306...

output:

YES
5 6 9 10

result:

ok OK

Test #7:

score: 0
Accepted
time: 48ms
memory: 7652kb

input:

500000
2486629253945 2653364744556 4284488165789 4329370039939 4642065503681 6901749347495 19192137130640 21230142707219 21572527039148 22380596790669 24549580468932 24705234465366 24809017205084 25372640950744 30936948747149 31605133106641 35382503368540 36668459004194 39297585189262 40441705410326...

output:

YES
5 6 9 10

result:

ok OK

Test #8:

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

input:

500000
1212707463644 3060808785468 5253681005592 6636218910647 8688761397981 9169130038833 9604296507161 10581672897486 14606712594653 18215478522408 19985113657583 21876858531698 22009681507073 25744252327149 29854713235059 30049643326503 35465827651805 38437058489989 40205415453241 42389564776077 ...

output:

YES
1 2 8 9

result:

wrong answer the products are not equal