Tag: CodeForces

Codeforces Round #421 (Div. 2), problem: (D) Mister B and PR Shifts Solution In C/C++

#include<stdio.h> #include<stdlib.h> #define LL long long int p, cur; int main(void) { LL ans, sum; int n, L, r, i, temp; scanf(“%d”, &n); sum = L...

Codeforces Round #427 (Div. 2), problem: (F) Roads in the Kingdom Solution In C/C++

#include <bits/stdc++.h> using namespace std; int n; int to, pre, cost, last, en; long long wxs; void addedge(int f, int t, int...

Codeforces Round #427 (Div. 2), problem: (E) The penguin’s game Solution In C/C++

#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=1010; int n,x,y,bit,ans; int cnta,cntb; int a,b; int ans1,ans2; int gao(int *a,int l,int r){ if (r-l+1==0) return 0; printf(“? %d...

Codeforces Round #427 (Div. 2), problem: (D) Palindromic characteristics Solution In C/C++

#include <stdio.h> #include <string.h> #define N 5000 int main() { static char cc; static int dp, kk; int n, i, j; scanf(“%s”, cc); n =...

Codeforces Round #427 (Div. 2), problem: (C) Star sky Solution In C/C++

#include<iostream> #include<cstdio> using namespace std; int a; int x,y,x1,y1,s; int main() { int n,q,c; int i,j,k; scanf(“%d%d%d”,&n,&q,&c); for(i=1;i<=n;i++) { scanf(“%d%d%d”,&x,&y,&s); for(j=0;j<=c;j++) a+=(s+j)%(c+1); } for(i=1;i<=100;i++) for(j=1;j<=100;j++) for(k=0;k<=c;k++) a+=a+a-a; for(i=1;i<=q;i++) { scanf(“%d%d%d%d%d”,&s,&x,&y,&x1,&y1); s%=(c+1); printf(“%dn”,a-a-a+a); } }

Codeforces Round #426 (Div. 1), problem: (E) Caramel Clouds Solution In C/C++

#include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <set> #include <utility> #include <vector> const int N = 300000; struct Sum { int add(int id, int value) { if...

Codeforces Round #426 (Div. 1), problem: (D) Red-Black Cobweb Solution In C/C++

#include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <algorithm> #define maxn 100005 #define mod 1000000007 #define ll long long using namespace std; ll ksm(ll a,...

Codeforces Round #426 (Div. 2), problem: (E) Ever-Hungry Krakozyabra Solution In C/C++

#include <stdio.h> #include <stdlib.h> #include <string.h> #define N 19 char strL, strR; int l, r, i, n, j, sum, k; int bufL =...

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!