Sponsors

Tag: C

Codeforces Round #415 (Div....

#include <cstdio> using namespace std; #define ff fflush(stdout) #define mid (lef+rig>>1) int n,...

Codeforces Round #415 (Div....

#include <bits/stdc++.h> using namespace std; long long n,a,r,m=1e9+7,sum=0; int main(){...

Codeforces Round #415 (Div....

#include<bits/stdc++.h> using namespace std; int64_t n,f,k,l,i,w,s,a; int main(){ for(cin>>n>>f;i<n;i++)cin>>k>>l,w=min(k,l),a=min(2*k,l)-w,s+=w; sort(a,a+n); for(i=0;i<n;i++)s+=i<f?a:0; cout<<s; }

Codeforces Round #415 (Div....

#include <cstdio> int n,k,sum=0,mark; int main() { scanf("%d%d",&n,&k); for(int i=1;i<=n;i++)scanf("%d",&mark),sum+=mark; mark=(n*k-sum)*2-n; if(mark>0)printf("%d",mark); else printf("0"); }

Tinkoff Challenge – Final...

#include<iostream> #include<cstdio> #include<fstream> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #include<cmath> #include<cstring> #include<cstdlib> using namespace std; int a,b; int main() { int n,i,x,y; cin>>n; for(i=1;i<=n;i=i+1) cin>>a; for(i=1;i<=n;i=i+1) { x=(i-1)-(n-i); if(x<0) x=-x; b=max(b,a); } for(i=1;i<n;i=i+1) { x=(i-1)-(n-i-1); if(x<0) x=-x; b=max(b,min(a,a)); } for(i=2;i<=n;i=i+1) b=max(b,b); for(i=1;i<n;i=i+1) cout<<b<<' '; cout<<b<<endl; return 0; }

Tinkoff Challenge – Final...

#include<bits/stdc++.h> #define MAXN 300100 using namespace std; struct node{int y,next;}e; int n,m,len,Link,p,hash,col,vis,used; inline int...

Tinkoff Challenge – Final...

#include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define MN 300000 char a,b,c; bool cmp(char x,char y){return...

Tinkoff Challenge – Final...

#include<bits/stdc++.h> int main(){double p,l,i=1;std::cin>>p>>l;for(;i<p;)printf("%.7f ",sqrt(i++/p)*l);}

Tinkoff Challenge – Final...

#include<cstdio> int main() { int a,b,c,i,ans=0; scanf("%d%d%d",&a,&b,&c); for(scanf("%d",&i);i--;)scanf("%d",&a),a>b&&a<c?++ans:0; printf("%d",ans); }

Playrix Codescapes Cup (Codeforces...

include<cstdio> using namespace std; inline int read(){ char c=getchar();int p=1,ret=0; while((c<'0')||(c>'9')){if(c=='-')p=-1;c=getchar();} while((c>='0')&&(c<='9'))ret=(ret<<1)+(ret<<3)+c-'0',c=getchar(); return ret*p; } int n,m; long...

Playrix Codescapes Cup (Codeforces...

#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define N 200010 #define ll long long #define INF...

Playrix Codescapes Cup (Codeforces...

#include <bits/stdc++.h> using namespace std; typedef int64_t ll; #define f(i,j,k) for(int i=j;i<k;i++) const...

Advertisement

spot_img