problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02641 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
#define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for (ll(i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for (ll(i) = (m); (i) < (n); (i)++)
#define INF 1e9
#define ALL(v)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
#define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for (ll(i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for (ll(i) = (m); (i) < (n); (i)++)
#define INF 1e9
#define ALL(v)... | null | 357,935 | 357,934 | u276682785 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n, ans, min = 1000;
cin >> x >> n;
int A[n];
for (int i = 0; i < n; i++) {
cin >> A[i];
}
sort(A, A + n);
for (int i = -100; i <= 100; i++) {
if (binary_search(A, A + n, i) == 0 && abs(x - i) < min) {
min = x - i;
ans = ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n, ans, min = 1000;
cin >> x >> n;
int A[n];
for (int i = 0; i < n; i++) {
cin >> A[i];
}
sort(A, A + n);
for (int i = -101; i <= 101; i++) {
if (binary_search(A, A + n, i) == 0 && abs(x - i) < min) {
min = x - i;
ans = ... | null | 358,128 | 358,129 | u460727588 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> x >> n;
set<int> y;
for (int i = 1; i <= 100; i++)
y.insert(i);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
y.erase(x);
}
map<int, int> m;
for (auto it : y) {
int diff = abs(x - it);
if (m.find(diff)... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> x >> n;
set<int> y;
for (int i = -200; i <= 200; i++)
y.insert(i);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
y.erase(x);
}
map<int, int> m;
for (auto it : y) {
int diff = abs(x - it);
if (m.find(dif... | null | 358,151 | 358,152 | u792677846 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
vector<int> p(N);
for (int i = 0; i < N; i++) {
cin >> p.at(i);
}
int dmem = 100;
int ans = 0;
for (int i = 0; i < 100; i++) {
int dis = abs(X - i);
int count = 0;
for (int j = 0; j < N; j++) {
i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
vector<int> p(N);
for (int i = 0; i < N; i++) {
cin >> p.at(i);
}
int dmem = 100;
int ans = 0;
for (int i = 0; i < 150; i++) {
int dis = abs(X - i);
int count = 0;
for (int j = 0; j < N; j++) {
i... | null | 358,357 | 358,358 | u607685130 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end());
if (n == 0) {
cout << x << endl;
return 0;
}
int ans1, ans2;
for (int i = 1; i <= 101; i++) {
int bo = 0;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end());
if (n == 0) {
cout << x << endl;
return 0;
}
int ans1, ans2;
for (int i = 0; i <= 101; i++) {
int bo = 0;
... | null | 358,777 | 358,778 | u205922227 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end());
if (n == 0) {
cout << x << endl;
return 0;
}
int ans1, ans2;
for (int i = 1; i <= 100; i++) {
int bo = 0;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end());
if (n == 0) {
cout << x << endl;
return 0;
}
int ans1, ans2;
for (int i = 0; i <= 101; i++) {
int bo = 0;
... | null | 358,779 | 358,778 | u205922227 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> vec(n);
vector<int> a(200);
for (int i = 0; i < n; i++) {
cin >> vec[i];
}
sort(vec.begin(), vec.end());
for (int i = 0; i < 201; i++) {
a[i]... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> vec(n);
vector<int> a(300);
for (int i = 0; i < n; i++) {
cin >> vec[i];
}
sort(vec.begin(), vec.end());
for (int i = 0; i < 301; i++) {
a[i]... | null | 358,811 | 358,812 | u121204840 | cpp |
p02641 | #include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_set>
#include <vector>
#define ull unsigned long long
#define ll long long
#define mp make_pair
#define imei(...) "[ " << #__VA_ARGS__ << " = " << __VA_ARGS__ << " ] "
using namespace std;
void sol... | #include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_set>
#include <vector>
#define ull unsigned long long
#define ll long long
#define mp make_pair
#define imei(...) "[ " << #__VA_ARGS__ << " = " << __VA_ARGS__ << " ] "
using namespace std;
void sol... | null | 358,813 | 358,814 | u483554502 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define FAST_INP \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
int main() {
FAST_INP;
int x, n;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
... | #include <bits/stdc++.h>
using namespace std;
#define FAST_INP \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
int main() {
FAST_INP;
int x, n;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
... | null | 358,819 | 358,820 | u040094338 | cpp |
p02641 | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#include <vector>
using ... | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#include <vector>
using ... | null | 358,834 | 358,835 | u327242197 | cpp |
p02641 | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rep2l(i, s, n) for (ll i = (ll)(s); i ... | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rep2l(i, s, n) for (ll i = (ll)(s); i ... | null | 358,865 | 358,866 | u632527507 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int x, n, xx;
cin >> x >> n;
int arr[101];
for (long long int a = 0; a < 101; a++) {
arr[a] = 0;
}
while (n--) {
cin >> xx;
arr[xx]++;
}
long long int l, r;
for (long... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int x, n, xx;
cin >> x >> n;
int arr[102];
for (long long int a = 0; a < 102; a++) {
arr[a] = 0;
}
while (n--) {
cin >> xx;
arr[xx]++;
}
long long int l = -1, r;
for ... | null | 358,873 | 358,874 | u343571251 | cpp |
p02641 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define bit(n) (1LL << (n))
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int x, n;
cin >> x >> n;
bool nps[101];
rep(i, 101) { nps[i... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define bit(n) (1LL << (n))
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int x, n;
cin >> x >> n;
// pに含まれない整数(0以上101以下)
bool nps[102]... | null | 358,887 | 358,888 | u931191237 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
if (N == 0) {
cout << X << endl;
} else if (N == 100) {
if (X >= 51) {
cout << 101 << endl;
} else {
cout << 0 << endl;
}
} else {
int p[N];
for (int i = 0; i < N; i++) {
cin >> p[i];... | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
if (N == 0) {
cout << X << endl;
} else if (N == 100) {
if (X >= 51) {
cout << 101 << endl;
} else {
cout << 0 << endl;
}
} else {
int p[N];
for (int i = 0; i < N; i++) {
cin >> p[i];... | null | 358,925 | 358,926 | u901955035 | cpp |
p02641 | #include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
int ans = x;
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int min = 1000;
for (int i = -99; i <= 100; i++) {
int tmp = 0;
int f = 1;
for (int j = 0; j < n; j++... | #include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
int ans = x;
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int min = 1000;
for (int i = -100; i <= 200; i++) {
int tmp = 0;
int f = 1;
for (int j = 0; j < n; j+... | null | 358,943 | 358,944 | u061146866 | cpp |
p02641 | #include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
int ans = x;
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int min = 1000;
for (int i = -100; i <= 100; i++) {
int tmp = 0;
int f = 1;
for (int j = 0; j < n; j+... | #include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
int ans = x;
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int min = 1000;
for (int i = -100; i <= 200; i++) {
int tmp = 0;
int f = 1;
for (int j = 0; j < n; j+... | null | 358,945 | 358,944 | u061146866 | cpp |
p02641 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < ... | null | 358,959 | 358,960 | u334553376 | cpp |
p02641 | #include <bits/stdc++.h>
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) REP(i, 0, (n))
typedef long long ll;
using namespace std;
int main() {
int X, N, p;
cin >> X >> N;
bool use[100 + 1] = {};
rep(i, N) {
cin >> p;
use[p] = true;
}
int ans = 0;
rep(i, 101) {
if (!use... | #include <bits/stdc++.h>
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) REP(i, 0, (n))
typedef long long ll;
using namespace std;
int main() {
int X, N, p;
cin >> X >> N;
bool use[100 + 2] = {};
rep(i, N) {
cin >> p;
use[p] = true;
}
int ans = 0;
rep(i, 102) {
if (!use... | null | 359,390 | 359,389 | u658655325 | cpp |
p02641 | #include <cstdlib>>
#include <iostream>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
int p[101];
int i;
for (i = 0; i < N; i++) {
cin >> p[i];
}
bool flag1 = 0;
bool flag2 = 0;
for (i = 1;; i++) {
flag1 = 0;
flag2 = 0;
for (int j = 0; j < N; j++) {
if (X - i == p[j]... | #include <cstdlib>
#include <iostream>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
int p[101];
int i;
for (i = 0; i < N; i++) {
cin >> p[i];
}
bool flag1 = 0;
bool flag2 = 0;
for (i = 0;; i++) {
flag1 = 0;
flag2 = 0;
for (int j = 0; j < N; j++) {
if (X - i == p[j])... | null | 358,961 | 358,962 | u013544319 | cpp |
p02641 | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <deque> // deque
#include <iomanip> // fixed, setprecis... | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <deque> // deque
#include <iomanip> // fixed, setprecis... | null | 360,226 | 360,227 | u100459591 | cpp |
p02641 | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
if (n == 0 && n == 100) {
cout << x << "\n";
return 0;
}
int v[101];
for (int i = 0; i <= 100; i++) {
v[i] = 0;
}
int p;
for (int i ... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
if (n == 0) {
cout << x << "\n";
return 0;
}
int v[101];
for (int i = 0; i <= 100; i++) {
v[i] = 0;
}
int p;
for (int i = 0; i < n; ... | null | 360,230 | 360,231 | u173262636 | cpp |
p02641 | #include <bits/stdc++.h>
#define len(x) (int)(x.size())
using namespace std;
typedef long long ll;
int main() {
map<int, int> inArray;
int x, n, val;
cin >> x >> n;
for (int i = 0; i < n; i++) {
cin >> val;
inArray[val] = 1;
}
int fans = 101, ans = 101;
for (int i = 0; i <= 100; i++) {
if (... | #include <bits/stdc++.h>
#define len(x) (int)(x.size())
using namespace std;
typedef long long ll;
int main() {
map<int, int> inArray;
int x, n, val;
cin >> x >> n;
for (int i = 0; i < n; i++) {
cin >> val;
inArray[val] = 1;
}
int fans = 102, ans = 102;
for (int i = 0; i <= 101; i++) {
if (... | null | 360,232 | 360,233 | u522035594 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
if (n == 0) {
cout << x << endl;
return 0;
}
for (int i = 1; i <= 110; i++) {
int sp = 0, sm = 0;
sp = x + i;
sm = x - i;
bo... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
if (n == 0) {
cout << x << endl;
return 0;
}
for (int i = 0; i <= 110; i++) {
int sp = 0, sm = 0;
sp = x + i;
sm = x - i;
bo... | null | 360,262 | 360,263 | u237925781 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
if (n == 0) {
cout << x << endl;
return 0;
}
for (int i = 1; i <= 100; i++) {
int sp = 0, sm = 0;
sp = x + i;
sm = x - i;
bo... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
if (n == 0) {
cout << x << endl;
return 0;
}
for (int i = 0; i <= 110; i++) {
int sp = 0, sm = 0;
sp = x + i;
sm = x - i;
bo... | null | 360,264 | 360,263 | u237925781 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N, ans;
bool flag = true;
cin >> X >> N;
if (N == 0) {
cout << X << endl;
return 0;
}
vector<int> p(N);
for (int i = 0; i < N; i++)
cin >> p.at(i);
// sort(p.begin(),p.end());
for (int i = 1; i < 100; i++) {
flag = true;... | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N, ans;
bool flag = true;
cin >> X >> N;
if (N == 0) {
cout << X << endl;
return 0;
}
vector<int> p(N);
for (int i = 0; i < N; i++)
cin >> p.at(i);
// sort(p.begin(),p.end());
for (int i = 0; i < 101; i++) {
flag = true;... | null | 360,318 | 360,319 | u132894387 | cpp |
p02641 | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int x, n, c, d, min, ans;
int *p;
min = 100;
c = 0;
cin >> x >> n;
p = new int[n];
for (int i = 0; i < n; i++) {
cin >> p[i];
}
for (int i = -100; i <= 100; i++) {
for (int j = 0; j < n; j++) {
if (i == p[j]) {
... | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int x, n, c, d, min, answer;
int *p;
min = 100;
c = 0;
cin >> x >> n;
p = new int[n];
for (int i = 0; i < n; i++) {
cin >> p[i];
}
for (int i = -100; i <= 101; i++) {
for (int j = 0; j < n; j++) {
if (i == p[j]) {
... | null | 360,325 | 360,326 | u541890421 | cpp |
p02641 | #include <iostream>
using namespace std;
int main() {
int *p;
int x, n;
cin >> x >> n;
p = (int *)malloc(sizeof(int) * n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int small, large, tag;
small = x - 1;
large = x + 1;
while (1) {
tag = 0;
for (int i = 0; i < n; i++) {
if (small... | #include <iostream>
using namespace std;
int main() {
int *p;
int x, n;
cin >> x >> n;
p = (int *)malloc(sizeof(int) * n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int small, large, tag;
small = x;
large = x;
while (1) {
tag = 0;
for (int i = 0; i < n; i++) {
if (small == p[i]... | null | 360,361 | 360,362 | u230497812 | cpp |
p02641 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(all(p));
vector<int> q(200);
fo... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(all(p));
vector<int> q(300);
fo... | null | 360,383 | 360,384 | u674120728 | cpp |
p02641 | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int X, N;
vector<int> p;
vector<pair<int, int>> q;
cin >> X >> N;
int y;
rep(i, N) {
cin >> y;
p.push_back(y);
}
for (int i = 1; i <= 100; i++) {
... | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int X, N;
vector<int> p;
vector<pair<int, int>> q;
cin >> X >> N;
int y;
rep(i, N) {
cin >> y;
p.push_back(y);
}
for (int i = 0; i <= 101; i++) {
... | null | 360,385 | 360,386 | u191955619 | cpp |
p02641 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define INF 1 << 29
using namespace std;
typedef long long ll;
int main() {
int x, n;
// int dif = INT16_MAX;
int buf = 0;
int max_num = 0;
int x_d = 0, x_u = 100;
cin >> x >> n;
vector<int> p(n);
for (int i ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define INF 1 << 29
using namespace std;
typedef long long ll;
int main() {
int x, n;
// int dif = INT16_MAX;
int buf = 0;
int max_num = 0;
int x_d = 0, x_u = 101;
cin >> x >> n;
vector<int> p(n);
for (int i ... | null | 360,396 | 360,397 | u099379118 | cpp |
p02641 | #include <iostream>
using namespace std;
int main() {
int a, n;
cin >> a >> n;
int arr[101] = {0}, x;
for (int i = 0; i < n; i++) {
cin >> x;
arr[x] = 1;
}
int ans = 101, res = 1;
for (int i = 0; i <= 100; i++)
if (arr[i] == 0 && ans > abs(i - a)) {
ans = abs(i - a);
res = i;
}... | #include <iostream>
using namespace std;
int main() {
int a, n;
cin >> a >> n;
int arr[105] = {0}, x;
// cout<<arr[50];
for (int i = 0; i < n; i++) {
cin >> x;
arr[x] = 1;
}
int ans = 1001, res = 1;
for (int i = 0; i <= 105; i++)
if (arr[i] == 0 && ans > abs(i - a)) {
ans = abs(i - a);... | null | 360,430 | 360,431 | u553911881 | cpp |
p02641 | #include <iostream>
using namespace std;
int main() {
int a, n;
cin >> a >> n;
int arr[101] = {0}, x;
for (int i = 0; i < n; i++) {
cin >> x;
arr[x] = 1;
}
int ans = 101, res = 0;
for (int i = 0; i <= 100; i++)
if (arr[i] == 0 && ans > abs(i - a)) {
ans = abs(i - a);
res = i;
}... | #include <iostream>
using namespace std;
int main() {
int a, n;
cin >> a >> n;
int arr[105] = {0}, x;
// cout<<arr[50];
for (int i = 0; i < n; i++) {
cin >> x;
arr[x] = 1;
}
int ans = 1001, res = 1;
for (int i = 0; i <= 105; i++)
if (arr[i] == 0 && ans > abs(i - a)) {
ans = abs(i - a);... | null | 360,432 | 360,431 | u553911881 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n, a, i, ans = 0, dif = x;
scanf("%d%d", &x, &n);
bool s[102] = {};
for (i = 0; i < n; i++) {
scanf("%d", &a);
s[a] = 1;
}
for (i = 1; i <= 101; i++) {
if (!s[i] && abs(i - x) < dif) {
ans = i;
dif = abs(i - x);
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n, a, i, ans, dif = 10000000;
scanf("%d%d", &x, &n);
bool s[102] = {};
for (i = 0; i < n; i++) {
scanf("%d", &a);
s[a] = 1;
}
for (i = 0; i <= 101; i++) {
if (!s[i] && abs(i - x) < dif) {
ans = i;
dif = abs(i - x);
... | null | 360,521 | 360,522 | u881116515 | cpp |
p02641 | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int t = 0, str = 100, k = 0, ans = 0;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
for (int i = 0; i <= 100; i++) {
t = 0;
for (int j = 0; j < n; j++) {... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int t = 0, str = 100, k = 0, ans = 0;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
for (int i = -102; i <= 220; i++) {
t = 0;
for (int j = 0; j < n; j++... | null | 360,523 | 360,524 | u912304782 | cpp |
p02641 | #include <algorithm>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
//#include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
ve... | #include <algorithm>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
//#include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
ve... | null | 359,465 | 359,466 | u214864255 | cpp |
p02641 | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int x, n, min = 1000000000;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> p(n);
for (int i = 0; i < n; i++)
cin >> p[i];
for (int i = -100; i <= 100; i++) {
... | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int x, n, min = 1000000000;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> p(n);
for (int i = 0; i < n; i++)
cin >> p[i];
for (int i = 0; i <= 200; i++) {
... | null | 359,535 | 359,536 | u488805026 | cpp |
p02641 | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int x, n, min = 1000000000;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> p(n);
for (int i = 0; i < n; i++)
cin >> p[i];
for (int i = 0; i <= 100; i++) {
... | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int x, n, min = 1000000000;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> p(n);
for (int i = 0; i < n; i++)
cin >> p[i];
for (int i = 0; i <= 200; i++) {
... | null | 359,537 | 359,536 | u488805026 | cpp |
p02641 | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int X, N, p;
int cnt[101] = {0};
cin >> X >> N;
for (int i = 0; i < N; i++) {
cin >> p;
cnt[p]++;
}
for (int d = 0; d <= X; d++)
for (int s = -1; s <= 1; s += 2)
if (cnt[X + d * s] == 0) {
cout << X + d * s << ... | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int X, N, p;
int cnt[201] = {0};
cin >> X >> N;
for (int i = 0; i < N; i++) {
cin >> p;
cnt[p]++;
}
for (int d = 0; d <= X; d++)
for (int s = -1; s <= 1; s += 2)
if (cnt[X + d * s] == 0) {
cout << X + d * s << ... | null | 359,538 | 359,539 | u064016712 | cpp |
p02641 | #include <iostream>
using namespace std;
#define MIN(x, y) x < y ? x : y
#define ABS(x, y) x < y ? (y - x) : (x - y)
typedef long long Long;
int main() {
int x, n, p[101];
int tmp;
int diff, prev_diff = 1000;
int ans = 0;
cin >> x >> n;
for (int i = 0; i <= 100; i++) {
p[i] = 0;
}
for (int i ... | #include <iostream>
using namespace std;
#define MIN(x, y) x < y ? x : y
#define ABS(x, y) x < y ? (y - x) : (x - y)
typedef long long Long;
int main() {
int x, n, p[102];
int tmp;
int diff, prev_diff = 1000;
int ans = 0;
cin >> x >> n;
for (int i = 0; i <= 101; i++) {
p[i] = 0;
}
for (int i ... | null | 359,540 | 359,541 | u347105948 | cpp |
p02641 | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
for (int i = 0; i < n; i++) {
cin >> p[i];
}
sort(p, p + n);
int min = 1e9;
int ans = 0;
int j = 0;
for (int i = 1; i <= 100; i++) {
if (abs(i - x) < min && p[j] ... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
for (int i = 0; i < n; i++) {
cin >> p[i];
}
sort(p, p + n);
int min = 1e9;
int ans = 0;
int j = 0;
for (int i = 0; i <= 100 + 1; i++) {
if (abs(i - x) < min && p... | null | 359,629 | 359,630 | u159703196 | cpp |
p02641 | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
for (int i = 0; i < n; i++) {
cin >> p[i];
}
sort(p, p + n);
int min = 1e9;
int ans = 0;
int j = 0;
for (int i = 1; i < 100; i++) {
if (abs(i - x) < min && p[j] !... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int p[n];
for (int i = 0; i < n; i++) {
cin >> p[i];
}
sort(p, p + n);
int min = 1e9;
int ans = 0;
int j = 0;
for (int i = 0; i <= 100 + 1; i++) {
if (abs(i - x) < min && p... | null | 359,631 | 359,630 | u159703196 | cpp |
p02641 | #include <bits/stdc++.h>
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for (int i = (b); i >= (a); --i)
#define REPP(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (b); i > (a); --i)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
... | #include <bits/stdc++.h>
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for (int i = (b); i >= (a); --i)
#define REPP(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (b); i > (a); --i)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
... | null | 359,639 | 359,640 | u301339225 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n, a, b, judge1 = 1, judge2 = 1;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
for (int i = 1; i < 101; i++) {
a = x - i;
b = x + i;
jud... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n, a, b, judge1 = 1, judge2 = 1;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
for (int i = 0; i < 101; i++) {
a = x - i;
b = x + i;
jud... | null | 359,687 | 359,688 | u608219236 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, n;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
ll ans1, ans2;
vector<ll> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a.begin(), a.end());
ll max = a[n - 1];
bool ok = true;
f... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, n;
cin >> x >> n;
if (n == 0) {
cout << x << endl;
return 0;
}
ll ans1, ans2;
vector<ll> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a.begin(), a.end());
ll max = a[n - 1];
bool ok = true;
f... | null | 359,689 | 359,690 | u873762144 | cpp |
p02641 | /*
* Project: AtCoder Beginners Contest 170 C - Forbidden List
* Author: toms74209200 <https://github.com/toms74209200>
*
* Created on 2020/06/14
* Copyright (c) 2020 toms74209200
*
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*/
#include <algorithm>
#incl... | /*
* Project: AtCoder Beginners Contest 170 C - Forbidden List
* Author: toms74209200 <https://github.com/toms74209200>
*
* Created on 2020/06/14
* Copyright (c) 2020 toms74209200
*
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*/
#include <algorithm>
#incl... | null | 359,691 | 359,692 | u781458283 | cpp |
p02641 | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vl vector
using namespace std;
int main() {
ll x, n, i;
ll a;
cin >> x >> n;
ll arr[101] = {0};
for (i = 0; i < n; i++) {
cin >> a;
arr[a]++;
}
ll ind1, ind2;
ll dis1, dis2;
for (i = x; i < 101; i++) {
if (arr[i] ==... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vl vector
using namespace std;
int main() {
ll x, n, i;
ll a;
cin >> x >> n;
ll arr[102] = {0};
for (i = 0; i < n; i++) {
cin >> a;
arr[a]++;
}
ll ind1, ind2;
ll dis1, dis2;
for (i = x; i <= 101; i++) {
if (arr[i] =... | null | 359,718 | 359,719 | u042481711 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
template <typename T> void out(T x) {
cout << x << endl;
exit(0);
}
#define watch(x) cout << (#x) << " is " << (x) << endl
using ll = long long;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.t... | #include <bits/stdc++.h>
using namespace std;
template <typename T> void out(T x) {
cout << x << endl;
exit(0);
}
#define watch(x) cout << (#x) << " is " << (x) << endl
using ll = long long;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.t... | null | 359,734 | 359,735 | u774417629 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
using ll = long long;
const int INF = 2147483647;
// const ll INF = 1000000000000000000LL;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(p.begin(), p.end());
int ans;
int ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
using ll = long long;
const int INF = 2147483647;
// const ll INF = 1000000000000000000LL;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(p.begin(), p.end());
int ans;
int ... | null | 359,774 | 359,775 | u489603283 | cpp |
p02641 | #include "bits/stdc++.h"
using namespace std;
int main() {
int x, n;
auto num_list = vector<int>(100);
int ookiikazu = 101;
int tiisaikazu = -1;
for (int i = 0; i < 100; i++) {
num_list[i] = i + 1;
}
cin >> x >> n;
for (int i = 0; i < n; i++) {
int temp;
cin >> temp;
num_list[temp - 1... |
#include "bits/stdc++.h"
using namespace std;
int main() {
int x, n;
auto num_list = vector<int>(100);
int ookiikazu = 101;
int tiisaikazu = 0;
for (int i = 0; i < 100; i++) {
num_list[i] = i + 1;
}
cin >> x >> n;
for (int i = 0; i < n; i++) {
int temp;
cin >> temp;
num_list[temp - 1... | null | 359,788 | 359,789 | u467998728 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll a, b;
cin >> a >> b;
ll arr[b];
set<int> s;
for (int i = 0; i < b; i++) {
cin >> arr[i];
s.insert(arr[i]);
}
if (s.find(a) == s.end())
cout << a << "\n";
else {
// element is present in the sequence..
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll a, b;
cin >> a >> b;
ll arr[b];
set<int> s;
for (int i = 0; i < b; i++) {
cin >> arr[i];
s.insert(arr[i]);
}
if (s.find(a) == s.end())
cout << a << "\n";
else {
// element is present in the sequence..
... | null | 359,837 | 359,838 | u036472658 | cpp |
p02641 | // Utkarsh.25dec
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define loop(i, a, b) for (ll i = a; i <= b; i++)
#define vi vector<int>... | // Utkarsh.25dec
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define loop(i, a, b) for (ll i = a; i <= b; i++)
#define vi vector<int>... | null | 359,896 | 359,897 | u596750443 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define numrep(i, n) for (int i = 1; i <= n; i++)
#define bitrep(n) for (int bit = 0; bit < (1 << n); bit++)
#define ll int64_t
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;
int main() {
int X, N;
cin >> X ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define numrep(i, n) for (int i = 1; i <= n; i++)
#define bitrep(n) for (int bit = 0; bit < (1 << n); bit++)
#define ll int64_t
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;
int main() {
int X, N;
cin >> X ... | null | 359,975 | 359,976 | u563788821 | cpp |
p02641 | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int x, n, flg, ans, tmp = 100;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(p.begin(), p.end());
for (int i = -1; i <= 100; i++) {
flg = 1;
rep(j, n) {
... | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int x, n, flg, ans = -1, tmp = 100;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(p.begin(), p.end());
for (int i = -1; i <= 101; i++) {
flg = 1;
rep(j, n) {
... | null | 359,977 | 359,978 | u861656988 | cpp |
p02641 | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int X, N, dN_array[128] = {-1}, minimal_itg = 101, minimal_abs = 101, tmp;
cin >> X >> N;
if (N == 0) {
minimal_itg = X;
} else {
for (int i = 0; i < N; i++) {
cin >> tmp;
dN_array[tmp] = 1;
}
... | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int X, N, dN_array[128] = {-1}, minimal_itg = 101, minimal_abs = 101, tmp;
cin >> X >> N;
if (N == 0) {
minimal_itg = X;
} else {
for (int i = 0; i < N; i++) {
cin >> tmp;
dN_array[tmp] = 1;
}
... | null | 360,017 | 360,018 | u851403890 | cpp |
p02641 | #include <iostream>
using namespace std;
int abs(int x) {
if (x >= 0)
return x;
else
return -x;
}
int main(void) {
int x, n;
int p[110];
cin >> x >> n;
for (int i = 0; i < n; ++i) {
cin >> p[i];
}
int ans = 0;
for (int i = 1; i <= 100; ++i) {
bool isExist = false;
for (int j = 0... | #include <iostream>
using namespace std;
int abs(int x) {
if (x >= 0)
return x;
else
return -x;
}
int main(void) {
int x, n;
int p[110];
cin >> x >> n;
for (int i = 0; i < n; ++i) {
cin >> p[i];
}
int ans = 0;
for (int i = 1; i <= 105; ++i) {
bool isExist = false;
for (int j = 0... | null | 359,084 | 359,085 | u530957410 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
if (n == 0) {
cin.ignore();
cin.ignore();
cout << x;
return 0;
}
vector<int> p(n);
vector<int> ans;
vector<pair<int, int>> tmp;
for (int i = 0; i < n; i++)
cin >> p.at(i);
for (int i = -100; i <= ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
if (n == 0) {
cin.ignore();
cin.ignore();
cout << x;
return 0;
}
vector<int> p(n);
vector<int> ans;
vector<pair<int, int>> tmp;
for (int i = 0; i < n; i++)
cin >> p.at(i);
for (int i = -200; i <= ... | null | 360,022 | 360,023 | u363703956 | cpp |
p02641 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define prtd(var, i) cout << fixed << setprecision(i) << var << endl;
#define ll long long
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(p.rbegin(), p.rend());
vector<int> an... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define prtd(var, i) cout << fixed << setprecision(i) << var << endl;
#define ll long long
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, n) cin >> p[i];
sort(p.rbegin(), p.rend());
vector<int> an... | null | 360,030 | 360,031 | u101048376 | cpp |
p02641 | /*
CODED BY
**************
DARSHAN JAIN
darshanjain31
**************
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define fast \
ios_base::sync_with_stdio(false); ... | /*
CODED BY
**************
DARSHAN JAIN
darshanjain31
**************
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define fast \
ios_base::sync_with_stdio(false); ... | null | 360,035 | 360,036 | u211855881 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define CLR(a) memset(a, 0, sizeof(a))
#define SET(a) memset(a, -1, sizeof(a))
#define nl "\n";
#define FIO \
ios_base::sync_with_stdio(false); \
cout.setf(io... | #include <bits/stdc++.h>
using namespace std;
#define CLR(a) memset(a, 0, sizeof(a))
#define SET(a) memset(a, -1, sizeof(a))
#define nl "\n";
#define FIO \
ios_base::sync_with_stdio(false); \
cout.setf(io... | null | 360,047 | 360,048 | u098704227 | cpp |
p02641 | #include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<bool> p(101, true);
for (int i = 0; i < n; i++) {
int t;
cin >> t;
p[t] = false;
}
int ans = 1;
for (int i = 1; i <= 100; i++) {
if (p[i] && abs(x - i) < abs(x - ans))... | #include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
vector<bool> p(102, true);
for (int i = 1; i <= n; i++) {
int t;
cin >> t;
p[t] = false;
}
int ans = 0;
for (int i = 1; i <= 101; i++) {
if (p[i] && abs(x - i) < abs(x - ans)... | null | 360,063 | 360,064 | u432088501 | cpp |
p02641 | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
vector<int> table(N);
for (int i = 0; i < N; i++) {
cin >> table.at(i);
}
int sa = 100;
int ans = 0;
bool check = false;
for (int i = -100; i <= 100; i++) {
for (int j = 0; j < N; j++) {
... | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
vector<int> table(N);
for (int i = 0; i < N; i++) {
cin >> table.at(i);
}
int sa = 100;
int ans = 0;
bool check = false;
for (int i = -100; i <= 101; i++) {
for (int j = 0; j < N; j++) {
... | null | 360,070 | 360,071 | u322067886 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int x, n;
cin >> x >> n;
vector<int> pn(n);
rep(i, n) cin >> pn[i];
map<int, int> mp;
for (int i = 0; i <= 100; i++) {
mp[i] = abs(i - x);
}
int mn = 10000;
vector<... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int x, n;
cin >> x >> n;
vector<int> pn(n);
rep(i, n) cin >> pn[i];
map<int, int> mp;
for (int i = 0; i <= 200; i++) {
mp[i] = abs(i - x);
}
int mn = 10000;
vector<... | null | 360,116 | 360,117 | u436660228 | cpp |
p02641 | #include <bits/stdc++.h>
#include <iostream>
#define LL long long int
using namespace std;
int main() {
LL x, n;
cin >> x >> n;
LL a[n];
map<LL, LL> m;
LL count = 0;
for (LL i = 0; i < n; i++) {
cin >> a[i];
m[a[i]]++;
}
if (m[x] == 0) {
cout << x << "\n";
return 0;
}
LL mina = LLON... | #include <bits/stdc++.h>
#include <iostream>
#define LL long long int
using namespace std;
int main() {
LL x, n;
cin >> x >> n;
LL a[n];
map<LL, LL> m;
LL count = 0;
for (LL i = 0; i < n; i++) {
cin >> a[i];
m[a[i]]++;
}
if (m[x] == 0) {
cout << x << "\n";
return 0;
}
LL mina = LLON... | null | 360,177 | 360,178 | u619707248 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define so(v) sort(v.begin(), v.end())
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
const int MAX = 510000;
const int MOD = 1000000007;
ll gcd(ll a, ll b) {
if (a % b == 0) {
return (b);
}... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define so(v) sort(v.begin(), v.end())
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
const int MAX = 510000;
const int MOD = 1000000007;
ll gcd(ll a, ll b) {
if (a % b == 0) {
return (b);
}... | null | 360,577 | 360,578 | u851205244 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int x, n;
cin >> x >> n;
int a[n];
set<int> q;
for (int i = 0; i < n; i++) {
cin >> a[i];
q.insert(a[i]);
}
if (n == 0)
cout << x << endl;
else {
int i = 1;
while (1) {
if (q.find(x - i) == q.end(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int x, n;
cin >> x >> n;
int a[n];
set<int> q;
for (int i = 0; i < n; i++) {
cin >> a[i];
q.insert(a[i]);
}
if (n == 0)
cout << x << endl;
else {
int i = 0;
while (1) {
if (q.find(x - i) == q.end(... | null | 360,609 | 360,610 | u322266296 | cpp |
p02641 | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool is_in(vector<int> vec, int target) {
for (auto it = vec.begin(); it != vec.end(); it++) {
if (*it == target) {
return true;
}
}
return false;
}
int main() {
int X, N;
cin >> X >> N;
vector<int> vec(N);
f... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool is_in(vector<int> vec, int target) {
for (auto it = vec.begin(); it != vec.end(); it++) {
if (*it == target) {
return true;
}
}
return false;
}
int main() {
int X, N;
cin >> X >> N;
vector<int> vec(N);
f... | null | 360,620 | 360,621 | u361631791 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) << "\n";
#define endl printf("\n")
typedef pair<ll, ll> pii;
#define pb push_back
#define ms(a, b) memset(a, b, sizeof(a))
#define in(x) scanf(... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) << "\n";
#define endl printf("\n")
typedef pair<ll, ll> pii;
#define pb push_back
#define ms(a, b) memset(a, b, sizeof(a))
#define in(x) scanf(... | null | 360,622 | 360,623 | u850379296 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (int i = 0; i < n; ++i)
using ll = long long;
using P = pair<int, int>;
int main() {
int x, n;
cin >>... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (int i = 0; i < n; ++i)
using ll = long long;
using P = pair<int, int>;
int main() {
int x, n;
cin >>... | null | 360,637 | 360,638 | u375398641 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool... | null | 360,639 | 360,640 | u748757847 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int x, n;
cin >> x >> n;
int a[101];
for (int i = 0; i < 101; i++)
a[i] = 0;
for (int i = 0; i < n; i++) {
int j;
cin >> j;
a[j] = 1;
}
for (int i = 0; i <= x; i++) {
if (a[x - i]... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int x, n;
cin >> x >> n;
int a[202];
for (int i = 0; i < 202; i++)
a[i] = 0;
for (int i = 0; i < n; i++) {
int j;
cin >> j;
a[j] = 1;
}
for (int i = 0; i <= x; i++) {
if (a[x - i]... | null | 360,693 | 360,694 | u872068288 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); ... | null | 360,744 | 360,745 | u206296517 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define REP(i, n, m) for (ll i = n; i < (ll)m; ++i)
#define IREP(i, n, m) for (ll i = n - 1; i >= m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#d... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define REP(i, n, m) for (ll i = n; i < (ll)m; ++i)
#define IREP(i, n, m) for (ll i = n - 1; i >= m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#d... | null | 360,756 | 360,757 | u059082716 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define uint uns... | #include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define uint uns... | null | 360,760 | 360,761 | u569387389 | cpp |
p02641 | #pragma GCC optimize("O2")
#include <bits/stdc++.h>
// #include <iostream>
// #include <array>
// #include <cmath>
// #include <array>
// #include <vector>
// #include <set>
// #include <algorithm>
// #include <functional>
// #include <numeric>
// #include <map>
// #include <unordered_map>
// #include <queue>
using nam... | #pragma GCC optimize("O2")
#include <bits/stdc++.h>
// #include <iostream>
// #include <array>
// #include <cmath>
// #include <array>
// #include <vector>
// #include <set>
// #include <algorithm>
// #include <functional>
// #include <numeric>
// #include <map>
// #include <unordered_map>
// #include <queue>
using nam... | null | 360,773 | 360,774 | u503163393 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = -1; i <= n; ++i)
int main() {
int x, n;
int res = 0;
set<int> s;
cin >> x >> n;
rep(i, n) {
int tmp;
cin >> tmp;
s.insert(tmp);
}
rep1(i, 100) {
if (s.count(i)) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 0; i <= n; ++i)
int main() {
int x, n;
int res = 0;
set<int> s;
cin >> x >> n;
rep(i, n) {
int tmp;
cin >> tmp;
s.insert(tmp);
}
rep1(i, 101) {
if (s.count(i)) {
... | null | 360,775 | 360,776 | u628299064 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
int main() {
int x, n;
int res = 0;
set<int> s;
cin >> x >> n;
rep(i, n) {
int tmp;
cin >> tmp;
s.insert(tmp);
}
rep1(i, 100) {
if (s.count(i)) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 0; i <= n; ++i)
int main() {
int x, n;
int res = 0;
set<int> s;
cin >> x >> n;
rep(i, n) {
int tmp;
cin >> tmp;
s.insert(tmp);
}
rep1(i, 101) {
if (s.count(i)) {
... | null | 360,777 | 360,776 | u628299064 | cpp |
p02641 | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ll x, n;
cin >> x >> n;
vector<ll> P(n);
for (auto &p : P)
cin >> p;
vector<bool> Q(102, true);
for (auto p : P)
Q[p] = false;
ll res = 100000;
for (ll i = 0; i < 101; ++i) {
if (!Q[i])
continue;
... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ll x, n;
cin >> x >> n;
vector<ll> P(n);
for (auto &p : P)
cin >> p;
vector<bool> Q(102, true);
for (auto p : P)
Q[p] = false;
ll res = 100000;
for (ll i = 0; i <= 101; ++i) {
if (!Q[i])
continue;... | null | 360,780 | 360,781 | u729166490 | cpp |
p02641 | #include <bits/stdc++.h>
#include <ext/rope>
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max4(a, b, c, d) max(max(a, b), max(c, d))
#define count_one(a) \
__builti... | #include <bits/stdc++.h>
#include <ext/rope>
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max4(a, b, c, d) max(max(a, b), max(c, d))
#define count_one(a) \
__builti... | null | 360,796 | 360,797 | u429793253 | cpp |
p02641 | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++) // n回繰り返す
#define rrep(i, n) for (int i = n - 1; i ... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++) // n回繰り返す
#define rrep(i, n) for (int i = n - 1; i ... | null | 360,807 | 360,808 | u690272026 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int ans;
int min_d = 9999999;
int num[n];
for (int i = 0; i < n; i++) {
cin >> num[i];
}
for (int now = 0; now <= 100; now++) {
bool found = false;
for (int i = 0; i < n; i++) {
if (now == num[i]) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int ans;
int min_d = 9999999;
int num[n];
for (int i = 0; i < n; i++) {
cin >> num[i];
}
for (int now = -150; now <= 250; now++) {
bool found = false;
for (int i = 0; i < n; i++) {
if (now == num[i]) ... | null | 360,856 | 360,857 | u698347787 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int testcase = 1;
// cin>>testcase;
for (int p = 0; p < testcase; p++) {
ll x = 0, n = 0;
cin >> x >> n;
if (n == 0)
cout << x;
else {
int array[100] = ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int testcase = 1;
// cin>>testcase;
for (int p = 0; p < testcase; p++) {
ll x = 0, n = 0;
cin >> x >> n;
if (n == 0)
cout << x;
else {
int array[101] = ... | null | 360,858 | 360,859 | u208922403 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
int p[110] = {};
for (int i = 0; i < N; i++) {
int q;
cin >> q;
p[i] = q;
}
bool k = false;
for (int i = 0; i < X; i++) {
int t = 2;
while (t > 0) {
i = (-1) * i;
bool s = true;
for (i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
int p[110] = {};
for (int i = 0; i < N; i++) {
int q;
cin >> q;
p[i] = q;
}
bool k = false;
for (int i = 0; i < 200; i++) {
int t = 2;
while (t > 0) {
i = (-1) * i;
bool s = true;
for ... | null | 361,141 | 361,142 | u731665172 | cpp |
p02641 | #include <iostream>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(void) {
int X, N;
cin >> X >> N;
int res, min = 100100100;
int v[110] = {0};
rep(i, N) {
int p;
cin >> p;
v[p] = 1;
}
if (v[X] == 0) {
cout << X << endl;
return 0;
}
int a = X - 1, b... | #include <iostream>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(void) {
int X, N;
cin >> X >> N;
int res, min = 100100100;
int v[110] = {0};
rep(i, N) {
int p;
cin >> p;
v[p] = 1;
}
if (v[X] == 0) {
cout << X << endl;
return 0;
}
int a = X - 1, b... | null | 361,148 | 361,149 | u660059163 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
// long long
using ll = long long;
// pair<int, int>
using PII = pair<int, int>;
//最大値、mod
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000000;
const long long LINF = 1e18;
const int MAX = 510000;
//出力系
#define print(x) cout << x << endl
#... | #include <bits/stdc++.h>
using namespace std;
// long long
using ll = long long;
// pair<int, int>
using PII = pair<int, int>;
//最大値、mod
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000000;
const long long LINF = 1e18;
const int MAX = 510000;
//出力系
#define print(x) cout << x << endl
#... | null | 361,168 | 361,169 | u832995587 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int left = x - 1, right = x + 1;
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());
for (int i = n - 1; i >= 0; i--) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int left = x, right = x;
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());
for (int i = n - 1; i >= 0; i--) {
if (p[... | null | 361,281 | 361,282 | u018586085 | cpp |
p02641 | #include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pai... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pai... | null | 361,283 | 361,284 | u952081880 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int X, N;
cin >> X >> N;
vector<int> p(N);
rep(i, N) cin >> p[i];
int min = 9999999;
int min_n = X;
for (int i = 1; i <= 100; i++) {
auto cIter = find(p.begin(), p.end(), i);
if (cIter ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int X, N;
cin >> X >> N;
vector<int> p(N);
rep(i, N) cin >> p[i];
int min = 9999999;
int min_n = X;
for (int i = -1; i <= 110; i++) {
auto cIter = find(p.begin(), p.end(), i);
if (cIter... | null | 361,307 | 361,308 | u957143460 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define what_is(x) cerr << #x << " is " << x << endl;
#define ll long long
#define gcd(a, b) __gcd(a, b)
#define pi 2 * acos(0.0)
// use emplace_back() instead of push_back()
template <typename T> void print(T t) {
for (const auto &e : t)
cout << e << " ";
cout << e... | #include <bits/stdc++.h>
using namespace std;
#define what_is(x) cerr << #x << " is " << x << endl;
#define ll long long
#define gcd(a, b) __gcd(a, b)
#define pi 2 * acos(0.0)
// use emplace_back() instead of push_back()
template <typename T> void print(T t) {
for (const auto &e : t)
cout << e << " ";
cout << e... | null | 361,396 | 361,397 | u555320215 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int f[105];
for (int i = 0; i <= 100; i++)
f[i] = -1;
for (int i = 0; i < n; i++) {
int xx;
cin >> xx;
f[xx] = 1;
}
int ans = 9999999;
int xx;
for (int i = 0; i <= 101; i++) {
if (f[i] == -1) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n;
cin >> x >> n;
int f[105];
for (int i = 0; i <= 104; i++)
f[i] = -1;
for (int i = 0; i < n; i++) {
int xx;
cin >> xx;
f[xx] = 1;
}
int ans = 9999999;
int xx;
for (int i = 0; i <= 101; i++) {
if (f[i] == -1) {
... | null | 363,016 | 363,017 | u551636762 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int ans;
for (int x1 = x, x2 = x; x1 > 0 && x2 < 101; x1--, x2++) {
int flag = 0;
for (int i = 0; i < n; i++) {
if (x1... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i];
}
int ans;
for (int x1 = x, x2 = x; x1 > -1 || x2 < 102; x1--, x2++) {
int flag = 0;
for (int i = 0; i < n; i++) {
if (x... | null | 363,018 | 363,019 | u405825415 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (int i = x; i < y; i++)
#define range(a) (a).begin(), (a).end()
#define print(A, x, n) \
rep(i, 0, n) { cout << (i ? " " : "") << A[i] x; } \
cout << endl;
#define... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (int i = x; i < y; i++)
#define range(a) (a).begin(), (a).end()
#define print(A, x, n) \
rep(i, 0, n) { cout << (i ? " " : "") << A[i] x; } \
cout << endl;
#define... | null | 363,020 | 363,021 | u977554186 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<ll>>;
using P = pair<int, int>;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<ll>>;
using P = pair<int, int>;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
i... | null | 363,028 | 363,029 | u711676593 | cpp |
p02641 | #pragma GCC optimze("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
// inbuilt function in c++
// abs(-2)=2 , __gcd(2,3)=1 , swap(a,b) ,
// string/array s = "aba"; sort(s.begin(), s.end()); do { cout << s << '\n';
// } while(next_permutation(s.begin(), s.end())); for all permutati... | #pragma GCC optimze("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
// inbuilt function in c++
// abs(-2)=2 , __gcd(2,3)=1 , swap(a,b) ,
// string/array s = "aba"; sort(s.begin(), s.end()); do { cout << s << '\n';
// } while(next_permutation(s.begin(), s.end())); for all permutati... | null | 363,030 | 363,031 | u434623366 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll mod = 1e9 + 7;
// vector<ll> g[200005];
// ll vis[200005];
// queue<ll> q;
// ll level[200005];
// void dfs(ll i)
// {
// vis[i] = 1;
// for(ll j=0;j<g[i].size();j++)
// {
// ll child = g[i][j];
// if(vis[child] == ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll mod = 1e9 + 7;
// vector<ll> g[200005];
// ll vis[200005];
// queue<ll> q;
// ll level[200005];
// void dfs(ll i)
// {
// vis[i] = 1;
// for(ll j=0;j<g[i].size();j++)
// {
// ll child = g[i][j];
// if(vis[child] == ... | null | 363,043 | 363,044 | u049507269 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
vector<int> p(N);
vector<int> A(100, 0);
int result = 0;
for (int a = 0; a < N; a++) {
cin >> p[a];
A[p[a] - 1] = 1;
}
for (int a = 0; a < 100; a++) {
if (A[a] == 0) {
if (abs(X - (a + 1)) < abs(X - r... | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, N;
cin >> X >> N;
vector<int> p(N);
vector<int> A(100, 0);
int result = 0;
for (int a = 0; a < N; a++) {
cin >> p[a];
A[p[a] - 1] = 1;
}
for (int a = 0; a < 200; a++) {
if (A[a] == 0) {
if (abs(X - (a + 1)) < abs(X - r... | null | 363,061 | 363,062 | u073895786 | cpp |
p02641 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const int MOD = 1000000007;
template <typename T> void print(const T &v);
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const int MOD = 1000000007;
template <typename T> void print(const T &v);
int main() {
int x, n;
cin >> x >> n;
vector<int> p(n);
rep(i, ... | null | 363,063 | 363,064 | u286623856 | cpp |
p02641 | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define RREP(... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define RREP(... | null | 363,090 | 363,091 | u494070244 | cpp |
p02641 | #include <iostream>
#include <map>
#define For(i, x, y) for (register int i = (x); i <= (y); i++)
using namespace std;
map<int, int> vis;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, x, temp;
cin >> x >> n;
For(i, 1, n) {
cin >> temp;
vis[temp] = 1;
}
int ans = 0, i = x,... | #include <iostream>
#include <map>
#define For(i, x, y) for (register int i = (x); i <= (y); i++)
using namespace std;
map<int, int> vis;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, x, temp;
cin >> x >> n;
For(i, 1, n) {
cin >> temp;
vis[temp] = 1;
}
int ans = 0, i = x,... | null | 363,103 | 363,104 | u610075132 | cpp |
p02641 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod = 998244353;
vector<ll> ans;
ll add(ll a, ll b) { return ((a % mod) + (b % mod)) % mod; }
ll multiply(ll a, ll b) { return ((a % mod) * (b % mod)) % mod; }
ll power(ll a, ll b) {
if (b == 0)
return 1;
ll temp = power(a, b / ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod = 998244353;
vector<ll> ans;
ll add(ll a, ll b) { return ((a % mod) + (b % mod)) % mod; }
ll multiply(ll a, ll b) { return ((a % mod) * (b % mod)) % mod; }
ll power(ll a, ll b) {
if (b == 0)
return 1;
ll temp = power(a, b / ... | null | 363,107 | 363,108 | u340853729 | cpp |
p02641 | /*
* Author : Omkar Deshmukh
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define all(v) v.begin(), v.end()
#define intvect vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n... | /*
* Author : Omkar Deshmukh
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define all(v) v.begin(), v.end()
#define intvect vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n... | null | 363,195 | 363,196 | u551310735 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.