Tag: Codeforces Round #407 (Div. 2)

Codeforces Round #407 (Div. 2), problem: (E) The Great Mixing Solution in C

#include<bits/stdc++.h> using namespace std; int n,k,f; bitset<2001> dp; int main() { cin>>n>>k; for(int i=1,t;i<=k;i++) { scanf(“%d”,&t); f=1; } dp=1; int now=0; for(int i=1;i<=1000;i++) { now^=1; dp.reset(); for(int j=0;j<=1000;j++) if(f)dp|=(dp<<j)>>n; if(dp) { return 0*printf(“%dn”,i); } } puts(“-1”); return 0; }

Codeforces Round #407 (Div. 2), problem: (D) Weird journey Solution in C

#include<bits/stdc++.h> #define ll long long using namespace std; ll in; vector<int>adj; ll ans=0; bool g; int dfs(int cur) { g=true; int k,cnt=1; ...

Codeforces Round #407 (Div. 2), problem: (B) Masha and geometric depression Solution in C

#include <iostream> #include <map> using namespace std; map<long long, int> was; map<long long, int> bad; int main() { long long b, q, l,...

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!