https://i1.wp.com/eblogarithm.com/wp-content/uploads/2017/07/Codeforces-Round-424-Div-2-rated-based-on-VK-Cup-Finals-problem-C-Jury-Marks-Solution-In-CC1.png?fit=640%2C360

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 55 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: