QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#667457 | #7159. Candy | Warinchai_s# | 0 | 0ms | 3672kb | C++14 | 531b | 2024-10-22 23:11:38 | 2024-10-22 23:11:47 |
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int ar[105];
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n,f,t;cin>>n>>f>>t;
int cnt=0;
int aans=0;
for(int i=0;i<n;i++){
cin>>ar[i];
if(ar[i]==1){
cnt++;
if(cnt<=t){
aans+=(i-cnt+1);
}
}
}
if(cnt<t||f<t){
cout<<"NO\n";
return 0;
}else{
cout<<aans<<"\n";
return 0;
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
1 1 7 7
output:
NO
result:
wrong answer 1st lines differ - expected: '0', found: 'NO'
Subtask #2:
score: 0
Wrong Answer
Test #9:
score: 19
Accepted
time: 0ms
memory: 3604kb
input:
100 50 50 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
1805
result:
ok single line: '1805'
Test #10:
score: 19
Accepted
time: 0ms
memory: 3616kb
input:
100 40 40 1 0 1 0 1 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 0 1 0 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 1 1 1 0 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0
output:
607
result:
ok single line: '607'
Test #11:
score: 19
Accepted
time: 0ms
memory: 3672kb
input:
100 60 60 0 0 1 0 0 0 1 1 0 1 1 0 1 1 0 0 0 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0
output:
1229
result:
ok single line: '1229'
Test #12:
score: 19
Accepted
time: 0ms
memory: 3552kb
input:
100 60 60 0 0 0 1 1 1 1 1 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 1 1 1 1 1 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 0 1 1 0 0 1
output:
NO
result:
ok single line: 'NO'
Test #13:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
100 98 47 0 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 1 0 1 1 1 0 0
output:
1507
result:
wrong answer 1st lines differ - expected: '0', found: '1507'
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%