Tag: Codeforces Round #425 (Div. 2)

Codeforces Round #425 (Div. 2), problem: (E) Vasya and Shifts Solution In C/C++

#include<bits/stdc++.h> #define oo 0x3f3f3f3f #define cl(x) memset(x, 0, sizeof(x)) #define mp make_pair #define fr first #define sc second #define pii pair<int, int> #define pb...

Codeforces Round #425 (Div. 2), problem: (D) Misha, Grisha and Underground Solution In C/C++

#include<cstdio> #include<iostream> using namespace std; struct Edge{ int to,next; }e; int head,cnt=0; void add(int u,int v) { cnt++; e.to=v; e.next=head; head=cnt; } int anc; int dep; void dfs(int x,int fa) { for(int i=head;i!=0;i=e.next) { int to=e.to; if(to!=fa) { dep=dep+1; anc=x; dfs(to,x); } } } int lca(int...

Codeforces Round #425 (Div. 2), problem: (C) Strange Radiation Solution In C/C++

#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using D = double; using uint =...

Codeforces Round #425 (Div. 2), problem: (B) Petya and Exam Solution In C/C++

#include<iostream> #include<cstdio> #include<cstring> using namespace std; string s,t; int q; string str; int w; bool g; int main() { cin>>s; for(int i=0;i<s.size();i++) { g-‘a’]=true; } cin>>t; int lt=t.size(); int s=0; w=-1; for(int i=0;i<lt;i++) { if(t==’*’)w=i;else s++; } scanf(“%d”,&q); while(q–) { cin>>str; int l=str.size(); if(l<s || (w==-1...

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!