Programming Archive

Codeforces Round #444 (Div. 2), problem: (E) Little Brother Solution In C/C++

Codeforces Round #444 (Div. 2), problem: (E) Little Brother Solution In C/C++

#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<algorithm> #include<cstdlib> #define eps 1e-7 using namespace std; double x,y,r,L; struct node{double l,r;}a; struct P{double x,y;}A,B,M,s,O,p; int n; inline double dis(P a,P b){return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));} inline P operator-(P a,P b){return (P){a.x-b.x,a.y-b.y};} …
Codeforces Round #444 (Div. 2), problem: (D) Ratings and Reality Shows Solution In C/C++

Codeforces Round #444 (Div. 2), problem: (D) Ratings and Reality Shows Solution In C/C++

#include <cstdio> #include <algorithm> using namespace std; long long n,a,b,c,d,st,len,t; int q; int main() { scanf(“%lld%lld%lld%lld%lld%lld%lld”,&n,&a,&b,&c,&d,&st,&len); for (int i=1;i<=n;i++) scanf(“%lld%d”,&t,&q); t=-1; int now=1; long long change_rating=0,Min=0,rating=st; for (int i=1;i<=n;i++) { while (now<=n&&t-t<len) { change_rating+=(q?c:-d); Min=min(Min,change_rating); …