Tag: Codeforces Round #419 (Div. 1)

Codeforces Round #419 (Div. 1), problem: (E) Karen and Neighborhood Solution In C/C++

#include <bits/stdc++.h> using namespace std; typedef pair<long long,long long> ii; long long n,k,i,w,res; long long m; map <long long,long long> num,f,c; long long...

Codeforces Round #419 (Div. 1), problem: (D) Karen and Cards Solution In C/C++

#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 500010; ll maxn,minn,sum; int n,p,q,r,tot=1,x,y,z; ll ret=0; vector<int> c; void update(int a,int...

Codeforces Round #419 (Div. 1), problem: (C) Karen and Supermarket Solution In C/C++

#include<cstdio> #include<algorithm> #include<queue> using namespace std; const int N=5010; int n,m,c,d,fa; int w,head,next; void add(int f,int t){ static int cnt=0; w=t; next=head; head=cnt; } int f,g,size; //f,g表示在子树i中买j件物品的最小代价 //其中g要求购买从根到i的物品 void dfs(int x){ for (int i=1;i<=n;i++)...

Codeforces Round #419 (Div. 1), problem: (B) Karen and Test Solution In C/C++

#include <cstdio> #include <iostream> #include <cstring> #include <cstdlib> using namespace std; #define ll long long const int N=200010; const ll M=1000000007ll; ll n,a,e,re; ll suan(ll x,ll...

Codeforces Round #419 (Div. 1), problem: (A) Karen and Game Solution In C/C++

#include <bits/stdc++.h> #define inf 0x3f3f3f3f #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef...

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!