buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; int main() { int x, n; cin >> x >> n; set<int> s; for (int i = 0; i < n; i++) { int a; cin >> a; s.insert(a); } int mindiff = 101; int result = -1; for (int i = 1; i <= 100; i++) { if (s.find(i) == s.end()) { int diff = abs(x - i); ...
#include <bits/stdc++.h> using namespace std; int main() { int x, n; cin >> x >> n; set<int> s; for (int i = 0; i < n; i++) { int a; cin >> a; s.insert(a); } int mindiff = 101; int result = -1; for (int i = 0; i <= 101; i++) { if (s.find(i) == s.end()) { int diff = abs(x - i); ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
137
X, N = list(map(int, input().split())) if N == 0: print(X) else: p = list(map(int, input().split())) nums = {i for i in range(1, 101)} nothings = nums - set(p) differences = {} for i in nothings: difference = abs(X - i) if difference in differences: differences[diffe...
X, N = list(map(int, input().split())) if N == 0: print(X) else: p = list(map(int, input().split())) nums = {i for i in range(0, 102)} nothings = nums - set(p) differences = {} for i in nothings: difference = abs(X - i) if difference in differences: differences[diffe...
[["-", 12, 689, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 689, 0, 659, 12, 652, 3, 4, 0, 612]]
5
133
import itertools,sys def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) X,N = LI() p = set(LI()) ans,distance = 0,float('INF') for x in range(101)[::-1]: if x in p: continue now_distance = abs(X-x) if now_distance<=distance: ans = x distance = now_distance print(an...
import itertools,sys def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) X,N = LI() p = set(LI()) ans,distance = 0,float('INF') for x in range(-202,202)[::-1]: if x in p: continue now_distance = abs(X-x) if now_distance<=distance: ans = x distance = now_distance pri...
[["-", 0, 7, 12, 206, 51, 652, 3, 4, 0, 612], ["+", 12, 206, 51, 652, 3, 4, 0, 664, 17, 33], ["+", 12, 206, 51, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 7, 12, 206, 51, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 206, 51, 652, 3, 4, 0, 612]]
5
103
#include <bits/stdc++.h> #include <iostream> using namespace std; using ll = long long; int main() { int x, n; cin >> x >> n; set<int> p; for (int i = 0; i < n; i++) { int temp; cin >> temp; p.insert(temp); } int ans = INT_MAX; int v; for (int i = 0; i <= 100; i++) { if (!p.count(i)) { ...
#include <bits/stdc++.h> #include <iostream> using namespace std; using ll = long long; int main() { int x, n; cin >> x >> n; set<int> p; for (int i = 0; i < n; i++) { int temp; cin >> temp; p.insert(temp); } int ans = INT_MAX; int v; for (int i = 0; i <= 101; i++) { if (!p.count(i)) { ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
157
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; typedef long long ll; signed main(void) { int x, n, ans, mn; cin >> x >> n; vector<int> p(n); rep(i, n) cin >> p[i]; ans = mn = 1e9; sort(p.begin(), p.end()); for (int i = 1; i <= 100; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; typedef long long ll; signed main(void) { int x, n, ans, mn; cin >> x >> n; vector<int> p(n); rep(i, n) cin >> p[i]; ans = mn = 1e9; sort(p.begin(), p.end()); for (int i = -1000; i <= 1...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
190
x,n=map(int,input().split(" ")) if n==0: print(x) else: line=list(map(int,input().split(" "))) a=0 b=1 while a==0: if x-b not in line: min=x-b a=1 elif x+b not in line: min=x+b a=1 else: b=b+1 print(min)
x,n=map(int,input().split(" ")) if n==0: print(x) else: line=list(map(int,input().split(" "))) a=0 b=0 while a==0: if x-b not in line: min=x-b a=1 elif x+b not in line: min=x+b a=1 else: b=b+1 print(min)
[["-", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
104
// ----- In the name of ALLAH, the Most Gracious, the Most Merciful ----- #include <bits/stdc++.h> using namespace std; #define NINJA \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
// ----- In the name of ALLAH, the Most Gracious, the Most Merciful ----- #include <bits/stdc++.h> using namespace std; #define NINJA \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
213
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n + 1); ++i) const double PI = 3.141592653589793238463; using namespace std; using ll = long long; const ll INF = +10010010000; typedef pair<int, int> P; const int mod = 1e9 + 7; stru...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n + 1); ++i) const double PI = 3.141592653589793238463; using namespace std; using ll = long long; const ll INF = +10010010000; typedef pair<int, int> P; const int mod = 1e9 + 7; stru...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
609
#include <bits/stdc++.h> #define ll long long #define fl(i, n) for (i = 0; i < n; i++) #define fld(i, a, b) for (i = a; i > b; i--) #define fli(i, a, n) for (i = a; i < n; i++) #define pb push_back #define mp make_pair #define F first #define S second #define mod 998244353 #define all(x) x.begin(), x.end() #define spee...
#include <bits/stdc++.h> #define ll long long #define fl(i, n) for (i = 0; i < n; i++) #define fld(i, a, b) for (i = a; i > b; i--) #define fli(i, a, n) for (i = a; i < n; i++) #define pb push_back #define mp make_pair #define F first #define S second #define mod 998244353 #define all(x) x.begin(), x.end() #define spee...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
212
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; #define rep(i, n) for (int i = 0; i < (n); ++...
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; #define rep(i, n) for (int i = 0; i < (n); ++...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
212
#include <stdio.h> int x, n, a, m, t; int p[102]; int main() { scanf("%d%d", &x, &n); m = x; for (int i = 0; i < n; i++) { scanf("%d", &a); p[a] = 1; } for (int i = 0; i < 102; i++) { if (p[i] == 0) { t = x - i; if (t < 0) t = -t; if (m > t) { m = t; a = i...
#include <stdio.h> int x, n, a, m, t; int p[102]; int main() { scanf("%d%d", &x, &n); m = x; for (int i = 0; i < n; i++) { scanf("%d", &a); p[a] = 1; } a = 0; for (int i = 0; i < 102; i++) { if (p[i] == 0) { t = x - i; if (t < 0) t = -t; if (m > t) { m = t; ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
145
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; int main() { int X, N; cin >> X >> N; vector<int> p(N); for (int i = 0; i < N; i++) cin >> p.at(i); int ans = 100, min_dist = 101; for (int i = 0; i < 101; i++) { bool flag =...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; int main() { int X, N; cin >> X >> N; vector<int> p(N); for (int i = 0; i < N; i++) cin >> p.at(i); int ans = 101, min_dist = 101; for (int i = -1; i <= 101; i++) { bool flag...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
197
#include <bits/stdc++.h> #define itn int #define REP(i, n) for (ll i = 0; i < n; i++) #define IREP(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i < b + 1; i++) #define all(v) v.begin(), v.end() #define SENTINEL 2000000000 #define NIL -1 using namespace std; typedef long long ll; const ll M...
#include <bits/stdc++.h> #define itn int #define REP(i, n) for (ll i = 0; i < n; i++) #define IREP(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i < b + 1; i++) #define all(v) v.begin(), v.end() #define SENTINEL 2000000000 #define NIL -1 using namespace std; typedef long long ll; const ll M...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
257
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "../debug.h" #else #define debug(x...) 141 #endif #define forn(i, x, n) for (int i = x; i < n; ++i) #define forit(it, m) for (auto it = m.begin(); it != m.end(); ++it) typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); int ...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "../debug.h" #else #define debug(x...) 141 #endif #define forn(i, x, n) for (int i = x; i < n; ++i) #define forit(it, m) for (auto it = m.begin(); it != m.end(); ++it) typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); int ...
[["-", 64, 9, 0, 1, 0, 16, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33]]
1
192
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define reps(i, a, b) for (int i = a; i < b; ++i) #define fi first #define se second #define pb push_back #define eb emplace_back #define sz(x) (int)(x).s...
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define reps(i, a, b) for (int i = a; i < b; ++i) #define fi first #define se second #define pb push_back #define eb emplace_back #define sz(x) (int)(x).s...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
467
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair #define endl '\n' #define fi first #define se secon...
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair #define endl '\n' #define fi first #define se secon...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
196
/************************************ / AUTHOR : YATHARTH GOSWAMI / / ALIAS : hacker_yg / / INSTITUTE : IIT Kanpur / ************************************/ // TEMPLATE // #include <bits/stdc++.h> #define ll long long #define MOD 1000000007 #define pb push_back...
/************************************ / AUTHOR : YATHARTH GOSWAMI / / ALIAS : hacker_yg / / INSTITUTE : IIT Kanpur / ************************************/ // TEMPLATE // #include <bits/stdc++.h> #define ll long long #define MOD 1000000007 #define pb push_back...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
176
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rng(i, a, b) for (int i = int(a); i < int(b); i++) #define rep(i, b) rng(i, 0, b) #define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--) #define per(i, b) gnr(i, 0, b) #define bg begin() #define ed end() #define rbg rbegin() #define red rend() #define all...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rng(i, a, b) for (int i = int(a); i < int(b); i++) #define rep(i, b) rng(i, 0, b) #define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--) #define per(i, b) gnr(i, 0, b) #define bg begin() #define ed end() #define rbg rbegin() #define red rend() #define all...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
465
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; int main() { int x, n; cin >> x >> n; set<int> a; if (n == 0) { cout << x << endl; return 0; } for (int i = 0; i < n; i++) { int d; cin >> d; a.insert(d); } for (int i = 1; i <= 100; i++) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; int main() { int x, n; cin >> x >> n; set<int> a; if (n == 0) { cout << x << endl; return 0; } for (int i = 0; i < n; i++) { int d; cin >> d; a.insert(d); } for (int i = 0; i <= 100; i++) { ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
168
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (n); ++i) using ll = int_fast64_t; using pll = pair<ll, ll>; constexpr ll INF = 1LL << 60; constexpr ll MOD = 1e9 + 7; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (n); ++i) using ll = int_fast64_t; using pll = pair<ll, ll>; constexpr ll INF = 1LL << 60; constexpr ll MOD = 1e9 + 7; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
574
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++) #define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++) #define rrep(i, n) for (ll i = (n)-1; i >= 0; i--) #define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--) #defin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++) #define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++) #define rrep(i, n) for (ll i = (n)-1; i >= 0; i--) #define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--) #defin...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
219
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef u...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef u...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
273
x, n = gets.split.map(&:to_i) if n == 0 p x exit end ps = gets.split.map(&:to_i) qs = [*1..100] - ps mn = -1 mv = 1000000000 qs.each do |q| if (q - x).abs < mv mn = q mv = (q - x).abs end end p mn
x, n = gets.split.map(&:to_i) if n == 0 p x exit end ps = gets.split.map(&:to_i) qs = [*(-200)..200] - ps mn = -1 mv = 1000000000 qs.each do |q| if (q - x).abs < mv mn = q mv = (q - x).abs end end p mn
[["-", 12, 738, 31, 516, 0, 741, 0, 475, 756, 612], ["+", 31, 516, 0, 741, 0, 475, 756, 739, 0, 24], ["+", 0, 741, 0, 475, 756, 739, 0, 748, 17, 33], ["+", 0, 741, 0, 475, 756, 739, 0, 748, 439, 612], ["+", 31, 516, 0, 741, 0, 475, 756, 739, 0, 25], ["-", 12, 738, 31, 516, 0, 741, 0, 475, 444, 612], ["+", 12, 738, 31, ...
4
82
#include <algorithm> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define pb push_back #define ll long long #define ld long double #define f first #define s second using namespace std; const int N = 1e5 + 5; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define pb push_back #define ll long long #define ld long double #define f first #define s second using namespace std; const int N = 1e5 + 5; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 15, 339, 51, 2, 3, 4, 0, 16, 17, 72], ["+", 15, 339, 51, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 57, 64, 1, 0, 16, 12, 16, 17, 33], ["+", 0, 57, 64, ...
1
186
/* これを入れて実行 g++ code.cpp ./a.out */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include ...
/* これを入れて実行 g++ code.cpp ./a.out */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
567
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define pi pair<int, int> #define ff first #define ss second #define boost \ ios::sync_with_stdio(false); \ cin.tie(nullptr) #include "stri...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define pi pair<int, int> #define ff first #define ss second #define boost \ ios::sync_with_stdio(false); \ cin.tie(nullptr) #include "stri...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
174
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 1e9; int n, res, x, t, ans; int main() { cin >> x >> n; vector<int> vec(n, 0); set<int> s; for (int i = 0; i <= 100; ++i) { s.insert(i); } for (int i = 0; i < n; ++i) { cin >> vec[i]; if (s.count(vec[i])) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 1e9; int n, res, x, t, ans; int main() { cin >> x >> n; vector<int> vec(n, 0); set<int> s; for (int i = 0; i <= 101; ++i) { s.insert(i); } for (int i = 0; i < n; ++i) { cin >> vec[i]; if (s.count(vec[i])) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
173
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cfloat> #include <chrono> #include <climits> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstre...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cfloat> #include <chrono> #include <climits> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstre...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 48], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
584
/* ID: wangjun30 LANG: C++11 TASK: */ #include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include ...
/* ID: wangjun30 LANG: C++11 TASK: */ #include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include ...
[["-", 51, 91, 28, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 91, 28, 69, 341, 342, 0, 16, 17, 33], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33], ["-", 51, 91, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 91, 28, 69, 341, 342, 0, 16, 17, 72], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33]...
1
182
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18; const int inf = 1e9; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, b, a) for (int i = a - 1; i >= b; i--) using Graph = vector<vector<int>>; using pint = pair<int, int>; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18; const int inf = 1e9; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, b, a) for (int i = a - 1; i >= b; i--) using Graph = vector<vector<int>>; using pint = pair<int, int>; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
272
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~= *$* WRITER:kakitamasziru/OxOmisosiru *$* ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/ #ifdef LOCAL_JUDGE #define _GLIBCXX_DEBUG // FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING! #endif #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <cstdin...
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~= *$* WRITER:kakitamasziru/OxOmisosiru *$* ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/ #ifdef LOCAL_JUDGE #define _GLIBCXX_DEBUG // FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING! #endif #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <cstdin...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
456
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**8) from bisect import bisect_left INF = float("inf") def main(): X, N = map(int, input().split()) if N > 0: p = set(map(int, input().split())) else: p = set() ans = INF for n in range(100+1): if n in p: ...
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**8) from bisect import bisect_left INF = float("inf") def main(): X, N = map(int, input().split()) if N > 0: p = set(map(int, input().split())) else: p = set() ans = INF for n in range(110): if n in p: ...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 612], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
125
from sys import stdin from collections import defaultdict as dd from collections import deque as dq import itertools as it from math import sqrt, log, log2 from fractions import Fraction x, n = map(int, input().split()) if n!=0: nums = set(map(int, stdin.readline().split())) if n == 0: print(x) exit() ans = ...
from sys import stdin from collections import defaultdict as dd from collections import deque as dq import itertools as it from math import sqrt, log, log2 from fractions import Fraction x, n = map(int, input().split()) if n!=0: nums = set(map(int, stdin.readline().split())) if n == 0: print(x) exit() ans = ...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
159
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; struct __INIT { __INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } __init; #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) // constexpr int MOD=1000000007; ...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; struct __INIT { __INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } __init; #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) // constexpr int MOD=1000000007; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
355
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 def main(): X, N, *P = map(int, read().split()) P = set(P) Q = [i for i in range(1, 101) if i not in P] Q.sort() error = INF for q in Q: if abs(X...
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 def main(): X, N, *P = map(int, read().split()) P = set(P) Q = [i for i in range(-10, 110) if i not in P] Q.sort() error = INF for q in Q: if abs...
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 0, 659, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 659, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612]]
5
134
// Problem : C - Forbidden List // Contest : AtCoder - AtCoder Beginner Contest 170 // URL : https://atcoder.jp/contests/abc170/tasks/abc170_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <iostream> using namespace std; int t[105]; int main(...
// Problem : C - Forbidden List // Contest : AtCoder - AtCoder Beginner Contest 170 // URL : https://atcoder.jp/contests/abc170/tasks/abc170_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <iostream> using namespace std; int t[205]; int main(...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8,...
1
128
#include <bits/stdc++.h> #define ls rt << 1 #define rs rt << 1 | 1 #define lson rt << 1, l, M #define rson rt << 1 | 1, M + 1, r #define PI acos(-1) #define MM int M = (l + r) >> 1; #define fu(i, r, t) for (int i = r; i <= t; i++) #define fd(i, r, t) for (int i = r; i >= t; i--) #define fh(i, be, e) for (int i = head[b...
#include <bits/stdc++.h> #define ls rt << 1 #define rs rt << 1 | 1 #define lson rt << 1, l, M #define rson rt << 1 | 1, M + 1, r #define PI acos(-1) #define MM int M = (l + r) >> 1; #define fu(i, r, t) for (int i = r; i <= t; i++) #define fd(i, r, t) for (int i = r; i >= t; i--) #define fh(i, be, e) for (int i = head[b...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
404
#include <cmath> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int X, N; cin >> X >> N; int p[N]; for (int i = 0; i < N; ++i) cin >> p[i]; int ret = 0; int min_diff = 1000000; for (int i = -1; i < 100 + 1; ++i) { bool found = false; for (int j = 0; j < N; ++j)...
#include <cmath> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int X, N; cin >> X >> N; int p[N]; for (int i = 0; i < N; ++i) cin >> p[i]; int ret = 0; int min_diff = 1000000; for (int i = -1; i < 100 + 2; ++i) { bool found = false; for (int j = 0; j < N; ++j)...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
161
#include <bits/stdc++.h> using namespace std; #define int long long // 禁忌 using ll = long long; using lld = long double; #define P pair<ll, ll> #define Vi vector<ll> #define VVi vector<vector<ll>> #define Vd vector<double> #define Vb vector<bool> #define Vs vector<string> #define Vc vector<char> #define M map<ll, ll> ...
#include <bits/stdc++.h> using namespace std; #define int long long // 禁忌 using ll = long long; using lld = long double; #define P pair<ll, ll> #define Vi vector<ll> #define VVi vector<vector<ll>> #define Vd vector<double> #define Vb vector<bool> #define Vs vector<string> #define Vc vector<char> #define M map<ll, ll> ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
2,756
#include <bits/stdc++.h> using namespace std; #define sws \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define INFINITO...
#include <bits/stdc++.h> using namespace std; #define sws \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define INFINITO...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
152
#include <bits/stdc++.h> using namespace std; #define int long long #define fast() \ ios_base ::sync_with_stdio(0); \ cin.tie(0); \ cout....
#include <bits/stdc++.h> using namespace std; #define int long long #define fast() \ ios_base ::sync_with_stdio(0); \ cin.tie(0); \ cout....
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
197
X, N = map(int, input().split()) if N == 0: print(X) exit() P = list(map(int, input().split())) ans = float('inf') for i in range(101): if i in P: continue if abs(ans - X) > abs(i - X): ans = i print(ans)
X, N = map(int, input().split()) if N == 0: print(X) exit() P = list(map(int, input().split())) ans = float('inf') for i in range(102): if i in P: continue if abs(ans - X) > abs(i - X): ans = i print(ans)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
89
#include <algorithm> #include <assert.h> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #includ...
#include <algorithm> #include <assert.h> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #includ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
256
X, N = map(int, input().split()) if N == 0: print(X) else: *p, = map(int, input().split()) ans = -1 d = 10**10 for i in range(-100, 101): if i in p: continue m = abs(i-X) if m < d: d = m ans = i print(ans)
X, N = map(int, input().split()) if N == 0: print(X) else: *p, = map(int, input().split()) ans = -1 d = 10**10 for i in range(-101, 102): if i in p: continue m = abs(i-X) if m < d: d = m ans = i print(ans)
[["-", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
92
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define ll long long #define ull unsigned long long using namespace std; int main() { int X, N; cin >> X >> N; vector<int> p(N); for (int ii = 0; ii < N; ++ii) { cin >> p[ii]; } sort(p.begin(), p.end()); int ans = 0; int dif = abs(X - ans)...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define ll long long #define ull unsigned long long using namespace std; int main() { int X, N; cin >> X >> N; vector<int> p(N); for (int ii = 0; ii < N; ++ii) { cin >> p[ii]; } sort(p.begin(), p.end()); int ans = 0; int dif = abs(X - ans)...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
190
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define printV(v) \ for (int i = 0; i < v.size(); i++) { \ cout << v[i] << " "; ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define printV(v) \ for (int i = 0; i < v.size(); i++) { \ cout << v[i] << " "; ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
400
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <numeric> #include <queue> #include <regex> #include <set> #include <sstream> #include <stack> #include <...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <numeric> #include <queue> #include <regex> #include <set> #include <sstream> #include <stack> #include <...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
300
#include <bits/stdc++.h> using namespace std; int n, x, p; set<int> s; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> x >> n; for (int i = 0; i < n; i++) { cin >> p; s.insert(p); } int ans = 1e9; for (int i = -100; i <= 100; i++) { if (s.count(i)) { ...
#include <bits/stdc++.h> using namespace std; int n, x, p; set<int> s; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> x >> n; for (int i = 0; i < n; i++) { cin >> p; s.insert(p); } int ans = 1e9; for (int i = -1000; i <= 1000; i++) { if (s.count(i)) { ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
146
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; const ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define DEBUG(x) std:...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; const ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define DEBUG(x) std:...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
214
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define ll long long const int mod = 1000000007; const ll INF = 1000000000000000000; bool b[110]; int...
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define ll long long const int mod = 1000000007; const ll INF = 1000000000000000000; bool b[110]; int...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
199
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef...
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
500
x, n = gets.split.map(&:to_i) if n == 0 p = gets puts x exit end p = gets.split.map(&:to_i) min = 100 cand = 100 0.upto(100) do |pp| next if p.include?(pp) diff = (x - pp).abs if diff < min min = diff cand = pp end end puts cand
x, n = gets.split.map(&:to_i) if n == 0 p = gets puts x exit end p = gets.split.map(&:to_i) min = 100 cand = 100 0.upto(200) do |pp| next if p.include?(pp) diff = (x - pp).abs if diff < min min = diff cand = pp end end puts cand
[["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 612], ["+", 36, 36, 0, 493, 0, 652, 3, 4, 0, 612]]
4
82
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define all(x) (x).begin(), (x).end() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> bool ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define all(x) (x).begin(), (x).end() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> bool ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
218
# -*- coding: utf-8 -*- import sys import math import os import itertools import string import heapq import _collections from collections import Counter from collections import defaultdict from functools import lru_cache import bisect import re import queue import decimal class Scanner(): @staticmethod def in...
# -*- coding: utf-8 -*- import sys import math import os import itertools import string import heapq import _collections from collections import Counter from collections import defaultdict from functools import lru_cache import bisect import re import queue import decimal class Scanner(): @staticmethod def in...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]]
5
668
#include <bits/stdc++.h> /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/ #define itn int #define all(c) c.begin(), c.end() #define make_uni...
#include <bits/stdc++.h> /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/ #define itn int #define all(c) c.begin(), c.end() #define make_uni...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
316
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int X, N; cin >> X >> N; set<int> s; for (int i = 0; i < N; i++) { int val; cin >> val; s.insert(val); } int best = 999, ans; for (int i = 1; i <= 300; i++)...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int X, N; cin >> X >> N; set<int> s; for (int i = 0; i < N; i++) { int val; cin >> val; s.insert(val); } int best = 999, ans; for (int i = -500; i <= 500; i...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
148
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement from operator import itemgetter, mul from copy import deepcopy from s...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement from operator import itemgetter, mul from copy import deepcopy from s...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
260
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define int long long #define double long double typedef vector<int> VI; typedef pair<int, int> pii; typedef vector<pi...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define int long long #define double long double typedef vector<int> VI; typedef pair<int, int> pii; typedef vector<pi...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
364
#include <bits/stdc++.h> const long long INF = 1LL << 60; const long long MOD = 1000000007; const double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n - 1); i >= 0; --i) #define perm(c) ...
#include <bits/stdc++.h> const long long INF = 1LL << 60; const long long MOD = 1000000007; const double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n - 1); i >= 0; --i) #define perm(c) ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
1,159
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def main(): X, N = [int(i) for i in input().strip().split()] p_list = [int(i) for i in input().strip().split()] base = list() for i in range(1, 101): if i not in p_list: base.append(i) dif = float("inf") ...
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def main(): X, N = [int(i) for i in input().strip().split()] p_list = [int(i) for i in input().strip().split()] base = list() for i in range(-110, 110): if i not in p_list: base.append(i) dif = float("inf")...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
140
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int n, x, ans = 20000; bool b[1001] = {}; int main() { ios::sync_with_stdio(false); cin >> x >> n; int i, y; for (i = 1; i <= n; ++i) { cin >> y; b[y] = 1; } for (i = 1; i <= 100; ++i) if (!b[i]) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int n, x, ans = 20000; bool b[1001] = {}; int main() { ios::sync_with_stdio(false); cin >> x >> n; int i, y; for (i = 1; i <= n; ++i) { cin >> y; b[y] = 1; } for (i = 0; i <= 101; ++i) if (!b[i]) ...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
135
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
[["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 48], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 12, 13]]
1
350
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define eb emplace_back #define mt make_tuple #define all(x) (x).begin(), (x).end() #define MOD 1000000007 typedef long long ll; typedef pair<int, int> ii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vll; typede...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define eb emplace_back #define mt make_tuple #define all(x) (x).begin(), (x).end() #define MOD 1000000007 typedef long long ll; typedef pair<int, int> ii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vll; typede...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
262
x,n=map(int,input().split()) if n==0: print(x) exit() P=set(list(map(int,input().split()))) diff= 1000 ans = 0 for i in range(101): if i in P: continue if abs(x-i)<diff: diff = abs(x-i) #print(diff,i) ans = i print(ans)
x,n=map(int,input().split()) if n==0: print(x) exit() P=set(list(map(int,input().split()))) diff= 1000 ans = 0 for i in range(102): if i in P: continue if abs(x-i)<diff: diff = abs(x-i) #print(diff,i) ans = i print(ans)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
94
x,n = map(int,input().split()) if n != 0: P = list(map(int,input().split())) else: P = [] tmp = 999 ans = 0 for i in range(-1,101): if tmp > abs(x-i): if not i in P: tmp = abs(x-i) ans = i print(ans)
x,n = map(int,input().split()) if n != 0: P = list(map(int,input().split())) else: P = [] tmp = 999 ans = 0 for i in range(-1,102): if tmp > abs(x-i): if not i in P: tmp = abs(x-i) ans = i print(ans)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
92
#include "bits/stdc++.h" #define REP(i, num) for (ll i = 0; i < (num); ++i) #define FOR(i, c, num) for (ll(i) = (c); (i) < (num); ++(i)) #define LOOP(i) while (i--) #define ALL(c) c.begin(), c.end() #define PRINTALL(c) \ for (auto pitr = c.begin(); pitr != c...
#include "bits/stdc++.h" #define REP(i, num) for (ll i = 0; i < (num); ++i) #define FOR(i, c, num) for (ll(i) = (c); (i) < (num); ++(i)) #define LOOP(i) while (i--) #define ALL(c) c.begin(), c.end() #define PRINTALL(c) \ for (auto pitr = c.begin(); pitr != c...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
483
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define REPR(i, n) for (ll i = (ll)n - 1; i >= 0; i--) #define FOR(i, m, n) for (ll i = (ll)m; i < (ll)n; i++) #define FORR(i, m, n) for (ll i = (ll)m - 1; i >= (ll)n; i--) #define ALL(x) (x).begin(), (x...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define REPR(i, n) for (ll i = (ll)n - 1; i >= 0; i--) #define FOR(i, m, n) for (ll i = (ll)m; i < (ll)n; i++) #define FORR(i, m, n) for (ll i = (ll)m - 1; i >= (ll)n; i--) #define ALL(x) (x).begin(), (x...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
510
x,n = map(int,input().split()) if n > 0: a = list(map(int,input().split())) else: a = [] a = set(a) ans = x for i in range(100): if not x+i in a: print(x+i) break if not x-i in a: print(x+i) break
x,n = map(int,input().split()) if n > 0: a = list(map(int,input().split())) else: a = [] a = set(a) ans = x for i in range(100): if not x-i in a: print(x-i) break if not x+i in a: print(x+i) break
[["-", 0, 57, 15, 681, 28, 666, 0, 657, 17, 72], ["+", 0, 57, 15, 681, 28, 666, 0, 657, 17, 33], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 57, 15, 681, 28, 666, 0, 657, 17, 33], ["+", 0, 57, 15, 681, 28, 666, 0, 657, 17, 72]]
5
91
#include <bits/stdc++.h> using namespace std; #define int long long #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pb push_back #define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define Test \ int T; ...
#include <bits/stdc++.h> using namespace std; #define int long long #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pb push_back #define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define Test \ int T; ...
[["-", 0, 57, 64, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68]]
1
426
//#pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <reg...
//#pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <reg...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
4,933
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (ll i = a; i < b; i++) #define REP(i, b) FOR(i, 0, b) #define RFOR(i, a, b) for (ll i = a - 1; i >= b; i--) #define RREP(i, a) RFOR(i, a, 0) #define REPALL(i, x) for (ll i = 0; i < x.size(); i++) #define RREPALL(i, x) for (ll i = x.size() - 1; i >= ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (ll i = a; i < b; i++) #define REP(i, b) FOR(i, 0, b) #define RFOR(i, a, b) for (ll i = a - 1; i >= b; i--) #define RREP(i, a) RFOR(i, a, 0) #define REPALL(i, x) for (ll i = 0; i < x.size(); i++) #define RREPALL(i, x) for (ll i = x.size() - 1; i >= ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
425
x,n=map(int,input().split()) if n==0: print(x) else: a=list(map(int,input().split())) tmp=1000 for i in reversed(range(-1,102)): if i not in a: if tmp > abs(i-x): tmp=abs(i-x) ans=i print(ans)
x,n=map(int,input().split()) if n==0: print(x) else: a=list(map(int,input().split())) tmp=1000 for i in reversed(range(-1,102)): if i not in a: if tmp >= abs(i-x): tmp=abs(i-x) ans=i print(ans)
[["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 20]]
5
92
#include <algorithm> #include <assert.h> #include <cmath> #include <deque> #include <float.h> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #incl...
#include <algorithm> #include <assert.h> #include <cmath> #include <deque> #include <float.h> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #incl...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
3,055
#include <bits/stdc++.h> using namespace std; int main() { int x, n; cin >> x >> n; x += 100; int p[400] = {}; for (int i = 0; i < n; i++) { int y; cin >> y; p[y + 200] = 1; } int i = 0; while (true) { if (p[x - i] == 0) { cout << x - i - 200 << endl; break; } if (p[...
#include <bits/stdc++.h> using namespace std; int main() { int x, n; cin >> x >> n; x += 200; int p[400] = {}; for (int i = 0; i < n; i++) { int y; cin >> y; p[y + 200] = 1; } int i = 0; while (true) { if (p[x - i] == 0) { cout << x - i - 200 << endl; break; } if (p[...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
135
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back using namespace std; long long n, x, arr[105], kcl; bool ada[105]; int main() { cin >> x >> n; for (int i = 1; i <= n; i++) { cin >> arr[i]; ada[arr[i]] = 1; } kcl = 1e9; if (!ada[x]) { kcl = x; } for (int i = 1...
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back using namespace std; long long n, x, arr[105], kcl; bool ada[105]; int main() { cin >> x >> n; for (int i = 1; i <= n; i++) { cin >> arr[i]; ada[arr[i]] = 1; } kcl = 1e9; if (!ada[x]) { kcl = x; } for (int i = 1...
[["-", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33]]
1
301
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { int x, n; cin >> x >> n; vector<int> a(n)...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { int x, n; cin >> x >> n; vector<int> a(n)...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
266
/* LANG:C++ PROB: */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #include <iostream> #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x)...
/* LANG:C++ PROB: */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #include <iostream> #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x)...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
475
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int x, n; cin >> x >> n; if (n == 0) { cout << 0; return 0; } vector<int> p(n); for (int i = 0; i < n; i++) cin >> p[i]; sort(p.begin(), p.end()); int idx = 0; int ans = 0; for (int i = 0; i <= 101; i++) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int x, n; cin >> x >> n; if (n == 0) { cout << x; return 0; } vector<int> p(n); for (int i = 0; i < n; i++) cin >> p[i]; sort(p.begin(), p.end()); int idx = 0; int ans = 0; for (int i = 0; i <= 101; i++) ...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]]
1
155
import sys X, N = map(int, input().split()) P = list(map(int, sys.stdin.readline().rsplit())) m = 1000 for i in range(101): if i in P: continue if abs(X - i) < m: m = abs(X - i) res = i else: break print(res)
import sys X, N = map(int, input().split()) P = list(map(int, sys.stdin.readline().rsplit())) m = 1000 for i in range(102): if i in P: continue if abs(X - i) < m: m = abs(X - i) res = i else: break print(res)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
84
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Kein Yukiyoshi */ #include "bits/stdc++.h" #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define FOR(i, a) for (auto &i : a) #...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Kein Yukiyoshi */ #include "bits/stdc++.h" #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define FOR(i, a) for (auto &i : a) #...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
464
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define MAX 1000000 #define MOD 1000000001 #define fast \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define MAX 1000000 #define MOD 1000000001 #define fast \ ios::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33]]
1
234
#include <bits/stdc++.h> #define int long long using namespace std; int k, n, minv = 1e9 + 7, pos; int a[100005], v[100005]; signed main() { cin >> k >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; v[a[i]] = 1; } for (int i = 1; i <= 10000; i++) { if (v[i] == 1) continue; if (abs(i - ...
#include <bits/stdc++.h> #define int long long using namespace std; int k, n, minv = 1e9 + 7, pos; int a[100005], v[100005]; signed main() { cin >> k >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; v[a[i]] = 1; } for (int i = 0; i <= 10000; i++) { if (v[i] == 1) continue; if (abs(i - ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
164
#include <algorithm> #include <climits> #include <cmath> #include <functional> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <unordered_set> #include <vector> using namespace std...
#include <algorithm> #include <climits> #include <cmath> #include <functional> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <unordered_set> #include <vector> using namespace std...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
207
#include <bits/stdc++.h> using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( \ c i) { sim > ...
#include <bits/stdc++.h> using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( \ c i) { sim > ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
518
#include <bits/stdc++.h> #define ll long long #define MODV 1000000007 #define INFLL LLONG_MAX // 9223372036854775807 #define EPS 1e-9 #define rep(i, n) for (ll i = 0, i##_len = (ll)(n); i < i##_len; i++) #define repf(i, n) for (ll i = 1, i##_len = (ll)(n + 1); i < i##_len; i++) #define all(v) v.begin(), v.end() #define...
#include <bits/stdc++.h> #define ll long long #define MODV 1000000007 #define INFLL LLONG_MAX // 9223372036854775807 #define EPS 1e-9 #define rep(i, n) for (ll i = 0, i##_len = (ll)(n); i < i##_len; i++) #define repf(i, n) for (ll i = 1, i##_len = (ll)(n + 1); i < i##_len; i++) #define all(v) v.begin(), v.end() #define...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
270
#include <bits/stdc++.h> #include <cstdint> #include <vector> #define FOR(i, l, r) for (int i = (l); i < (r); ++i) #define RFOR(i, l, r) for (int i = (l); i >= (int)(r); i--) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) RFOR(i, n - 1, 0) using namespace std; const int MX = 1e6; const int inf = 1e9; // const int m...
#include <bits/stdc++.h> #include <cstdint> #include <vector> #define FOR(i, l, r) for (int i = (l); i < (r); ++i) #define RFOR(i, l, r) for (int i = (l); i >= (int)(r); i--) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) RFOR(i, n - 1, 0) using namespace std; const int MX = 1e6; const int inf = 1e9; // const int m...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
180
#include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #...
#include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72]]
1
496
#include <bits/stdc++.h> using namespace std; #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #define flash \ ios_base::sync_with_stdio(false); \ cin.tie(0);...
#include <bits/stdc++.h> using namespace std; #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #define flash \ ios_base::sync_with_stdio(false); \ cin.tie(0);...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
314
#include <bits/stdc++.h> #define st first #define nd second #define ll long long #define ld long double #define pb push_back #define emp emplace_back #define pii pair<int, int> #define usg unsigned #define sg signed #define mp make_pair using namespace std; void setIO() { ios::sync_with_stdio(0); cin.tie(0); c...
#include <bits/stdc++.h> #define st first #define nd second #define ll long long #define ld long double #define pb push_back #define emp emplace_back #define pii pair<int, int> #define usg unsigned #define sg signed #define mp make_pair using namespace std; void setIO() { ios::sync_with_stdio(0); cin.tie(0); c...
[["-", 8, 9, 0, 57, 15, 339, 51, 91, 28, 22], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 22], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, ...
1
225
#include <algorithm> #include <cassert> #include <chrono> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #in...
#include <algorithm> #include <cassert> #include <chrono> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #in...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
2,154
def main(): import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline X, N = map(int, input().split()) if N == 0: print(X) return P = list(map(int, input().split())) check = 1 while True: if not X-check in P: print(X-check) retur...
def main(): import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline X, N = map(int, input().split()) if N == 0: print(X) return P = list(map(int, input().split())) check = 0 while True: if not X-check in P: print(X-check) retur...
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612]]
5
107
""" Arnab Chanda """ from collections import defaultdict, deque from itertools import permutations from sys import stdin,stdout from bisect import bisect_left, bisect_right from copy import deepcopy import heapq int_input=lambda : int(stdin.readline()) string_input=lambda : stdin.readline().split() multi_int_in...
""" Arnab Chanda """ from collections import defaultdict, deque from itertools import permutations from sys import stdin,stdout from bisect import bisect_left, bisect_right from copy import deepcopy import heapq int_input=lambda : int(stdin.readline()) string_input=lambda : stdin.readline().split() multi_int_in...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72]]
5
193
inf = float('inf') def resolve(): x, n = map(int, input().split()) if n == 0: print(x) return p = list(map(int, input().split())) ans = 0 score = inf for i in range(101): tmp = abs(x - i) if score > tmp and i not in p: ans = i score = tm...
inf = float('inf') def resolve(): x, n = map(int, input().split()) if n == 0: print(x) return p = list(map(int, input().split())) ans = inf score = inf for i in range(-1, 102): tmp = abs(x - i) if score > tmp and i not in p: ans = i scor...
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 12, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
108
#include <cstdio> using namespace std; int x, n; bool used[105]; int main() { scanf("%d%d", &x, &n); for (int i = 0; i < n; i++) { int p; scanf("%d", &p); used[p] = true; } for (int i = 0; i < 100; i++) { if (used[x - i]) { printf("%d\n", x - i); return 0; } if (used[x + i...
#include <cstdio> using namespace std; int x, n; bool used[105]; int main() { scanf("%d%d", &x, &n); for (int i = 0; i < n; i++) { int p; scanf("%d", &p); used[p] = true; } for (int i = 0; i < 100; i++) { if (!used[x - i]) { printf("%d\n", x - i); return 0; } if (!used[x +...
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
140
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define bug(x) cout << "zdongdebug1: " << x << endl; #define bug2(x, y) co...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define bug(x) cout << "zdongdebug1: " << x << endl; #define bug2(x, y) co...
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
255
#include <bits/stdc++.h> #ifdef LOCAL_DEBUG #define DEBUG 1 #define CERR \ if (DEBUG) \ cerr #define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define pr(...) ...
#include <bits/stdc++.h> #ifdef LOCAL_DEBUG #define DEBUG 1 #define CERR \ if (DEBUG) \ cerr #define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define pr(...) ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
770
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define mod ((int)1e9 + 7) #define lim 1000000000000000007 #define lim1 18446744073709551615 // Unsigned #define sq(a) ((a) * (a)) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define mms(v, i) memset...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define mod ((int)1e9 + 7) #define lim 1000000000000000007 #define lim1 18446744073709551615 // Unsigned #define sq(a) ((a) * (a)) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define mms(v, i) memset...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
601
#include <bits/stdc++.h> #define ll long long #define pii_ pair<int, int> #define mp_ make_pair #define pb push_back #define fi first #define se second #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, a, b) for (int i = (a); i >= (b); i--) #define show1(a) cout << #a << " = " << a << endl #define sh...
#include <bits/stdc++.h> #define ll long long #define pii_ pair<int, int> #define mp_ make_pair #define pb push_back #define fi first #define se second #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, a, b) for (int i = (a); i >= (b); i--) #define show1(a) cout << #a << " = " << a << endl #define sh...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
223
import sys sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def solve(): X, N = map(int, rl().split()) p = set(map(int, rl().split())) ans = -1 d_min = 1000 for i in range(101): if i not in p: if abs(X - i) < d_min: d_min = abs(X - i) ...
import sys sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def solve(): X, N = map(int, rl().split()) p = set(map(int, rl().split())) ans = -1 d_min = 1000 for i in range(102): if i not in p: if abs(X - i) < d_min: d_min = abs(X - i) ...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
111
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define all(v) v.begin(), v.end() const int inf = 1e9 + 7...
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define all(v) v.begin(), v.end() const int inf = 1e9 + 7...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
224