From 0af91b8c54c63a982a62e8ebbe3fb30baa2a5ec0 Mon Sep 17 00:00:00 2001 From: gauravsahay007 Date: Tue, 25 Oct 2022 13:18:33 +0530 Subject: [PATCH] Added some codeforces soltions --- Codeforces_Solutions/Fedor_and_New_Game.cpp | 35 ++++++++++++++++++++ Codeforces_Solutions/Queue_At_the_School.cpp | 32 ++++++++++++++++++ Codeforces_Solutions/Random_Teams.cpp | 31 +++++++++++++++++ Codeforces_Solutions/Xenia_and_Ringroad.cpp | 34 +++++++++++++++++++ Codeforces_Solutions/stopwatch.py | 0 5 files changed, 132 insertions(+) create mode 100644 Codeforces_Solutions/Fedor_and_New_Game.cpp create mode 100644 Codeforces_Solutions/Queue_At_the_School.cpp create mode 100644 Codeforces_Solutions/Random_Teams.cpp create mode 100644 Codeforces_Solutions/Xenia_and_Ringroad.cpp create mode 100644 Codeforces_Solutions/stopwatch.py diff --git a/Codeforces_Solutions/Fedor_and_New_Game.cpp b/Codeforces_Solutions/Fedor_and_New_Game.cpp new file mode 100644 index 0000000..b5a6d35 --- /dev/null +++ b/Codeforces_Solutions/Fedor_and_New_Game.cpp @@ -0,0 +1,35 @@ +#include +using namespace std; + +int bitdiff(int x,int y,int n){ + int ct=0; + int i=0; + while(i<=n){ + int a=x&1; + int b=y&1; + if(a!=b) ct++; + x=x>>1; + y=y>>1; + i++; + } + return ct; +} +int main(){ + int ct=0; + int n,m,k; + cin>>n>>m>>k; + int a[m+1]; + for(int i=0;i>a[i]; + } + for(int i=0;i +using namespace std; + +int main(){ + + int n,k; + cin>>n>>k; + string s; + cin>>s; + int hhh=223; + int ct=0; + for(int j=0;j +using namespace std; +int minS(long long int a,long long int b){ + if(a>b) return b; + else return a; +} +int main(){ + long long int n,m; + cin>>n>>m; + + + long long int d=n-(m-1)-1; + + long long int max=d*(d+1)/2; + +long long int a=n/m; +long long int b=n%m; + +long long int min=(a*(a+1)/2)*(n%m)+ ((a-1)*a/2)*(m-b); + +cout< +using namespace std; + +int main(){ + + long long int n,k; + cin>>n>>k; + long long int a[k]; + long long int c[k]; + for(long long int i=0;i>a[i]; + } + long long int sum=0; + for(long long int i=0;i