Tag: Codeforces Round #408 (Div. 2)

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,...

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,...

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,...

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,...

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...

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("%dn",(min*10)); return 0; }

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!