Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals), problem: (C) Jury Marks Solution In C/C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>k>>n;
int t;
int arr[k];
set<int>c;
for(int i=0;i<k;i++){
cin>>t;
arr[i]= arr[i-1]+t;
}
for(int i=0;i<n;i++){
cin>>t;
set<int>mmp;
for(int j=0;j<k;j++){
int x = t-arr[j];
if(!i||(c.find(x) != c.end())){
mmp.insert(x);
}
}
c =mmp;
}
cout<<c.size();
return 0;
}

(Visited 65 times, 1 visits today)

About the Author:

Leave A Comment