# Codeforces Round #408 (Div. 2) Archive

## Codeforces Round #408 (Div. 2), problem: (F) Sequence Recovery Solution in C/C++

#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 5, inf = 1e9 + 7; int ma, lz, ma2, n; int vma; void build1(int id = 1, int l = 0, int r …

## Codeforces Round #408 (Div. 2), problem: (E) Exam Cheating Solution in C/C++

#include <stdio.h> #include <string.h> #include <stdbool.h> #include <assert.h> #define clr(ar) memset(ar, 0, sizeof(ar)) #define read() freopen(“lol.txt”, “r”, stdin) short dp; int n, p, k, A, B, C; int solve(int lim){ int i, j, p, x, …

## Codeforces Round #408 (Div. 2), problem: (D) Police Stations Solution in C

#include <iostream> #include <string> #include <vector> #include <map> #include <queue> #include <algorithm> #include <numeric> #include <climits> using namespace std; int main(int argc, char **argv) { ios_base::sync_with_stdio(false); cin.tie(0); int N, K, D; cin >> N >> …

## Codeforces Round #408 (Div. 2), problem: (C) Bank Hacking Solution in C

#include <limits.h> #include <stdio.h> #include <stdlib.h> #define N 300000 struct E { int i, j, a; } ee; int aa, ii; int compare1(const void *a, const void *b) { int *ia = (int *) a; …

## Codeforces Round #408 (Div. 2), problem: (B) Find The Bone Solution in C

#include <stdio.h> #define N 1000000 int main() { static int hole; int n, m, k, i, j; scanf(“%d%d%d”, &n, &m, &k); for (j = 0; j < m; j++) { scanf(“%d”, &i); i–; hole = …

## Codeforces Round #408 (Div. 2), problem: (A) Buying A House Solution in C

#include<stdio.h> #include<stdlib.h> #include<math.h> #define MAX 1000000009 int main() { int i,n,m,k,min=MAX,t,temp; scanf("%d %d %d",&n,&m,&k); for(i=1;i<=n;i++) { scanf("%d",&t); if(t>0 && t<=k) { temp=abs(m-i); if(temp<min) min=temp; } } printf("%d\n",(min*10)); return 0; }