problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02640
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, k; cin >> n >> k; bool flag = false; for (int l = 0; l <= n; l++) { if (((l * 2) + ((n - l) * 4)) == k) { flag = true; break; } } flag ? cout << "Yes\n" : cout << "No\n"; main(); return 0; }
#include <iostream> using namespace std; int main() { int n, k; cin >> n >> k; bool flag = false; for (int l = 0; l <= n; l++) { if (((l * 2) + ((n - l) * 4)) == k) { flag = true; break; } } flag ? cout << "Yes\n" : cout << "No\n"; // main(); return 0; }
replace
13
14
13
14
TLE
p02640
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long double pi = 3.14159265358979323846; #define x first #define y second int main() { cin.tie(0); cin.sync_with_stdio(0); ll t = 1; // cin>>t; while (t--) { ll x, y; cin >> x >> y; if (y % x == 0 && y / x == 4) cout...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long double pi = 3.14159265358979323846; #define x first #define y second int main() { cin.tie(0); cin.sync_with_stdio(0); ll t = 1; // cin>>t; while (t--) { ll x, y; cin >> x >> y; if (y % x == 0 && y / x == 4) cout...
insert
26
26
26
30
0
p02641
C++
Runtime Error
#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>; int main() { int x, n; cin >> x >> n; vector<int> vec(102); rep(i, n) { int a = 0; cin >> a; vec.at(a)++; } int ans = 200; for (int i = x; i >= 0; i...
#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>; int main() { int x, n; cin >> x >> n; vector<int> vec(300); rep(i, n) { int a = 0; cin >> a; vec.at(a)++; } int ans = 200; for (int i = x; i >= 0; i...
replace
11
12
11
12
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using namespace __detail; typedef long long ll; #define ar array #define vi vector<int> #define vvi vector<vector<int>> #define vll vector<long long> #define fork(i, n) for (ll i = 0; i < (n); i++) #define forn for (ll i = 0; i < (n); i++) #define fori(i, k, n) for (ll i =...
#include <bits/stdc++.h> using namespace std; using namespace __detail; typedef long long ll; #define ar array #define vi vector<int> #define vvi vector<vector<int>> #define vll vector<long long> #define fork(i, n) for (ll i = 0; i < (n); i++) #define forn for (ll i = 0; i < (n); i++) #define fori(i, k, n) for (ll i =...
replace
64
65
64
65
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int x, n; int p[105]; int mi, minv, maxv = 0, ans = 0; int flg[105] = {}; cin >> x >> n; for (int i = 0; i < n; i++) { cin >> p[i]; flg[p[i]] = 1; maxv = max(p[i], maxv); minv = min(p[i], minv); } mi = (x - (minv - 1)); ans = m...
#include <bits/stdc++.h> using namespace std; int main() { int x, n; int p[105]; int mi, minv, maxv = 0, ans = 0; int flg[105] = {}; cin >> x >> n; minv = 105; for (int i = 0; i < n; i++) { cin >> p[i]; flg[p[i]] = 1; maxv = max(p[i], maxv); minv = min(p[i], minv); } mi = (x - (minv - ...
insert
8
8
8
9
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int X, N; cin >> X >> N; int p[N]; for (int i = 0; i < N; i++) cin >> p[i]; int Min = 1000; int ans = 1000; sort(p, p + N); for (int i = -1000; i <= 1000; i++) { if (p[i] == i) continue; int num = abs(X - i); if (Min > ...
#include <bits/stdc++.h> using namespace std; int main() { int X, N; cin >> X >> N; int p[N]; for (int i = 0; i < N; i++) cin >> p[i]; int Min = 1000; int ans = 1000; sort(p, p + N); for (int i = 0; i <= 101; i++) { bool flag = true; for (int j = 0; j < N; j++) { if (p[j] == i) ...
replace
14
16
14
21
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(k, i, n) for (ll i = k; i < n; ++i) #define push_back pb int main(void) { // Your code here! ll x, n; cin >> x >> n; vector<ll> a(n); rep(0, i, n) { cin >> a[i]; } sort(a.begin(), a.end()); ll m = 1e9, ans, c = 0; rep(0, i, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(k, i, n) for (ll i = k; i < n; ++i) #define push_back pb int main(void) { // Your code here! ll x, n; cin >> x >> n; vector<ll> a(n); rep(0, i, n) { cin >> a[i]; } sort(a.begin(), a.end()); ll m = 1e9, ans, c = 0; rep(0, i, ...
replace
14
15
14
15
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int X, N, ans; cin >> X >> N; vector<bool> all(100, false); vector<int> p(N); for (int i = 0; i < N; i++) { cin >> p.at(i); all.at(p.at(i) - 1) = true; } // sort(p.begin(),p.end(),greater<int>()); for (int i = 0; i < 101; i++) { if...
#include <bits/stdc++.h> using namespace std; int main() { int X, N, ans; cin >> X >> N; vector<bool> all(100, false); vector<int> p(N); for (int i = 0; i < N; i++) { cin >> p.at(i); all.at(p.at(i) - 1) = true; } // sort(p.begin(),p.end(),greater<int>()); for (int i = 0; i < 101; i++) { if...
replace
18
19
18
25
0
p02641
C++
Runtime Error
#define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int MOD = 1000000007; // MAX int 2,147,483,647 -> 10桁 // MAX ll 9,223,372,036,854,775,807 -> 19桁 // MAX O(n) 10^18 -> 18回 int main() { int x, n; cin >> x >> n; vecto...
#define rep(i, n) for (int i = 0; i < (n); i++) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int MOD = 1000000007; // MAX int 2,147,483,647 -> 10桁 // MAX ll 9,223,372,036,854,775,807 -> 19桁 // MAX O(n) 10^18 -> 18回 int main() { int x, n; cin >> x >> n; vecto...
replace
13
14
13
14
-6
malloc(): corrupted top size
p02641
C++
Runtime Error
/// Bismillahir Rahmanir Rahim // Author: Tanvir Hussain // ICE,NSTU #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; const long long MOD = 1000000007; #define SET(x) memset(x, 0, sizeof(x)) #define SET2d(x, m, n) mem...
/// Bismillahir Rahmanir Rahim // Author: Tanvir Hussain // ICE,NSTU #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; const long long MOD = 1000000007; #define SET(x) memset(x, 0, sizeof(x)) #define SET2d(x, m, n) mem...
replace
88
89
88
89
0
p02641
C++
Runtime Error
#include <algorithm> #include <iostream> int main() { int X, N, *p, dif = 1, num = -1; std::cin >> X >> N; p = new int[N + 2]; for (int i = 0; i < N; i++) { std::cin >> p[i]; } p[N + 1] = -1000; p[N + 2] = 1000; std::sort(p, p + N); for (int i = 0; i < N; i++) { if (p[i] == X) num = i; ...
#include <algorithm> #include <iostream> int main() { int X, N, *p, dif = 1, num = -1; std::cin >> X >> N; p = new int[N + 2]; for (int i = 0; i < N; i++) { std::cin >> p[i]; } p[N] = -1000; p[N + 1] = 1000; std::sort(p, p + N + 2); for (int i = 1; i < N + 1; i++) { if (p[i] == X) num =...
replace
10
14
10
14
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a ...
insert
47
47
47
57
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #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 mset(s, _) memset(s, _, sizeof s) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int>...
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #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 mset(s, _) memset(s, _, sizeof s) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int>...
replace
12
13
12
13
-11
p02641
C++
Runtime Error
#include <bits/stdc++.h> #include <cassert> #include <numeric> using namespace std; typedef long long ll; typedef long double ld; using graph = vector<vector<int>>; using pii = pair<int, int>; using pll = pair<ll, ll>; using qi = queue<int>; using qpii = queue<pii>; using pqi = priority_queue<int>; using pqr = priorit...
#include <bits/stdc++.h> #include <cassert> #include <numeric> using namespace std; typedef long long ll; typedef long double ld; using graph = vector<vector<int>>; using pii = pair<int, int>; using pll = pair<ll, ll>; using qi = queue<int>; using qpii = queue<pii>; using pqi = priority_queue<int>; using pqr = priorit...
replace
213
214
213
214
0
p02641
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <numeric> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(a) (a).begin(), (a).end() #define REP(i, n) for (size_t i = 0; i < (n); i++) #define nvec(T, v, n) ...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <numeric> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(a) (a).begin(), (a).end() #define REP(i, n) for (size_t i = 0; i < (n); i++) #define nvec(T, v, n) ...
replace
75
76
75
76
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> x >> n; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v[i]; sort(v.begin(), v.end()); int ans = -1, diff = 1001; for (int i = 1; i <= v[n - 1] + 1; i++) { if (binary_search(v.begin(), v.end(), i)) continue; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> x >> n; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v[i]; sort(v.begin(), v.end()); int ans = -1, diff = 1001; if (n > 0) { for (int i = 0; i <= v[n - 1] + 1; i++) { if (binary_search(v.begin(), v.end(), i)...
replace
11
17
11
19
0
p02641
C++
Time Limit Exceeded
/* author:@bhaskar_8998 */ #include <bits/stdc++.h> using namespace std; typedef long long i64; typedef vector<i64> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef map<int, int> mi; #define all(A) (A).begin(), (A).end() #define pb push_back #define MOD 1000000007 #define ff first #define ss second #def...
/* author:@bhaskar_8998 */ #include <bits/stdc++.h> using namespace std; typedef long long i64; typedef vector<i64> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef map<int, int> mi; #define all(A) (A).begin(), (A).end() #define pb push_back #define MOD 1000000007 #define ff first #define ss second #def...
replace
49
50
49
50
TLE
p02641
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int using namespace std; bool sortbysec(const pair<ll, ll> &a, const pair<ll, ll> &b) { return (a.second < b.second); } int main() { ll t, i, j, k, n, l, x, y; cin >> x >> n; map<ll, ll> m; if (n == 0) { cout << x << endl; return 0; } vector<pair<ll, ...
#include <bits/stdc++.h> #define ll long long int using namespace std; bool sortbysec(const pair<ll, ll> &a, const pair<ll, ll> &b) { return (a.second < b.second); } int main() { ll t, i, j, k, n, l, x, y; cin >> x >> n; map<ll, ll> m; if (n == 0) { cout << x << endl; return 0; } vector<pair<ll, ...
replace
21
22
21
22
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define M 200005 #define MOD 1000000007 #define PI 3.14159265358979323846 #define ep emplace_back #define mk make_pair #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() typedef long long int lli; typedef unsigned long long int ulli; typedef pa...
#include <bits/stdc++.h> using namespace std; #define M 200005 #define MOD 1000000007 #define PI 3.14159265358979323846 #define ep emplace_back #define mk make_pair #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() typedef long long int lli; typedef unsigned long long int ulli; typedef pa...
replace
34
35
34
35
0
p02641
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #includ...
replace
43
44
43
44
0
p02641
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int x, n; // a+b=x;2*a + 4*b=y; cin >> x >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); set<int> st; for (int i = 0; i < n; i++) st.insert(a[i]); int dif = 0; while (1) { if (st.f...
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int x, n; // a+b=x;2*a + 4*b=y; cin >> x >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); set<int> st; for (int i = 0; i < n; i++) st.insert(a[i]); int dif = 0; while (1) { if (st.f...
insert
24
24
24
25
TLE
p02641
Python
Runtime Error
x, n = map(int, input().split()) p = list(map(int, input().split())) min = float("inf") for i in range(1, 101)[::-1]: if abs(x - i) <= min: if i not in p: min = abs(x - i) ans = i print(ans)
x, n = map(int, input().split()) p = list(map(int, input().split())) min = float("inf") for i in range(0, 102)[::-1]: if abs(x - i) <= min: if i not in p: min = abs(x - i) ans = i print(ans)
replace
4
5
4
5
0
p02641
Python
Runtime Error
x, n = map(int, input().split()) if n != 0: p = list(map(int, input().split())) else: print(x) exit(1) dif = 100 ans = 0 for i in range(min(p) - 1, max(p) + 2): if not (i in p): if dif > abs(x - i): dif = abs(x - i) ans = i print(ans)
x, n = map(int, input().split()) if n != 0: p = list(map(int, input().split())) else: print(x) exit() dif = 100 ans = 0 for i in range(min(p) - 1, max(p) + 2): if not (i in p): if dif > abs(x - i): dif = abs(x - i) ans = i print(ans)
replace
6
7
6
7
0
p02641
Python
Runtime Error
import numpy as np X, N = map(int, input().split()) P = list(map(int, input().split())) candidate = list(range(1, 101)) P = sorted(set(candidate).difference(set(P))) i = np.argmin([abs(p - X) for p in P]) print(P[i])
import numpy as np X, N = map(int, input().split()) P = list(map(int, input().split())) candidate = list([x - 500 for x in range(1, 1000)]) P = sorted(set(candidate).difference(set(P))) i = np.argmin([abs(p - X) for p in P]) print(P[i])
replace
4
5
4
5
TLE
p02641
C++
Runtime Error
/* (: ///////|||||| BEGINS |||||||\\\\ :) */ /* REMEMBER Deletes all characters except first one Deletes 4 characters from index number 1 str.erase(1); str.erase(1,4); Deletes character at position 4 str.erase(str.begin() + 4); bool compare(const pair<int, int>&a, const pair<int, int>...
/* (: ///////|||||| BEGINS |||||||\\\\ :) */ /* REMEMBER Deletes all characters except first one Deletes 4 characters from index number 1 str.erase(1); str.erase(1,4); Deletes character at position 4 str.erase(str.begin() + 4); bool compare(const pair<int, int>&a, const pair<int, int>...
replace
83
84
83
84
-11
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(void) { int X, N; cin >> X >> N; int check = 0; vector<int> list(100); rep(i, N) { cin >> check; list.at(check - 1) = 1; check = 0; } for (int j = 0; j < 500; j++) { if (X - j - 1...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(void) { int X, N; cin >> X >> N; int check = 0; vector<int> list(100); rep(i, N) { cin >> check; list.at(check - 1) = 1; check = 0; } for (int j = 0; j < 500; j++) { if (X - j - 1...
replace
27
28
27
28
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define endl '\n' using namespace std; #define N 100007 #define pb push_back; vector<ll> v[N]; vector<bool> vs(N); #define FAST \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define ll long long #define endl '\n' using namespace std; #define N 100007 #define pb push_back; vector<ll> v[N]; vector<bool> vs(N); #define FAST \ ios_base::sync_with_stdio(false); ...
replace
22
23
22
23
0
p02641
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int x, n, i, j; cin >> x; cin >> n; int p[n]; for (int i = 0; i < n; i++) { cin >> p[i]; } i = 0; while (1) { for (j = 0; j < n; j++) { if (p[j] == x + i) { j = 0; break; } } if (j != 0) { cout << ...
#include <iostream> using namespace std; int main() { int x, n, i, j; cin >> x; cin >> n; int p[n]; if (n == 0) { cout << x << endl; return 0; } for (int i = 0; i < n; i++) { cin >> p[i]; } i = 0; while (1) { for (j = 0; j < n; j++) { if (p[j] == x + i) { j = 0; ...
insert
8
8
8
13
TLE
p02641
C++
Time Limit Exceeded
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; // #define int cpp_int using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \...
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; // #define int cpp_int using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \...
insert
68
68
68
73
TLE
p02641
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a =...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a =...
insert
24
24
24
28
TLE
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int x, n, ans = 100, tmp = 100; cin >> x >> n; vector<int> p(n), test(100); for (int i = 0; i <= 100; i++) test.at(i) = i; for (int i = 0; i < n; i++) { cin >> p.at(i); test.erase(remove(test.begin(), test.end(), p.at(i)), test.end()); ...
#include <bits/stdc++.h> using namespace std; int main() { int x, n, ans = 100, tmp = 100; cin >> x >> n; vector<int> p(n), test(102); for (int i = 0; i <= 101; i++) test.at(i) = i; for (int i = 0; i < n; i++) { cin >> p.at(i); test.erase(remove(test.begin(), test.end(), p.at(i)), test.end()); ...
replace
6
8
6
8
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 100) >= this->size() (which is 100)
p02641
C++
Runtime Error
#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> p(100); for (int i = 0; i < n; i++) { int t = 0; cin >> t; p.at(t) = 1; } for (int i = 0; i < 100; i++) { if (p[x - i] != 1) { cou...
#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> p(100); for (int i = 0; i < n; i++) { int t = 0; cin >> t; p[t]++; } for (int i = 0; i < 100; i++) { if (p[x - i] != 1) { cout << ...
replace
15
16
15
16
0
p02641
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> int main() { int x, n; std::cin >> x >> n; std::vector<int> p(n); for (int i = 0; i < n; ++i) std::cin >> p[i]; int minD = 1000; int result = 0; for (int j = 200; j > -100; ++j) { if (std::any_of(p.begin(), p.end(), [j](int v) { return ...
#include <algorithm> #include <iostream> #include <vector> int main() { int x, n; std::cin >> x >> n; std::vector<int> p(n); for (int i = 0; i < n; ++i) std::cin >> p[i]; int minD = 1000; int result = 0; for (int j = 200; j > -100; --j) { if (std::any_of(p.begin(), p.end(), [j](int v) { return ...
replace
14
15
14
15
TLE
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define IOS \ ios_base::sync_with_stdio(0); \ cin.tie(0) /* start */ int was[110]; signed main() { IOS; int x, n; cin >> x >> ...
#include <bits/stdc++.h> using namespace std; #define int long long #define IOS \ ios_base::sync_with_stdio(0); \ cin.tie(0) /* start */ int was[110]; signed main() { IOS; int x, n; cin >> x >> ...
replace
20
22
20
25
0
p02641
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> int main() { int X, N; std::cin >> X >> N; std::vector<int> P(N); int Distance = 0; int ans; for (auto &p : P) { std::cin >> p; } while (1) { auto itr1 = std::find(P.begin(), P.end(), X - Distance); auto itr2 = std::find(P.begin(), ...
#include <algorithm> #include <iostream> #include <vector> int main() { int X, N; std::cin >> X >> N; std::vector<int> P(N); int Distance = 0; int ans; for (auto &p : P) { std::cin >> p; } while (1) { auto itr1 = std::find(P.begin(), P.end(), X - Distance); auto itr2 = std::find(P.begin(), ...
replace
23
24
23
24
TLE
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long MOD = 1000000007; #define fil(x) memset(x, 0, sizeof(x)) #define fillb(x) memset(x, false, sizeof(x)) #define fillm(x) memset(x, -1, sizeof(x)) #define mp make_pair #define pll pair<int, int> #define pf printf #define sf scanf #define all(x) x.begin(), x.end...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1000000007; #define fil(x) memset(x, 0, sizeof(x)) #define fillb(x) memset(x, false, sizeof(x)) #define fillm(x) memset(x, -1, sizeof(x)) #define mp make_pair #define pll pair<int, int> #define pf printf #define sf scanf #define all(x) x.begin(), x.end...
replace
66
67
66
67
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() using ll = long long; int main() { int i, x, n, ans = 0, dist = 999, j = 0; cin >> x >> n; vector<int> p(n); for (i = 0; i < n; i++) cin >> p[i]; sort(p.begin(), p.end()); for (i = 1; i < x; i++) { if (i != p[j]) { ...
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() using ll = long long; int main() { int i, x, n, ans = 0, dist = 999, j = 0; cin >> x >> n; if (n == 0) { cout << x; return 0; } vector<int> p(n); for (i = 0; i < n; i++) cin >> p[i]; sort(p.begin(), p.end()); ...
insert
8
8
8
12
0
p02641
C++
Runtime Error
#ifdef LOCAL #include <header.hpp> #else #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/priority_queue.hpp> #endif #define lp(i, l, r) for (auto i = regu(l); i <= decltype(i)(r); ++i) #define rp(i, r, l) for (auto i = regu(r); i >= decltype(i)(l); --i) #define lv(i, a) for (int i ...
#ifdef LOCAL #include <header.hpp> #else #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/priority_queue.hpp> #endif #define lp(i, l, r) for (auto i = regu(l); i <= decltype(i)(r); ++i) #define rp(i, r, l) for (auto i = regu(r); i >= decltype(i)(l); --i) #define lv(i, a) for (int i ...
replace
177
178
177
179
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define MAX 1000000 int main() { int x, n; cin >> x >> n; vector<int> in(101, 0); int p; for (int i = 0; i < n; i++) { cin >> p; in.at(p)++; } int dis = 99999; int ans; for (int i = 0; i <= 101; i++) {...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define MAX 1000000 int main() { int x, n; cin >> x >> n; vector<int> in(102, 0); int p; for (int i = 0; i < n; i++) { cin >> p; in.at(p)++; } int dis = 99999; int ans; for (int i = 0; i <= 101; i++) {...
replace
10
11
10
11
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 101) >= this->size() (which is 101)
p02641
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair<int, int>; const int INF = 2e9; int main() { int x, n; cin >> x >> n; vector<int> p(n); rep(i, n) cin >> p[i]; sort(p.begin(), p.end()); queue<int> que; int j = 0; rep(i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair<int, int>; const int INF = 2e9; int main() { int x, n; cin >> x >> n; if (n == 0) { cout << x << endl; return 0; } vector<int> p(n); rep(i, n) cin >> p[i]; sort(p....
insert
11
11
11
15
0
p02641
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <tuple> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> ...
#include <algorithm> #include <cassert> #include <cmath> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <tuple> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> ...
insert
364
364
364
365
TLE
p02641
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; using P = pair<int, int>; int main() { int x, n; cin >> x >> n; vector<int> d(n); for (int i = 0; i < n; ++i) { int p; cin >> p; d[p] = 1; } P ans(99999, -1); for (int i = 0; i <= 101; ++i) { if (d[i] == 1) continue; in...
#include <iostream> #include <vector> using namespace std; using P = pair<int, int>; int main() { int x, n; cin >> x >> n; vector<int> d(102); for (int i = 0; i < n; ++i) { int p; cin >> p; d[p] = 1; } P ans(99999, -1); for (int i = 0; i <= 101; ++i) { if (d[i] == 1) continue; ...
replace
8
9
8
9
-6
malloc(): corrupted top size
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int target, n; cin >> target >> n; if (n == 0) { cout << target << endl; return 0; } vector<int> ex(n); for (int i = 0; i < n; i++) { cin >> ex.at(i); } vector<int> dx(101); for (int i = 0; i < n; i++) { dx.at(ex.at(i)) = ...
#include <bits/stdc++.h> using namespace std; int main() { int target, n; cin >> target >> n; if (n == 0) { cout << target << endl; return 0; } vector<int> ex(n); for (int i = 0; i < n; i++) { cin >> ex.at(i); } vector<int> dx(202); for (int i = 0; i < n; i++) { dx.at(ex.at(i)) = ...
replace
17
18
17
18
0
p02641
C++
Time Limit Exceeded
// AUTHOR wiley_codechef // TASK : Atcoder //--------------------------------HEADERS-------------------------------------------------------------// #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #includ...
// AUTHOR wiley_codechef // TASK : Atcoder //--------------------------------HEADERS-------------------------------------------------------------// #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #includ...
replace
330
348
330
354
TLE
p02641
C++
Runtime Error
#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++) { ...
replace
16
17
16
17
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repc(i, a, b) for (int i = a; i <= (int)(b); i++) #define ll long long #define vec vector #define ft first #define sd second #define all(vec) vec.begin(), vec.end() typedef pair<int, int> P; const int MOD = 1e9 +...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repc(i, a, b) for (int i = a; i <= (int)(b); i++) #define ll long long #define vec vector #define ft first #define sd second #define all(vec) vec.begin(), vec.end() typedef pair<int, int> P; const int MOD = 1e9 +...
insert
30
30
30
34
0
p02641
C++
Time Limit Exceeded
#include <iostream> #include <math.h> using namespace std; int main() { int X, N; cin >> X >> N; int *p; p = new int[N]; for (int i = 0; i < N; i++) { cin >> p[i]; } bool found = true; int output = 0; for (int i = 0; i < N; i++) { if (p[i] == X) { found = true; i = N; } e...
#include <iostream> #include <math.h> using namespace std; int main() { int X, N; cin >> X >> N; int *p; p = new int[N]; for (int i = 0; i < N; i++) { cin >> p[i]; } bool found = true; int output = 0; for (int i = 0; i < N; i++) { if (p[i] == X) { found = true; i = N; } e...
insert
28
28
28
34
TLE
p02641
C++
Runtime Error
#include <bits/stdc++.h> #define fin \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define ii pair<int, int> #define F fi...
#include <bits/stdc++.h> #define fin \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define ii pair<int, int> #define F fi...
replace
46
47
46
47
0
Time elapsed: 0.025323 s.
p02641
Python
Runtime Error
X, N = map(int, input().split()) p = list(map(int, input().split())) if p: x = [i for i in range(1, max(p)) if i not in p] c = x.pop() a = abs(c - X) for i in x: if abs(i - X) < a: c = i print(c) else: print(X)
X, N = map(int, input().split()) p = list(map(int, input().split())) i = 0 while True: if X - i not in p: print(X - i) break elif X + i not in p: print(X + i) break i += 1
replace
3
14
3
12
0
p02641
Python
Runtime Error
def main(): x, n = map(int, input().split()) p = list(map(int, input().split())) min = 1000 for i in range(1, 101): if i in p: continue elif min > abs(x - i): result = i min = abs(x - i) print(result) if __name__ == "__main__": main()
def main(): x, n = map(int, input().split()) p = list(map(int, input().split())) min = 1000 for i in range(-50, 150): if i in p: continue elif min > abs(x - i): result = i min = abs(x - i) print(result) if __name__ == "__main__": main()
replace
6
7
6
7
0
p02641
Python
Runtime Error
x, n = map(int, input().split()) if n != 0: p = list(map(int, input().split())) if x in p: for i in range(-1000, 1001): print(i) if i == -100: mini = i if i in p: pass else: if abs(x - mini) > abs(x - i): ...
x, n = map(int, input().split()) if n != 0: p = list(map(int, input().split())) if x in p: for i in range(-1000, 1001): if i == -1000: mini = i if i in p: pass else: if abs(x - mini) > abs(x - i): min...
replace
5
7
5
6
NameError: name 'mini' is not defined. Did you mean: 'min'?
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02641/Python/s131160105.py", line 12, in <module> if abs(x - mini) > abs(x - i): NameError: name 'mini' is not defined. Did you mean: 'min'?
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll l...
#include <bits/stdc++.h> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll l...
replace
190
193
190
193
0
p02641
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <set> #include <utility> #include <vector> using namespace std; void forbidden_list(vector<int> v, int x); int main() { int x, n; vector<int> v; cin >> x >> n; for (int i = 0; i < n; i++) { int l; cin >> l; v.push_back(l); } ...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <set> #include <utility> #include <vector> using namespace std; void forbidden_list(vector<int> v, int x); int main() { int x, n; vector<int> v; cin >> x >> n; for (int i = 0; i < n; i++) { int l; cin >> l; v.push_back(l); } ...
replace
31
32
31
32
0
p02641
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int X, N; cin >> X >> N; if (N == 0) { cout << X << endl; return 0; } int tmp = 0; vector<int> P(N); for (int i = 0; i < N; i++) { cin >> tmp; P.at(i) = tmp; } sort(P.begin(), P.end()); vect...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int X, N; cin >> X >> N; if (N == 0) { cout << X << endl; return 0; } int tmp = 0; vector<int> P(N); for (int i = 0; i < N; i++) { cin >> tmp; P.at(i) = tmp; } sort(P.begin(), P.end()); vect...
insert
30
30
30
33
0
p02641
C++
Time Limit Exceeded
#include <climits> #include <cmath> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define MOD 1000000007LL int main() { int x, n; int p; bool q[101]; int i; cin >> x >> n; if (n == 0) { printf("%...
#include <climits> #include <cmath> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define MOD 1000000007LL int main() { int x, n; int p; bool q[101]; int i; cin >> x >> n; if (n == 0) { printf("%...
insert
45
45
45
46
TLE
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; int main() { int x, n; cin >> x >> n; vector<bool> h(102); rep(i, 102) { int p; cin >> p; h[p] = true; } pair<int, int> ans(10...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; int main() { int x, n; cin >> x >> n; vector<bool> h(102); rep(i, n) { int p; cin >> p; h[p] = true; } pair<int, int> ans(1000...
replace
11
12
11
12
0
p02641
C++
Runtime Error
#include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <random> #include <stack> #include <string> #include <algorithm> #include <fstream> #include <vector> #define ll long long int using namespace std; int main(void) { int x, n, tmp; int res, res_u; vector<int> p; cin >> x >> n...
#include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <random> #include <stack> #include <string> #include <algorithm> #include <fstream> #include <vector> #define ll long long int using namespace std; int main(void) { int x, n, tmp; int res, res_u; vector<int> p; cin >> x >> n...
replace
44
46
44
48
0
p02641
Python
Runtime Error
X, N = map(int, input().split()) P = set(list(map(int, input().split()))) targets = set(range(1, 101)) - P print(min([(target, abs(X - target)) for target in targets], key=lambda x: x[1])[0])
X, N = map(int, input().split()) P = set(list(map(int, input().split()))) targets = set(range(-101, 102)) - P if targets: print(min([(target, abs(X - target)) for target in targets], key=lambda x: x[1])[0]) else: print(X)
replace
3
5
3
8
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() int main() { int X, Y, min, ans, j; cin >> X >> Y; vector<int> box(100, 10000); rep(i, Y) { cin >> box.at(i); } sort(box.begin(), box.begin() + Y); min ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() int main() { int X, Y, min, ans, j; cin >> X >> Y; vector<int> box(1000, 10000); rep(i, Y) { cin >> box.at(i); } sort(box.begin(), box.begin() + Y); min...
replace
9
10
9
10
0
p02641
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; // Loop #define REP(i, a, b) for (ll(i) = (a); (i) < (b); (i)++) #define RREP(i, a, b) for (ll(i) = (a); (i) >= (b); (i)--) #define rep(i, n) REP(i, 0, n) #define rrep(i, n) RREP(i, n, 0) #define ALL(v) v.begin(), v.end() con...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; // Loop #define REP(i, a, b) for (ll(i) = (a); (i) < (b); (i)++) #define RREP(i, a, b) for (ll(i) = (a); (i) >= (b); (i)--) #define rep(i, n) REP(i, 0, n) #define rrep(i, n) RREP(i, n, 0) #define ALL(v) v.begin(), v.end() con...
replace
22
24
22
24
0
p02641
Python
Runtime Error
X, N = map(int, input().split()) A = list(map(int, input().split())) tmp = 1000 result = [] result2 = [] for i in range(1, 101): if i in A: continue hoge = abs(X - i) if hoge <= tmp: tmp = hoge result2.append(tmp) result.append(i) result3 = [] for i, v in enumerate(result2...
X, N = map(int, input().split()) A = list(map(int, input().split())) tmp = 1000 result = [] result2 = [] for i in range(0, 102): if i in A: continue hoge = abs(X - i) if hoge <= tmp: tmp = hoge result2.append(tmp) result.append(i) result3 = [] for i, v in enumerate(result2...
replace
6
7
6
7
0
p02641
Python
Runtime Error
X, N = map(int, input().split()) if N == 0: print(X) else: p = list(map(int, input().split())) q = [i for i in range(-1, 102)] for r in p: idx = q.index(r) del q[idx] if X in q: print(X) else: q.sort() mindif = 100 for num in q: d...
X, N = map(int, input().split()) if N == 0: print(X) else: p = list(map(int, input().split())) q = [i for i in range(-1, 102)] for r in p: idx = q.index(r) del q[idx] if X in q: print(X) else: q.sort() mindif = 1000 for num in q: ...
replace
18
19
18
19
0
p02641
Python
Runtime Error
x, n = map(int, input().split()) p = [int(_) for _ in input().split()] not_in_p = [i for i in range(0, 102) if i not in p] nip_temp = list(map(lambda s: abs(x - s), not_in_p)) address = nip_temp.index(min(nip_temp)) print(p[address])
x, n = map(int, input().split()) p = [int(_) for _ in input().split()] not_in_p = [i for i in range(0, 102) if i not in p] nip_temp = list(map(lambda s: abs(x - s), not_in_p)) address = nip_temp.index(min(nip_temp)) print(not_in_p[address])
replace
7
8
7
8
0
p02641
Python
Runtime Error
import numpy as np X, N = map(int, input().split()) P = np.array(list(map(int, input().split()))) P = P - X for i in range(0, X): if i not in P or -i not in P: if -i not in P: ans = X - i else: ans = X + i break print(ans)
import numpy as np X, N = map(int, input().split()) P = np.array(list(map(int, input().split()))) P = P - X for i in range(0, X + 1): if i not in P or -i not in P: if -i not in P: ans = X - i else: ans = X + i break print(ans)
replace
7
8
7
8
TLE
p02642
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <iostream> using namespace std; #define ll long long const ll N = 2e5 + 507, N1 = 1e6 + 107; ; ll n, i, maxx, nr, j, a[N], f[N]; bitset<N1> g; int main() { cin >> n; for (i = 1; i <= n; ++i) cin >> a[i], f[a[i]]++; sort(a + 1, a + n + 1); ma...
#include <algorithm> #include <bitset> #include <climits> #include <iostream> using namespace std; #define ll long long const ll N = 2e5 + 507, N1 = 1e6 + 107; ll n, i, maxx, nr, j, a[N], f[N1]; bitset<N1> g; int main() { cin >> n; for (i = 1; i <= n; ++i) cin >> a[i], f[a[i]]++; sort(a + 1, a + n + 1); max...
replace
7
9
7
8
0
p02642
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> #include <string> using namespace std; #include <iomanip> #include <math.h> #include <queue> #include <vector> using Graph = vector<vector<int>>; const double PI = 3.14159265358979323846; long long modpow(long long a, long long n, long long mod) { long ...
#include <algorithm> #include <functional> #include <iostream> #include <string> using namespace std; #include <iomanip> #include <math.h> #include <queue> #include <vector> using Graph = vector<vector<int>>; const double PI = 3.14159265358979323846; long long modpow(long long a, long long n, long long mod) { long ...
replace
43
45
43
45
0
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef int ll; vector<ll> input; vector<ll> divi[1000005]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll i, j, k, l, m, n, t; cin >> n; for (i = 0; i < n; i++) { cin >> k; input.push_back(k); } for (i = 1; i <= 1000005; i++) {...
#include <bits/stdc++.h> using namespace std; typedef int ll; vector<ll> input; vector<ll> divi[1000005]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll i, j, k, l, m, n, t; cin >> n; for (i = 0; i < n; i++) { cin >> k; input.push_back(k); } for (i = 1; i < 1000001; i++) { ...
replace
20
22
20
22
TLE
p02642
C++
Time Limit Exceeded
// clang-format off #include <bits/stdc++.h> using namespace std; #define int long long #define stoi stoll using pii = pair<int,int>; using vi = vector<int>; using vvi = vector<vi>; #define all(c) begin(c), end(c) #define rall(c) rbegin(c), rend(c) #define fore(x, c) for(auto &&x : c) #define rep(i, a, n) for(int i = a...
// clang-format off #include <bits/stdc++.h> using namespace std; #define int long long #define stoi stoll using pii = pair<int,int>; using vi = vector<int>; using vvi = vector<vi>; #define all(c) begin(c), end(c) #define rall(c) rbegin(c), rend(c) #define fore(x, c) for(auto &&x : c) #define rep(i, a, n) for(int i = a...
replace
46
47
46
47
TLE
p02642
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; bool compare(int a, int b) { return a > b; } int main() { int x, n, i, ans, j, temp, maxi, k; int flag[200100] = {0}; int mark[100100] = {0}; int flag2[100100] = {0}; cin >> n; for (i = 0; i < n; i++) { cin >> flag[i]; flag2[flag[i]]++; ...
#include <algorithm> #include <iostream> using namespace std; bool compare(int a, int b) { return a > b; } int main() { int x, n, i, ans, j, temp, maxi, k; int flag[200100] = {0}; int mark[1001000] = {0}; int flag2[1001000] = {0}; cin >> n; for (i = 0; i < n; i++) { cin >> flag[i]; flag2[flag[i]]++...
replace
7
9
7
9
0
p02642
C++
Runtime Error
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include <bits/stdc++.h> using namespace std; const int M = 1000000; int main() { int n; cin >> n; vector<int> A(n); rep(i, n) cin >> A[i]; vector<int> C(M); for (auto t ...
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include <bits/stdc++.h> using namespace std; const int M = 1000010; int main() { int n; cin >> n; vector<int> A(n); rep(i, n) cin >> A[i]; vector<int> C(M); for (auto t ...
replace
8
9
8
9
0
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, a[200005], ans, ada[200005]; int main() { ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0); cin >> n; memset(ada, 0, sizeof ada); for (int i = 1; i <= n; i++) { cin >> a[i]; ada[a[i]]++; } sort(a + 1, a + n + 1); ans = 0; for (int...
#include <bits/stdc++.h> using namespace std; int n, a[2000005], ans, ada[2000005]; int main() { ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0); cin >> n; memset(ada, 0, sizeof ada); for (int i = 1; i <= n; i++) { cin >> a[i]; ada[a[i]]++; } sort(a + 1, a + n + 1); ans = 0; for (i...
replace
3
4
3
4
0
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<ll> vi; typedef vector<bool> vb; #define mp make_pair #define pb push_back #define eb emplace_back #define sq(x) ((x) * (x)) #define fo(i, n) for (int ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<ll> vi; typedef vector<bool> vb; #define mp make_pair #define pb push_back #define eb emplace_back #define sq(x) ((x) * (x)) #define fo(i, n) for (int ...
replace
44
45
44
45
0
p02642
C++
Runtime Error
#include <bits/stdc++.h> using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) using namespace std; int main() { ll n; cin >> n; vector<ll> a(n); rep(i, n) cin >> a[i]; vector<ll> b(100001, 0); rep(i, n) b[a[i]]++; ll ans = n; rep(i, n) { for (ll j = 1; j * j <= a[i]; j++) { i...
#include <bits/stdc++.h> using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) using namespace std; int main() { ll n; cin >> n; vector<ll> a(n); rep(i, n) cin >> a[i]; vector<ll> b(1000001, 0); rep(i, n) b[a[i]]++; ll ans = n; rep(i, n) { for (ll j = 1; j * j <= a[i]; j++) { ...
replace
10
11
10
11
0
p02642
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <type_traits> #include <utility> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <type_traits> #include <utility> #include <...
replace
27
28
27
28
0
p02642
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define reps(i, n) for (int i = 1; i <=...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define reps(i, n) for (int i = 1; i <=...
insert
66
66
66
69
TLE
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPr(i, n) for (int i = (n)-1; i >= 0; --i) #define FORq(i, m, n) for (int i = (m); i <= (n); ++i) #define FORqr(i, m, n) for (int i = (n); i >= (m); --i) #define M...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPr(i, n) for (int i = (n)-1; i >= 0; --i) #define FORq(i, m, n) for (int i = (m); i <= (n); ++i) #define FORqr(i, m, n) for (int i = (n); i >= (m); --i) #define M...
insert
57
57
57
58
TLE
p02642
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; using ll = long long; 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 < b) { a = b; re...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; using ll = long long; 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 < b) { a = b; re...
replace
67
68
67
68
-11
p02642
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> int h[1000005]; int a[100005], n, ans, m; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0), std::cout.tie(0); std::cin >> n; for (int i = 1; i <= n; ++i) { std::cin >> a[i]; ++h[a[i]]; m = std::max(m, a[i]); } std::sort(a + 1, a + n + ...
#include <algorithm> #include <iostream> int h[1000005]; int a[200005], n, ans, m; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0), std::cout.tie(0); std::cin >> n; for (int i = 1; i <= n; ++i) { std::cin >> a[i]; ++h[a[i]]; m = std::max(m, a[i]); } std::sort(a + 1, a + n + ...
replace
3
4
3
4
TLE
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, start, count) for (int i = (start); i < (int)(count); ++i) #define rep(i, count) REP(i, 0, count) #define ALLOF(c) (c).begin(), (c).end() using ll = long long; using ull = unsigned long long; using veci = vector<int>; using vecll = vector<ll>; using vecull ...
#include <bits/stdc++.h> using namespace std; #define REP(i, start, count) for (int i = (start); i < (int)(count); ++i) #define rep(i, count) REP(i, 0, count) #define ALLOF(c) (c).begin(), (c).end() using ll = long long; using ull = unsigned long long; using veci = vector<int>; using vecll = vector<ll>; using vecull ...
replace
26
28
26
28
0
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, k) for (int i = j; i < k; i++) int main() { ll N; cin >> N; vector<ll> A(N), so(1000008, 0); rep(i, 0, N) cin >> A[i]; sort(A.begin(), A.end()); ll res = 0; rep(i, 0, N) { bool x = false; if (i && A[i - 1] ==...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, k) for (int i = j; i < k; i++) int main() { ll N; cin >> N; vector<ll> A(N), so(1000008, 0); rep(i, 0, N) cin >> A[i]; sort(A.begin(), A.end()); ll res = 0; rep(i, 0, N) { bool x = false; if (i && A[i - 1] ==...
replace
21
22
21
22
TLE
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int M = 2 * 1e5 + 10; int main() { int n; cin >> n; vector<int> unique; vector<int> ok(M, 0); for (int i = 0; i < n; ++i) { int a; cin >> a; if (ok[a] == 0) { unique.push_back(a); ok[a] = 1; } else if (ok[a] == 1) { ok[a] =...
#include <bits/stdc++.h> using namespace std; const int M = 2 * 1e6 + 10; int main() { int n; cin >> n; vector<int> unique; vector<int> ok(M, 0); for (int i = 0; i < n; ++i) { int a; cin >> a; if (ok[a] == 0) { unique.push_back(a); ok[a] = 1; } else if (ok[a] == 1) { ok[a] =...
replace
2
3
2
3
0
p02642
C++
Time Limit Exceeded
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define all(v) (v).begin(), (v).end() #define repeat(cnt, l) \ for (typename remove_const< \ typename...
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define all(v) (v).begin(), (v).end() #define repeat(cnt, l) \ for (typename remove_const< \ typename...
insert
192
192
192
194
TLE
p02642
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define int long long signed main() { cin.tie(0); ios::sync_with_stdio(0); int n; cin >> n; vector<int> a(n); for (int i = 0; ...
#include <algorithm> #include <array> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define int long long signed main() { cin.tie(0); ios::sync_with_stdio(0); int n; cin >> n; vector<int> a(n); for (int i = 0; ...
replace
21
22
21
22
TLE
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A.at(i); sort(A.begin(), A.end()); vector<pair<int, int>> B; set<int> ans_check; B.push_back(make_pair(A.at(0), 1)); int index = 0; for (int i = 1; i < N; i++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A.at(i); sort(A.begin(), A.end()); vector<pair<int, int>> B; set<int> ans_check; B.push_back(make_pair(A.at(0), 1)); int index = 0; for (int i = 1; i < N; i++) { ...
insert
53
53
53
54
TLE
p02642
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> typedef long long ll; using namespace std; const ll M = 1e6; int main() { int N; cin >> N; vector<ll> A(N); vector<ll> B(M + 1, 0);...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> typedef long long ll; using namespace std; const ll M = 1e6; int main() { int N; cin >> N; vector<ll> A(N); vector<ll> B(M + 1, 0);...
insert
24
24
24
30
TLE
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int N = 200010, M = 1000099; int a[N]; int t[M]; int main() { ; freopen("in.txt", "r", stdin); int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", a + i); t[a[i]]++; } int mmax = *max_element(a, a + n); sort(a, a + n); int cnt =...
#include <bits/stdc++.h> using namespace std; const int N = 200010, M = 1000099; int a[N]; int t[M]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", a + i); t[a[i]]++; } int mmax = *max_element(a, a + n); sort(a, a + n); int cnt = 0; for (int i = 0; i < n; i++) { ...
delete
6
8
6
6
TLE
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> #ifdef LOCAL #include "lib/debug.hpp" #else #define debug(...) 1 #endif #define ALL(a) (a).begin(), (a).end() #define rep(i, n) REP(i, 0, (n)) #define repc(i, n) REPC(i, 0, (n)) #define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++) #define REPC(i, n, m) for (int i = (int)(n); i <= (int...
#include <bits/stdc++.h> #ifdef LOCAL #include "lib/debug.hpp" #else #define debug(...) 1 #endif #define ALL(a) (a).begin(), (a).end() #define rep(i, n) REP(i, 0, (n)) #define repc(i, n) REPC(i, 0, (n)) #define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++) #define REPC(i, n, m) for (int i = (int)(n); i <= (int...
replace
43
46
43
48
TLE
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() typedef long long ll; #define MOD 1000000007 using namespace std; vector<ll> divisor(ll n) { vector<ll> ret; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } ...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() typedef long long ll; #define MOD 1000000007 using namespace std; vector<ll> divisor(ll n) { vector<ll> ret; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } ...
replace
20
21
20
21
TLE
p02642
C++
Time Limit Exceeded
#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 > ...
replace
52
53
52
53
TLE
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using vl = vector<ll>; using vvl = vector<vector<ll>>; #define all(x) x.begin(), x.end() #define rep(i, j, n) for (int i = j; i < (int)(n); i++) signed main() { ll n; cin >> n; vl vec(n); ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using vl = vector<ll>; using vvl = vector<vector<ll>>; #define all(x) x.begin(), x.end() #define rep(i, j, n) for (int i = j; i < (int)(n); i++) signed main() { ll n; cin >> n; vl vec(n); ...
replace
15
16
15
16
TLE
p02642
C++
Time Limit Exceeded
// KEEP GRINDING #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_upda...
// KEEP GRINDING #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_upda...
replace
65
68
65
71
TLE
p02642
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> int main() { int n; std::cin >> n; int64_t aMax = 0; std::vector<int64_t> a(n); for (int i = 0; i != n; i++) { std::cin >> a[i]; if (a[i] > aMax) aMax = a[i]; } std::vector<bool> dp(aMax, true); std::vector<bool> seen(aMax, fals...
#include <algorithm> #include <iostream> #include <vector> int main() { int n; std::cin >> n; int64_t aMax = 0; std::vector<int64_t> a(n); for (int i = 0; i != n; i++) { std::cin >> a[i]; if (a[i] > aMax) aMax = a[i]; } std::vector<bool> dp(aMax + 1, true); std::vector<bool> seen(aMax +...
replace
16
18
16
18
0
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define forn(i, n) for (int i = 0; i < int(n); ++i) #define for1(i, n) for (int i = 1; i <= int(n); ++i) #define ms(a, x) memset(a, x, sizeof(a)) #define F first #define S second #define all(x) (x).begin(), (x).end() #define size(x) int(x.size()) #define pb push_back using namespace std; usin...
#include <bits/stdc++.h> #define forn(i, n) for (int i = 0; i < int(n); ++i) #define for1(i, n) for (int i = 1; i <= int(n); ++i) #define ms(a, x) memset(a, x, sizeof(a)) #define F first #define S second #define all(x) (x).begin(), (x).end() #define size(x) int(x.size()) #define pb push_back using namespace std; usin...
replace
27
28
27
28
TLE
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; ll nums[101010]; bool divisor(ll n) { vector<ll> div; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { if (nums[i] > 0) return false; if (i != n / i) { if (nums[n / i] > 0) re...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; ll nums[1010101]; bool divisor(ll n) { vector<ll> div; for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { if (nums[i] > 0) return false; if (i != n / i) { if (nums[n / i] > 0) r...
replace
5
6
5
6
0
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; bool nums[1010101]; ll cnt[1010101]; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); for (int i = 0; i < n; i++) { cnt[a[i]]++; if (nums[a[i]]) c...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; bool nums[1010101]; ll cnt[1010101]; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); for (int i = 0; i < n; i++) { cnt[a[i]]++; if (nums[a[i]]) c...
insert
19
19
19
21
TLE
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a; int a_max = 0; int ans = 0; for (int i = 0; i < n; i++) { int tmp; cin >> tmp; a.push_back(tmp); if (a_max < tmp) { a_max = tmp; } } sort(a.begin(), a.end()); vector<bool> b(a_max...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a; int a_max = 0; int ans = 0; for (int i = 0; i < n; i++) { int tmp; cin >> tmp; a.push_back(tmp); if (a_max < tmp) { a_max = tmp; } } sort(a.begin(), a.end()); vector<bool> b(a_max...
replace
28
30
28
30
0
p02642
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using Int = long long; int PREP = (cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(9), 0); // int SEGV = getenv("D") || (exit(system("D= SEGFAULT_SIGNALS=all catchsegv // ./prog.exe") >> 8), 0); int main() { int N; cin >> N; ve...
#include <bits/stdc++.h> using namespace std; using Int = long long; int PREP = (cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(9), 0); // int SEGV = getenv("D") || (exit(system("D= SEGFAULT_SIGNALS=all catchsegv // ./prog.exe") >> 8), 0); int main() { int N; cin >> N; ve...
insert
15
15
15
19
TLE
p02642
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define all(x) (x).begin(), (x).end() #define uniq(x) (x).erase(unique(all(x)), (x).end())) #define bit(n) (1LL << (n)) #define cdiv(a, b) (((a...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define all(x) (x).begin(), (x).end() #define uniq(x) (x).erase(unique(all(x)), (x).end())) #define bit(n) (1LL << (n)) #define cdiv(a, b) (((a...
replace
83
84
83
84
0
p02642
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <vector> #define rep(i, j, k) for (int i = j; i <= k; i++) #define dow(i, j, k) for (int i = j; i >= k; i--) #define fi first #define se second using namespace std; typedef long long ll...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <vector> #define rep(i, j, k) for (int i = j; i <= k; i++) #define dow(i, j, k) for (int i = j; i >= k; i--) #define fi first #define se second using namespace std; typedef long long ll...
insert
27
27
27
29
TLE
p02642
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using ll = long long; using namespace std; const ll mod = 1e9 + 7; int main() { int n; cin >> n; vector<int> a(n); vector...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using ll = long long; using namespace std; const ll mod = 1e9 + 7; int main() { int n; cin >> n; vector<int> a(n); vector...
replace
31
32
31
32
TLE