QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#858892#8811. Heat Strokesichengzhou6 3ms3584kbC++17516b2025-01-17 08:42:232025-01-17 08:42:23

Judging History

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

  • [2025-01-17 08:42:23]
  • 评测
  • 测评结果:6
  • 用时:3ms
  • 内存:3584kb
  • [2025-01-17 08:42:23]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=8e3+8;
int n,a[N],m;
int main()
{
    int x;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    cin>>m;
    int ans=0;
    for(int i=1;i<=m;i++)
    {
        cin>>x;
        if(a[x+1]==0)
        {
            if(a[x]==0)
            {
                ans++;
            }else{
                a[x]--;
            }
        }else{
            a[x+1]--;
        }
    }
    cout<<ans<<'\n';
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

2
0 0
1
1

output:

1

result:

ok single line: '1'

Test #2:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
0 1
1
1

output:

0

result:

ok single line: '0'

Test #3:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
1 0
1
1

output:

0

result:

ok single line: '0'

Test #4:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
1 1
1
1

output:

0

result:

ok single line: '0'

Test #5:

score: 6
Accepted
time: 0ms
memory: 3456kb

input:

2
2 2
1
1

output:

0

result:

ok single line: '0'

Test #6:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
1 1
2
1 1

output:

0

result:

ok single line: '0'

Test #7:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
2 2
2
1 1

output:

0

result:

ok single line: '0'

Test #8:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
3 3
2
1 1

output:

0

result:

ok single line: '0'

Test #9:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
298 299
600
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

3

result:

ok single line: '3'

Test #10:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

2
1749 1749
3500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

2

result:

ok single line: '2'

Test #11:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

2
3999 3999
8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

2

result:

ok single line: '2'

Test #12:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

2
1 1
8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

7998

result:

ok single line: '7998'

Test #13:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

2
0 0
8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

8000

result:

ok single line: '8000'

Test #14:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

3
0 1 1
2
1 2

output:

0

result:

ok single line: '0'

Test #15:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

3
1 1 1
3
1 2 2

output:

1

result:

ok single line: '1'

Test #16:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

3
1 2 0
3
1 1 2

output:

1

result:

ok single line: '1'

Test #17:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

3
1 2 0
3
1 2 2

output:

1

result:

ok single line: '1'

Test #18:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

3
1 3 0
4
1 1 1 2

output:

1

result:

ok single line: '1'

Test #19:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

4
0 2 1 1
4
1 1 2 3

output:

0

result:

ok single line: '0'

Test #20:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

18
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
33
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17

output:

15

result:

ok single line: '15'

Test #21:

score: 6
Accepted
time: 2ms
memory: 3584kb

input:

8000
0 2 0 0 0 0 0 0 1 0 0 2 1 1 0 1 1 0 2 2 0 0 0 1 1 0 0 0 0 1 1 1 2 3 0 2 2 0 0 1 0 1 2 1 1 0 1 1 0 0 0 0 1 1 0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 2 0 0 0 0 0 1 0 1 1 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 2 0 3 2 0 0 0 0 0 1 1 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 3 0...

output:

843

result:

ok single line: '843'

Test #22:

score: 6
Accepted
time: 3ms
memory: 3584kb

input:

8000
1 0 1 2 3 2 1 1 1 1 2 4 1 3 2 2 0 3 2 0 1 1 1 1 0 0 0 0 1 0 4 4 3 0 0 0 2 1 0 0 0 0 0 0 0 0 0 2 0 3 3 0 2 0 0 0 2 0 0 2 2 0 1 5 3 0 0 3 0 1 1 2 1 1 2 2 0 0 3 0 0 1 0 0 1 0 1 1 2 3 0 0 1 4 1 2 1 1 2 1 0 0 0 2 2 1 1 0 1 1 1 1 1 0 0 0 0 0 1 0 1 0 3 0 1 1 0 1 1 1 0 0 2 1 1 3 3 0 1 0 0 4 1 0 0 1 0 0...

output:

1799

result:

ok single line: '1799'

Test #23:

score: 6
Accepted
time: 3ms
memory: 3584kb

input:

8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

2146

result:

ok single line: '2146'

Test #24:

score: 6
Accepted
time: 3ms
memory: 3456kb

input:

8000
8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 8000 ...

output:

0

result:

ok single line: '0'

Test #25:

score: 6
Accepted
time: 2ms
memory: 3456kb

input:

3579
0 3 5 0 3 0 1 6 5 1 1 7 0 1 2 0 0 4 3 1 0 4 2 8 2 5 2 2 3 2 0 0 1 4 2 2 2 4 2 0 4 1 0 4 0 5 3 4 1 8 6 0 0 0 2 4 1 2 7 8 2 2 3 5 0 1 0 0 2 1 4 6 4 4 1 1 4 2 1 0 3 3 0 4 4 1 1 6 0 1 2 0 0 1 3 7 3 2 1 3 2 2 1 0 0 0 1 5 4 4 3 0 3 4 4 3 2 1 2 2 1 1 2 1 1 3 11 1 2 0 3 0 4 1 3 3 6 2 1 7 6 2 0 1 3 0 1 ...

output:

1634

result:

ok single line: '1634'

Test #26:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

1357
11 16 5 0 6 10 10 7 5 1 12 13 4 9 4 6 0 6 1 11 2 8 7 8 1 4 8 9 3 3 3 4 1 4 4 1 5 6 18 7 10 6 9 7 10 2 10 6 1 2 4 12 9 5 7 5 4 5 1 4 4 6 1 4 11 3 13 3 12 7 0 3 9 1 5 6 3 2 3 0 13 2 8 1 6 10 4 5 15 1 1 1 2 5 7 8 5 11 3 7 4 2 0 7 3 6 6 0 3 1 5 4 13 13 5 5 0 6 1 7 9 1 8 1 6 8 12 2 2 2 5 8 11 5 7 6 ...

output:

1608

result:

ok single line: '1608'

Test #27:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

68
38 219 171 204 116 205 90 225 221 43 74 153 142 147 151 133 65 189 196 4 91 93 215 80 213 25 180 16 24 143 60 22 129 190 59 70 242 53 205 95 212 26 69 123 50 47 205 5 62 154 78 203 48 99 118 7 25 151 222 141 151 143 90 90 141 228 193 75
8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

1018

result:

ok single line: '1018'

Test #28:

score: 6
Accepted
time: 1ms
memory: 3584kb

input:

3
137 4887 1630
8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

1483

result:

ok single line: '1483'

Test #29:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

3
1 7999 0
8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

1

result:

ok single line: '1'

Test #30:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

4
0 50 50 0
100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

output:

0

result:

ok single line: '0'

Test #31:

score: 6
Accepted
time: 0ms
memory: 3584kb

input:

4
0 4000 4000 0
8000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

0

result:

ok single line: '0'

Test #32:

score: 6
Accepted
time: 2ms
memory: 3584kb

input:

800
0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 3 0 3 1 3 2 3 3 3 4 3 5 3 ...

output:

1330

result:

ok single line: '1330'

Subtask #2:

score: 0
Wrong Answer

Test #33:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

3
1 1 1
3
1 2 1

output:

0

result:

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

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #6:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%