QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#800839#9848. Paid LeaveGSYL#WA 1ms3736kbC++14736b2024-12-06 16:05:382024-12-06 16:05:39

Judging History

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

  • [2024-12-06 16:05:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3736kb
  • [2024-12-06 16:05:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m,x,y;
    cin>>n>>m>>x>>y;
    vector<int> a(m+2);
    a[0] = 0;
    a.back() = n+1;
    for(int i=1;i<=m;i++)cin>>a[i];
    int last = 0;
    int ad = 0;
    for(int i=1;i<a.size();i++){
        // cerr<<i<<endl;
        int d = a[i]-a[i-1]-1;
        // cerr<<d<<endl;
        ad += d/(y+2)*2;
        d%=y+2;
        // cerr<<' '<<d<<endl;
        while(1){
            int d1 = x;
            int d2 = y-last;
            int dd = min(d1,d2);
            if(dd>=d){
                last = d;
                break;
            }
            last = dd;
            d-=dd+1;
            ad++;
        }
    }
    cout<<ad<<endl;


}

詳細信息

Test #1:

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

input:

8 0 3 3


output:

2

result:

ok single line: '2'

Test #2:

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

input:

11 1 2 4
6

output:

2

result:

ok single line: '2'

Test #3:

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

input:

17 2 5 7
6 12

output:

1

result:

ok single line: '1'

Test #4:

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

input:

30 2 5 6
7 21

output:

5

result:

ok single line: '5'

Test #5:

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

input:

38 1 6 6
20

output:

8

result:

ok single line: '8'

Test #6:

score: -100
Wrong Answer
time: 1ms
memory: 3736kb

input:

1000000000000000000 200000 335 557
100001107740026995 100006839102156826 100022686256019614 100026614627087325 100028132190673912 100028139572417710 100034215622293235 100034900480199246 100036139505369203 100044008392310726 100044464248012860 100048368217638304 100053064689708568 100060255356679151...

output:

2147483647

result:

wrong answer 1st lines differ - expected: '3577817531189003', found: '2147483647'