Tag: Codeforces Round #424 (Div. 2

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

#include<cstdio> #include<algorithm> using namespace std; int n,a; long long k,ans=0; int main(){ scanf("%d%lld",&n,&k); for (int i=1; i<=n; i++) scanf("%d",&a); for (long long l=1,r; l<=1LL<<62;...

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

#include<bits/stdc++.h> using namespace std; const int maxn=2e3+5; int main(){ int n,k,p,a,b; int res=INT_MAX,i,j; cin>>n>>k>>p; for(i=0;i<n;i++) scanf("%d",a+i); for(i=0;i<k;i++) scanf("%d",b+i); sort(a,a+n); sort(b,b+k); for(i=0;i<=k-n;i++){ int t=0; for(j=0;j<n;j++) t=max(t,abs(a-b)+abs(p-b)); res=min(t,res); } cout<<res; return 0; }

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; set<int>c; for(int i=0;i<k;i++){ cin>>t; arr= arr+t; } for(int i=0;i<n;i++){ cin>>t; set<int>mmp; for(int j=0;j<k;j++){ int x = t-arr; if(!i||(c.find(x) != c.end())){ mmp.insert(x); } } c =mmp; } cout<<c.size(); return...

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

#include <bits/stdc++.h> using namespace std; string s1, s2, t; int main() { cin >> s1 >> s2 >> t; for(char c :...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!