Datasets:

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
p02276
#include <iostream> #include <utility> #include <vector> using namespace std; int partition(vector<int> &vec, int left, int right); int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; int pivot = partition(a, 0, n - 1); cout << a[0]; for (int i = 1; i < n; ++i...
#include <iostream> #include <utility> #include <vector> using namespace std; int partition(vector<int> &vec, int left, int right); int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; int pivot = partition(a, 0, n - 1); cout << a[0]; for (int i = 1; i < n; ++i...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,168
120,169
u207749959
cpp
p02276
#include <iostream> using namespace std; int partition(int A[], int n, int p, int r) { int i = p; int x = A[r]; for (int j = p; j < r; j++) { if (A[j] <= x) { int t = A[j]; A[j] = A[i]; A[i] = t; ++i; } } A[r] = A[i + 1]; A[i] = x; return i; } int main() { int n; cin...
#include <iostream> using namespace std; int partition(int A[], int n, int p, int r) { int i = p; int x = A[r]; for (int j = p; j < r; j++) { if (A[j] <= x) { int t = A[j]; A[j] = A[i]; A[i] = t; ++i; } } A[r] = A[i]; A[i] = x; return i; } int main() { int n; cin >> ...
[ "expression.operation.binary.remove" ]
120,170
120,171
u166697967
cpp
p02276
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[r]; A[r] = t; return i + 1; } int m...
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[r]; A[r] = t; return i + 1; } int m...
[ "call.arguments.change" ]
120,176
120,177
u011621222
cpp
p02276
#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" //#include "libs.h" #include <random> #include <unordered_map> #include <unordered_set> //#include <opencv2/core.hpp> //#include <opencv2/highgui.hpp> //#include <opencv2/imgproc.hpp> using namespace std; //呪文 #define DUMPOUT cerr #define dump(...) ...
#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" //#include "libs.h" #include <random> #include <unordered_map> #include <unordered_set> //#include <opencv2/core.hpp> //#include <opencv2/highgui.hpp> //#include <opencv2/imgproc.hpp> using namespace std; //呪文 #define DUMPOUT cerr #define dump(...) ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,178
120,179
u607211196
cpp
p02276
#include <algorithm> #include <iostream> using namespace std; int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r - 1; j++) { if (A[j] <= x) { i++; swap(A[i], A[j]); } } swap(A[i + 1], A[r]); return i + 1; } int main() { int n, A[500000]; cin >...
#include <algorithm> #include <iostream> using namespace std; int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; swap(A[i], A[j]); } } swap(A[i + 1], A[r]); return i + 1; } int main() { int n, A[500000]; cin >> n;...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
120,190
120,191
u657361950
cpp
p02276
#include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <typeinfo> #define MAX 100000 using namespace std; int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) i++; t = A[i]; A[i] = A[j]; A[...
#include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <typeinfo> #define MAX 100000 using namespace std; int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; ...
[]
120,192
120,193
u623735438
cpp
p02276
#include "iostream" #include <algorithm> using namespace std; int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r - 1; j++) { if (A[j] <= x) { i = i + 1; swap(A[i], A[j]); } swap(A[i + 1], A[j]); } return i + 1; } int main() { int n, m; int ...
#include "iostream" #include <algorithm> using namespace std; int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i = i + 1; swap(A[i], A[j]); } } swap(A[i + 1], A[r]); return i + 1; } int main() { int n, m; int A[1000...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "identifier.change", "variable_access.subscript.index.change", "call.arguments.change" ]
120,194
120,195
u834458982
cpp
p02276
#include <stdio.h> #include <stdlib.h> class Array { protected: int *array, length; public: Array() : array(nullptr), length(0) {} void Setlength() { scanf("%d", &length); } void SetArray() { array = (int *)malloc((length + 1) * sizeof(int)); for (int i = 1; i <= length; ++i) scanf("%d", &arra...
#include <stdio.h> #include <stdlib.h> class Array { protected: int *array, length; public: Array() : array(nullptr), length(0) {} void Setlength() { scanf("%d", &length); } void SetArray() { array = (int *)malloc((length + 1) * sizeof(int)); for (int i = 1; i <= length; ++i) scanf("%d", &arra...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
120,202
120,203
u656631281
cpp
p02276
#include <iostream> using namespace std; const int SIZE = 100000; int Partition(int *A, int p, int r) { int x = A[r - 1]; int i = p; for (int j = p; j < r - 1; j++) { if (A[j] <= x) { int tmp = A[j]; A[j] = A[i]; A[i] = tmp; i++; } } int tmp = A[i]; A[i] = A[r - 1]; A[r ...
#include <iostream> using namespace std; const int SIZE = 100000; int Partition(int *A, int p, int r) { int x = A[r - 1]; int i = p; for (int j = p; j < r - 1; j++) { if (A[j] <= x) { int tmp = A[j]; A[j] = A[i]; A[i] = tmp; i++; } } int tmp = A[i]; A[i] = A[r - 1]; A[r ...
[ "expression.unary.arithmetic.add" ]
120,204
120,205
u198322268
cpp
p02276
#include <iostream> using namespace std; #define N 100000 #define SWP(T, X, Y) \ { \ T _; \ _ = (X); ...
#include <iostream> using namespace std; #define N 100000 #define SWP(T, X, Y) \ { \ T _; \ _ = (X); ...
[]
120,206
120,207
u182576515
cpp
p02276
#include <iostream> using namespace std; #define MAX 100000 int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = p; j < r - 1; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r...
#include <iostream> using namespace std; #define MAX 100000 int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = ...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
120,208
120,209
u419786871
cpp
p02276
#include <iostream> using namespace std; #define MAX 100000 int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = p; j < r - 1; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r...
#include <iostream> using namespace std; #define MAX 100000 int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = ...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
120,208
120,211
u419786871
cpp
p02276
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <stack> #include <string> #include <vector> //#include<cmath> using namespace std; typedef long long llong; const int MAX = 100010; int A[MAX]; int main(void) { int n, x, k; c...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <stack> #include <string> #include <vector> //#include<cmath> using namespace std; typedef long long llong; const int MAX = 100010; int A[MAX]; int main(void) { int n, x, k; c...
[ "control_flow.loop.for.condition.change", "control_flow.branch.if.condition.change", "identifier.change" ]
120,212
120,213
u817008595
cpp
p02276
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <ctype.h> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <ctype.h> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #includ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,216
120,217
u021233305
cpp
p02276
#include <iostream> #include <stack> #include <stdio.h> #include <stdlib.h> #define N_MAX 100000 using namespace std; //常に心してかかれ //簡単なことを簡単にできるように練習する //びっくりするくらいつまらないことで詰まってることも多い int n; int partition(int A[], int p, int r) { // rは配列の最後を指す添え字 int x = A[r]; int i = p; int tmp; for (int j = p; j < r; j++) { ...
#include <iostream> #include <stack> #include <stdio.h> #include <stdlib.h> #define N_MAX 100000 using namespace std; //常に心してかかれ //簡単なことを簡単にできるように練習する //びっくりするくらいつまらないことで詰まってることも多い int n; int partition(int A[], int p, int r) { // rは配列の最後を指す添え字 int x = A[r]; int i = p; int tmp; for (int j = p; j < r; j++) { ...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
120,220
120,221
u401858389
cpp
p02276
#include <algorithm> #include <iostream> using namespace std; int main() { int n, a[100000]; cin >> n; int i; for (i = 0; i < n; i++) { cin >> a[i]; } int r = a[i - 1]; //???????°???? int j = -1, k = -1; for (int l = 0; l < i; l++) { if (a[l] < r) { swap(a[j + 1], a[l]); j++; ...
#include <algorithm> #include <iostream> using namespace std; int main() { int n, a[100000]; cin >> n; int i; for (i = 0; i < n; i++) { cin >> a[i]; } int r = a[i - 1]; //???????°???? int j = -1, k = -1; for (int l = 0; l < i - 1; l++) { if (a[l] <= r) { swap(a[j + 1], a[l]); j+...
[ "control_flow.loop.for.condition.change", "misc.off_by_one", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,224
120,225
u670628888
cpp
p02276
#include <iostream> using namespace std; int n; int A[100000]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> A[i]; int x = A[n - 1]; int j = A[0] < x ? 1 : 0; for (int i = 1; i < n - 1; i++) { if (A[i] < x) { int aj = A[j]; A[j] = A[i]; A[i] = aj; j++; } } A...
#include <iostream> using namespace std; int n; int A[100000]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> A[i]; int x = A[n - 1]; int j = A[0] < x ? 1 : 0; for (int i = 1; i < n - 1; i++) { if (A[i] <= x) { int aj = A[j]; A[j] = A[i]; A[i] = aj; j++; } } ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,226
120,227
u583913846
cpp
p02276
#include <iostream> using namespace std; int n; int A[100000]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> A[i]; int x = A[n - 1]; int j = A[0] < x ? 1 : 0; for (int i = 1; i < n - 1; i++) { if (A[i] < x) { int aj = A[j]; A[j] = A[i]; A[i] = aj; j++; } } A...
#include <iostream> using namespace std; int n; int A[100000]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> A[i]; int x = A[n - 1]; int j = A[0] < x ? 1 : 0; for (int i = 1; i < n - 1; i++) { if (A[i] <= x) { int aj = A[j]; A[j] = A[i]; A[i] = aj; j++; } } ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,228
120,227
u583913846
cpp
p02276
#include <iostream> using namespace std; int x[1000000], n; int func(int t, int r) { int p, a, b, j; p = x[r]; j = t - 1; for (int i = t; i < r; i++) { if (x[i] <= p) { j = j + 1; a = x[i]; b = x[j]; x[i] = b; x[j] = a; } a = x[i + 1]; b = x[r]; x[i + 1] = b; ...
#include <iostream> using namespace std; int x[1000000], n; int func(int t, int r) { int p, a, b, j; p = x[r]; j = t - 1; for (int i = t; i < r; i++) { if (x[i] <= p) { j = j + 1; a = x[i]; b = x[j]; x[i] = b; x[j] = a; } } a = x[j + 1]; b = x[r]; x[j + 1] = b; ...
[ "assignment.value.change", "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "assignment.variable.change", "control_flow.branch.if.condition.change" ]
120,229
120,230
u852311840
cpp
p02276
#include <iostream> using namespace std; int x[1000000], n; int func(int t, int r) { int p, a, b, j; p = x[r]; j = t - 1; for (int i = t; i < r; i++) { if (x[i] <= p) { j = j + 1; a = x[i]; b = x[j]; x[i] = b; x[j] = a; } a = x[j + 1]; b = x[r]; x[j + 1] = b; ...
#include <iostream> using namespace std; int x[1000000], n; int func(int t, int r) { int p, a, b, j; p = x[r]; j = t - 1; for (int i = t; i < r; i++) { if (x[i] <= p) { j = j + 1; a = x[i]; b = x[j]; x[i] = b; x[j] = a; } } a = x[j + 1]; b = x[r]; x[j + 1] = b; ...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
120,231
120,230
u852311840
cpp
p02276
#include <algorithm> #include <iostream> using namespace std; int n, a[111111]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &a[i]); int x = a[n - 1], z = -1; for (int i = 0; i < n; i++) { if (a[i] <= x) { swap(a[++z], a[i]); } } swap(a[++z], a[n - 1]); for (int ...
#include <algorithm> #include <iostream> using namespace std; int n, a[111111]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &a[i]); int x = a[n - 1], z = -1; for (int i = 0; i < n - 1; i++) { if (a[i] <= x) { swap(a[++z], a[i]); } } swap(a[++z], a[n - 1]); for (...
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
120,236
120,237
u823513038
cpp
p02276
#include <cstdio> #include <iostream> using namespace std; int Partition(int elem[], int start, int end) { int i; int mid; int target; target = elem[end]; mid = start - 1; for (i = start; i < end - 1; i++) { if (elem[i] <= target) { ++mid; swap(elem[mid], elem[target]); } } ++mid...
#include <cstdio> #include <iostream> using namespace std; int Partition(int elem[], int start, int end) { int i; int mid; int target; target = elem[end - 1]; mid = start - 1; for (i = start; i < end - 1; i++) { if (elem[i] <= target) { ++mid; swap(elem[mid], elem[i]); } } ++mid;...
[ "assignment.change", "identifier.change", "variable_access.subscript.index.change", "call.arguments.change" ]
120,238
120,239
u861447106
cpp
p02276
#include <iostream> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) using namespace std; int partition(int a[], int s, int g) { int x = a[g]; int gto = s - 1; for (int j = s; j <= g; j++) { if (a[j] < x) { gto++; int alt = a[j]; a[j] = a[gto]; a[gto] ...
#include <iostream> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) using namespace std; int partition(int a[], int s, int g) { int x = a[g]; int gto = s - 1; for (int j = s; j < g; j++) { if (a[j] <= x) { gto++; int alt = a[j]; a[j] = a[gto]; a[gto] ...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "control_flow.branch.if.condition.change" ]
120,240
120,241
u982302262
cpp
p02276
#include <algorithm> #include <stdio.h> int Partition(int A[], int p, int r) { int x = A[r]; int j = p; for (int i = p; i < r; ++i) { if (A[i] < x) { std::swap(A[j], A[i]); ++j; } } std::swap(A[j], A[r]); return j; } int main() { int n, A[100000]; scanf("%d", &n); for (int i = 0;...
#include <algorithm> #include <stdio.h> int Partition(int A[], int p, int r) { int x = A[r]; int j = p; for (int i = p; i < r; ++i) { if (A[i] <= x) { std::swap(A[j], A[i]); ++j; } } std::swap(A[j], A[r]); return j; } int main() { int n, A[100000]; scanf("%d", &n); for (int i = 0...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,493
120,494
u379744035
cpp
p02276
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; long long cnt; struct SSS { string str; int val; SSS(string s = "", int v = 0) : str(s), val(v){}; }; void print(vector<SSS> &data) { for (int i = 0; i...
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; long long cnt; struct SSS { string str; int val; SSS(string s = "", int v = 0) : str(s), val(v){}; }; void print(vector<SSS> &data) { for (int i = 0; i...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,505
120,506
u922538592
cpp
p02276
#include <iostream> #include <stdio.h> using namespace std; #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; swap(A[j], A[i]); } } swap(A[i + 1], A[r]); return i + 1; } int main() { int ...
#include <iostream> #include <stdio.h> using namespace std; #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; swap(A[j], A[i]); } } swap(A[i + 1], A[r]); return i + 1; } int main() { int ...
[ "assignment.change" ]
120,507
120,508
u967088297
cpp
p02276
#include <iostream> using namespace std; // Exchange void exchange(int A[], int i, int j) { int tmp = A[i]; A[i] = A[j]; A[j] = tmp; } // Partition int partition(int A[], int l, int r) { int threshold = A[r - 1]; int i = l - 1; for (int j = l; j < r; j++) { if (A[j] <= threshold) { i++; /...
#include <iostream> using namespace std; // Exchange void exchange(int A[], int i, int j) { int tmp = A[i]; A[i] = A[j]; A[j] = tmp; } // Partition int partition(int A[], int l, int r) { int threshold = A[r - 1]; int i = l - 1; for (int j = l; j < r - 1; j++) { if (A[j] <= threshold) { i++; ...
[ "control_flow.loop.for.condition.change", "misc.off_by_one", "literal.number.change", "variable_declaration.array_dimensions.change", "expression.operation.binary.remove" ]
120,509
120,510
u432957752
cpp
p02276
#include <iostream> using namespace std; const int MAX = 100000; int A[MAX]; int partition(int p, int r) { int x = A[r]; int i = -1, k = 0; for (int k = 0; k < r; k++) { if (x > A[k]) { i++; int t = A[k]; A[k] = A[i]; A[i] = t; } } int t = A[i + 1]; A[i + 1] = x; A[r] = t; ...
#include <iostream> using namespace std; const int MAX = 100000; int A[MAX]; int partition(int p, int r) { int x = A[r]; int i = -1, k = 0; for (int k = 0; k < r; k++) { if (x >= A[k]) { i++; int t = A[k]; A[k] = A[i]; A[i] = t; } } int t = A[i + 1]; A[i + 1] = x; A[r] = t;...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,512
120,513
u258435638
cpp
p02276
#include <algorithm> #include <iostream> #include <vector> int partition(std::vector<int> A, int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j <= r - 1; ++j) { if (A[j] <= x) { ++i; std::swap(A[i], A[j]); } } std::swap(A[i + 1], A[r]); return i + 1; } int main(void) { std:...
#include <algorithm> #include <iostream> #include <vector> int partition(std::vector<int> &A, int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j <= r - 1; ++j) { if (A[j] <= x) { ++i; std::swap(A[i], A[j]); } } std::swap(A[i + 1], A[r]); return i + 1; } int main(void) { std...
[]
120,514
120,515
u933569644
cpp
p02276
#include <algorithm> //cope #include <iostream> using namespace std; int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r - 1; j++) { if (A[j] <= x) { i = i + 1; swap(A[i], A[j]); } } swap(A[i + 1], A[r]); return i + 1; } int main() { int n; c...
#include <algorithm> //cope #include <iostream> using namespace std; int partition(int A[], int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j <= r - 1; j++) { if (A[j] <= x) { i = i + 1; swap(A[i], A[j]); } } swap(A[i + 1], A[r]); return i + 1; } int main() { int n; ...
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
120,519
120,520
u798492690
cpp
p02276
#include <iostream> using namespace std; int main() { int n; cin >> n; int *A = new int[n + 1]; for (int i = 1; i < n + 1; i++) { cin >> A[i]; } int x = A[n]; int i = 0; int tmp = 0; for (int j = 1; j <= n - 1; j++) { if (A[j] <= x) { i = i + 1; tmp = A[i]; A[i] = A[j]; ...
#include <iostream> using namespace std; int main() { int n; cin >> n; int *A = new int[n + 1]; for (int i = 1; i < n + 1; i++) { cin >> A[i]; } int x = A[n]; int i = 0; int tmp = 0; for (int j = 1; j <= n - 1; j++) { if (A[j] <= x) { i = i + 1; tmp = A[i]; A[i] = A[j]; ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
120,523
120,522
u380643384
cpp
p02276
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <utility> using namespace std; #define MAX 1000005 int A[MAX]; int partition(int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; swap(A[i], A[j]);...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <utility> using namespace std; #define MAX 1000005 int A[MAX]; int partition(int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; swap(A[i], A[j]);...
[ "control_flow.loop.for.condition.change", "control_flow.branch.if.condition.change" ]
120,527
120,528
u302611454
cpp
p02276
#include <iostream> #include <vector> using namespace std; int partition(vector<int> &A, int p, int r) { int i = p - 1; for (int j = p; j < r; j++) { if (A[j] >= A[r]) continue; swap(A[++i], A[j]); } swap(A[++i], A[r]); return i; } int main() { int n; cin >> n; vector<int> A(n); for (a...
#include <iostream> #include <vector> using namespace std; int partition(vector<int> &A, int p, int r) { int i = p - 1; for (int j = p; j < r; j++) { if (A[j] > A[r]) continue; swap(A[++i], A[j]); } swap(A[++i], A[r]); return i; } int main() { int n; cin >> n; vector<int> A(n); for (au...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,532
120,533
u510526182
cpp
p02276
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(...
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,534
120,535
u927516039
cpp
p02276
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[j]; A[i + 1] = t; return i + 1; } i...
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[r]; A[r] = t; return i + 1; } int m...
[ "assignment.value.change", "identifier.change", "variable_access.subscript.index.change", "assignment.variable.change", "expression.operation.binary.change", "expression.operation.binary.remove", "expression.operation.unary.reference.add" ]
120,536
120,537
u722526744
cpp
p02276
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[j]; A[j] = t; return i + 1; } int m...
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[r]; A[r] = t; return i + 1; } int m...
[ "assignment.value.change", "identifier.change", "variable_access.subscript.index.change", "assignment.variable.change", "expression.operation.unary.reference.add" ]
120,538
120,537
u722526744
cpp
p02276
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[j]; A[i + 1] = t; return i + 1; } i...
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[j]; A[j] = t; return i + 1; } int m...
[ "assignment.variable.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "expression.operation.binary.remove", "expression.operation.unary.reference.add" ]
120,536
120,539
u722526744
cpp
p02276
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[j]; A[j] = t; return i + 1; } int m...
#include <stdio.h> #define MAX 100000 int A[MAX], n; int partition(int p, int r) { int x, i, j, t; x = A[r]; i = p - 1; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[j]; A[j] = t; return i + 1; } int m...
[ "expression.operation.unary.reference.add" ]
120,538
120,539
u722526744
cpp
p02276
#include <cstdio> #include <iostream> #include <vector> void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } int do_partition(std::vector<int> &data, int begin_index, int end_index) { int pivot = data[end_index - 1]; int left_last_index = begin_index; for (int i = begin_index + 1; i < end_index ...
#include <cstdio> #include <iostream> #include <vector> void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } int do_partition(std::vector<int> &data, int begin_index, int end_index) { int pivot = data[end_index - 1]; int left_last_index = begin_index; for (int i = begin_index; i < end_index - 1;...
[ "control_flow.loop.for.initializer.change", "expression.operation.binary.remove", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,540
120,541
u371961438
cpp
p02276
#include <cstdio> #include <iostream> #include <vector> void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } int do_partition(std::vector<int> &data, int begin_index, int end_index) { int pivot = data[end_index - 1]; int left_last_index = begin_index; for (int i = begin_index; i < end_index - 1;...
#include <cstdio> #include <iostream> #include <vector> void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } int do_partition(std::vector<int> &data, int begin_index, int end_index) { int pivot = data[end_index - 1]; int left_last_index = begin_index; for (int i = begin_index; i < end_index - 1;...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,543
120,541
u371961438
cpp
p02276
#include <cstdio> #include <iostream> using namespace std; const int N = 100005; int partition(int arr[], int p, int r) //[p, r)????????????,????????????pivot?????? { int pivot = arr[r - 1]; int i = p; for (int j = p; j < r - 1; ++j) { if (arr[j] < pivot) { swap(arr[i++], arr[j]); } ...
#include <cstdio> #include <iostream> using namespace std; const int N = 100005; int partition(int arr[], int p, int r) //[p, r)????????????,????????????pivot?????? { int pivot = arr[r - 1]; int i = p; for (int j = p; j < r - 1; ++j) { if (arr[j] <= pivot) { swap(arr[i++], arr[j]); } ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,546
120,547
u145367012
cpp
p02276
#include <iostream> #include <vector> int partition(std::vector<int> *A, int p, int r) { int x = (*A)[r]; int i = p - 1; for (int j = p; j < r - 1; ++j) { if ((*A)[j] <= x) { i = i + 1; std::swap((*A)[i], (*A)[j]); } } std::swap((*A)[i + 1], (*A)[r]); return i + 1; } int main() { int...
#include <iostream> #include <vector> int partition(std::vector<int> *A, int p, int r) { int x = (*A)[r]; int i = p - 1; for (int j = p; j < r; ++j) { if ((*A)[j] <= x) { i = i + 1; std::swap((*A)[i], (*A)[j]); } } std::swap((*A)[i + 1], (*A)[r]); return i + 1; } int main() { int n; ...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
120,552
120,553
u571345107
cpp
p02276
#include <algorithm> #include <iostream> using namespace std; int n, a[100000]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; int tmp = a[n - 1], i = -1; for (int j = 0; j < n; j++) { if (a[j] < tmp) { i++; swap(a[i], a[j]); } } swap(a[i + 1], a[n - 1]); for (int ...
#include <algorithm> #include <iostream> using namespace std; int n, a[100000]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; int tmp = a[n - 1], i = -1; for (int j = 0; j < n - 1; j++) { if (a[j] <= tmp) { i++; swap(a[i], a[j]); } } swap(a[i + 1], a[n - 1]); for ...
[ "control_flow.loop.for.condition.change", "misc.off_by_one", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,554
120,555
u278641778
cpp
p02276
#include <iostream> #include <map> #include <string> #include <vector> using namespace std; int inf = 10000000; int n; vector<int> a; int partition(int p, int r) { int x = a[r - 1]; int i = p - 1; for (int j = p; j < r; j++) { if (a[j] <= x) { // i = i + 1; swap(a[++i], a[j]); } } // swap(...
#include <iostream> #include <map> #include <string> #include <vector> using namespace std; int inf = 10000000; int n; vector<int> a; int partition(int p, int r) { int x = a[r - 1]; int i = p - 1; for (int j = p; j < r; j++) { if (a[j] <= x) { // i = i + 1; swap(a[++i], a[j]); } } // swap(...
[ "control_flow.loop.for.condition.change", "control_flow.branch.if.condition.change" ]
120,557
120,558
u991537731
cpp
p02276
#include <iostream> using namespace std; #define max 100000 int A[max], n; int partition(int p, int r) { int j, t, x, i; i = p - 1; x = A[r]; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[r]; A[r] = t; ...
#include <iostream> using namespace std; #define max 100000 int A[max], n; int partition(int p, int r) { int j, t, x, i; i = p - 1; x = A[r]; for (j = p; j < r; j++) { if (A[j] <= x) { i++; t = A[i]; A[i] = A[j]; A[j] = t; } } t = A[i + 1]; A[i + 1] = A[r]; A[r] = t; ...
[ "literal.number.change", "control_flow.branch.if.condition.change" ]
120,559
120,560
u454221508
cpp
p02276
#include <cstdio> #define N_MAX 100000 int partition(int A[], int start, int end) { int tmp, j = 0, x = A[end]; for (int i = start; i < end; i++) { if (A[i] < x) { tmp = A[j]; A[j] = A[i]; A[i] = tmp; j++; } } tmp = A[end]; A[end] = A[j]; A[j] = tmp; return j; } int mai...
#include <cstdio> #define N_MAX 100000 int partition(int A[], int start, int end) { int tmp, j = 0, x = A[end]; for (int i = start; i < end; i++) { if (A[i] <= x) { tmp = A[j]; A[j] = A[i]; A[i] = tmp; j++; } } tmp = A[end]; A[end] = A[j]; A[j] = tmp; return j; } int ma...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,573
120,574
u862038050
cpp
p02276
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <sstream> #include <stack> #include <stdio.h> #define MAX 100000 using namespace std; typedef long long ll; int store[100000 + 2], u; void partition(int n) { int x, i, j, mid; x = store[n - 1]; ...
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <sstream> #include <stack> #include <stdio.h> #define MAX 100000 using namespace std; typedef long long ll; int store[100000 + 2], u; void partition(int n) { int x, i, j, mid; x = store[n - 1]; ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "variable_declaration.remove" ]
120,577
120,578
u041883765
cpp
p02276
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <sstream> #include <stack> #include <stdio.h> #define MAX 100000 using namespace std; typedef long long ll; int store[100000 + 2], u; void partition(int n) { int x, i, j, mid; x = store[n - 1]; ...
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <sstream> #include <stack> #include <stdio.h> #define MAX 100000 using namespace std; typedef long long ll; int store[100000 + 2], u; void partition(int n) { int x, i, j, mid; x = store[n - 1]; ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,579
120,578
u041883765
cpp
p02276
#include <bits/stdc++.h> using namespace std; #define is_uruu leapyear #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define ROF(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, a) for (int i = 0; i < (a); ++i) int partition(int A[], int p, int r) { int x = A[r]; int i = p; FO...
#include <bits/stdc++.h> using namespace std; #define is_uruu leapyear #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define ROF(i, a, b) for (int i = (a); i > (b); --i) #define REP(i, a) for (int i = 0; i < (a); ++i) int partition(int A[], int p, int r) { int x = A[r]; int i = p; FO...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,580
120,581
u673592786
cpp
p02276
#include <cmath> #include <iostream> #include <stdio.h> using namespace std; #define MAX 500000; #define SENTINEL 2000000000; // int count=0; void merge(int A[], int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; int L[500000 / 2 + 2], R[500000 / 2 + 2]; for (int i = 0; i < n1; i++) ...
#include <cmath> #include <iostream> #include <stdio.h> using namespace std; #define MAX 500000; #define SENTINEL 2000000000; // int count=0; void merge(int A[], int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; int L[500000 / 2 + 2], R[500000 / 2 + 2]; for (int i = 0; i < n1; i++) ...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
120,582
120,583
u836625838
cpp
p02276
/* #include<iostream> using namespace std; int A[100005]; int partition(int p, int r) { int x = A[r]; int i = p - 1; for (int j=p; j<r; j++) { if (A[j] <= x) { i++; swap(A[i], A[j]); } } swap(A[i+1], A[r]); return i + 1; } int main() { int n; ci...
/* #include<iostream> using namespace std; int A[100005]; int partition(int p, int r) { int x = A[r]; int i = p - 1; for (int j=p; j<r; j++) { if (A[j] <= x) { i++; swap(A[i], A[j]); } } swap(A[i+1], A[r]); return i + 1; } int main() { int n; ci...
[]
120,584
120,585
u612715617
cpp
p02276
#include <stdio.h> int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = 0; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; } int main() { int ...
#include <stdio.h> int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = 0; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; } int main() { int ...
[ "control_flow.loop.for.condition.change", "control_flow.branch.if.condition.change" ]
120,586
120,587
u385256754
cpp
p02276
#include <stdio.h> int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = 0; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; } int main() { int ...
#include <stdio.h> int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = 0; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; } int main() { int ...
[ "control_flow.loop.for.condition.change", "control_flow.branch.if.condition.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
120,588
120,587
u385256754
cpp
p02276
#include <iostream> using namespace std; int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = 0; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; ...
#include <iostream> using namespace std; int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; int tmp; for (int j = 0; j < r; j++) { if (A[j] <= x) { i++; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1;...
[ "literal.string.change", "io.output.change" ]
120,591
120,592
u385256754
cpp
p02276
#include <iostream> using namespace std; int partition(int A[], int p, int r) { int x, i, tmp; x = A[r - 1]; i = p - 1; for (int j = p; j <= r - 1; j++) { if (A[j] < x) { i = i + 1; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r - 1]; A[r - 1] = ...
#include <iostream> using namespace std; int partition(int A[], int p, int r) { int x, i, tmp; x = A[r - 1]; i = p - 1; for (int j = p; j <= r - 2; j++) { if (A[j] <= x) { i = i + 1; tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } tmp = A[i + 1]; A[i + 1] = A[r - 1]; A[r - 1] =...
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,595
120,594
u120979167
cpp
p02276
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <u...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <u...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,598
120,599
u638043175
cpp
p02276
#include <stdio.h> using namespace std; int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; int tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } int tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; } ...
#include <stdio.h> using namespace std; int partition(int *A, int p, int r) { int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { if (A[j] <= x) { i++; int tmp = A[i]; A[i] = A[j]; A[j] = tmp; } } int tmp = A[i + 1]; A[i + 1] = A[r]; A[r] = tmp; return i + 1; } ...
[ "assignment.change" ]
120,600
120,601
u815527706
cpp
p02276
#include <iostream> #include <vector> void Swap(int &a, int &b) { int tmp = std::move(a); a = std::move(b); b = std::move(tmp); } // when 0th Recurtion, params -> Partition( v, 0, v.size() ); int Partition(std::vector<int> &v, int p, int r) { --r; int x = v[r]; int i = p - 1; for (int j = p; j < r; ++j)...
#include <iostream> #include <vector> void Swap(int &a, int &b) { int tmp = std::move(a); a = std::move(b); b = std::move(tmp); } // when 0th Recurtion, params -> Partition( v, 0, v.size() ); int Partition(std::vector<int> &v, int p, int r) { --r; int x = v[r]; int i = p - 1; for (int j = p; j < r; ++j)...
[ "expression.operation.binary.remove", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "misc.off_by_one" ]
120,602
120,603
u462133671
cpp
p02276
#include <iostream> #define MAX 100000 using namespace std; int Partition(int A[], int p, int r); int main() { int n, i, j, q; int A[MAX]; cin >> n; for (i = 0; i < n; i++) { cin >> A[i]; } q = Partition(A, 0, n - 1); for (i = 0; A[i] < A[q]; i++) { cout << A[i] << ' '; } cout << '[' << A...
#include <iostream> #define MAX 100000 using namespace std; int Partition(int A[], int p, int r); int main() { int n, i, j, q; int A[MAX]; cin >> n; for (i = 0; i < n; i++) { cin >> A[i]; } // q = Partition(A,A[0],A[n-1]); q = Partition(A, 0, n - 1); for (i = 0; i < q; i++) { cout << A[i] <<...
[ "control_flow.loop.for.condition.change" ]
120,608
120,609
u423758855
cpp
p02276
/* 「pivotを中間に、大きいものと小さいものを交換していく」 という感じではなく、 「pivotより小さいものを探して、前の方に詰めていく(添え字iのとこ)」 という感じである。 */ #include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int i, j; int n; int buf; int p, q, r, pivot; vector<int> A; cin >> n; for (i = 0; i < n; i++) { cin >> buf;...
/* 「pivotを中間に、大きいものと小さいものを交換していく」 という感じではなく、 「pivotより小さいものを探して、前の方に詰めていく(添え字iのとこ)」 という感じである。 */ #include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int i, j; int n; int buf; int p, q, r, pivot; vector<int> A; cin >> n; for (i = 0; i < n; i++) { cin >> buf;...
[ "assignment.value.change", "identifier.replace.remove", "literal.replace.add", "expression.operation.binary.change", "control_flow.loop.for.condition.change", "control_flow.branch.if.condition.change", "identifier.change" ]
120,610
120,611
u708195431
cpp
p02276
#include <iostream> using namespace std; int array[100001]; void Partition(const int begin, const int end) { int mid = array[end]; int i = begin; for (int j = begin; j < end; j++) { if (array[j] <= mid) { int buf = array[i]; array[i] = array[j]; array[j] = buf; i++; } } { ...
#include <iostream> using namespace std; int array[100001]; void Partition(const int begin, const int end) { int mid = array[end]; int i = begin; for (int j = begin; j < end; j++) { if (array[j] <= mid) { int buf = array[i]; array[i] = array[j]; array[j] = buf; i++; } } { ...
[ "literal.string.change", "io.output.change" ]
120,612
120,613
u333404033
cpp
p02277
//============================================================================ // Name : Partition.cpp // Author : Ken // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #incl...
//============================================================================ // Name : Partition.cpp // Author : Ken // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #incl...
[ "io.output.change", "literal.string.change", "literal.string.case.change" ]
120,950
120,951
u879863482
cpp
p02277
//============================================================================ // Name : Partition.cpp // Author : Ken // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #incl...
//============================================================================ // Name : Partition.cpp // Author : Ken // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #incl...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
120,952
120,951
u879863482
cpp
p02277
#include <iostream> #include <utility> #include <vector> using namespace std; class Card { public: char suit; int number; Card() {} Card(const Card &card) { this->suit = card.suit; this->number = card.number; } }; void quick_sort(vector<Card *> &cards, int start, int end); void merge_sort(vector<C...
#include <iostream> #include <utility> #include <vector> using namespace std; class Card { public: char suit; int number; Card() {} Card(const Card &card) { this->suit = card.suit; this->number = card.number; } }; void quick_sort(vector<Card *> &cards, int start, int end); void merge_sort(vector<C...
[ "control_flow.branch.if.condition.change" ]
120,954
120,955
u207749959
cpp
p02277
#include <stdio.h> const int maxn = 100000 + 10; const long long big = 2000000000; struct card { int shu; char fu; }; card L[maxn / 2 + 2], R[maxn / 2 + 2]; void zhenghe(card a[], int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0; i < n1; i++) L[i] = a[left + i]; ...
#include <stdio.h> const int maxn = 100000 + 10; const long long big = 2000000000; struct card { int shu; char fu; }; card L[maxn / 2 + 2], R[maxn / 2 + 2]; void zhenghe(card a[], int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0; i < n1; i++) L[i] = a[left + i]; ...
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
120,959
120,960
u011621222
cpp
p02277
#include <cstdio> #define MAX 100001 #define INF 2000000000 struct Card { char suit; int value; }; Card L[MAX / 2 + 1]; Card R[MAX / 2 + 1]; void merge(Card *A, int l, int mid, int r) { int n1 = mid - l; int n2 = r - mid; int i, j; for (i = 0; i < n1; ++i) { L[i] = A[l + i]; } for (i = 0; i < n...
#include <cstdio> #define MAX 100001 #define INF 2000000000 struct Card { char suit; int value; }; Card L[MAX / 2 + 1]; Card R[MAX / 2 + 1]; void merge(Card *A, int l, int mid, int r) { int n1 = mid - l; int n2 = r - mid; int i, j; for (i = 0; i < n1; ++i) { L[i] = A[l + i]; } for (i = 0; i < n...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "identifier.change", "call.arguments.change", "io.output.change" ]
120,962
120,963
u011621222
cpp
p02277
#include <iostream> #include <utility> #include <vector> using namespace std; class card { public: char suit; int val; card() {} card(char s, int v) { suit = s; val = v; } bool operator<=(card &e) { return this->val <= e.val; } bool operator<(card &e) { return this->val < e.val; } card &operat...
#include <iostream> #include <utility> #include <vector> using namespace std; class card { public: char suit; int val; card() {} card(char s, int v) { suit = s; val = v; } bool operator<=(card &e) { return this->val <= e.val; } bool operator<(card &e) { return this->val < e.val; } card &operat...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
120,964
120,965
u834733570
cpp
p02277
#include <stdio.h> #define MAX 100000 #define SENTINEL 2000000000 typedef struct card { char suit; int value; } Card; Card L[MAX / 2 + 1], R[MAX / 2 + 1]; void merge(Card A[], int left, int mid, int right) { int i, j, k; int n1 = mid - left; int n2 = right - mid; for (i = 0; i < n1; i++) L[i] = A[lef...
#include <stdio.h> #define MAX 100000 #define SENTINEL 2000000000 typedef struct card { char suit; int value; } Card; Card L[MAX / 2 + 1], R[MAX / 2 + 1]; void merge(Card A[], int left, int mid, int right) { int i, j, k; int n1 = mid - left; int n2 = right - mid; for (i = 0; i < n1; i++) L[i] = A[lef...
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
120,966
120,967
u204247262
cpp
p02277
// // main.cpp // QS_ // // Created by ptyuan on 2018/10/30. // Copyright © 2018 YY. All rights reserved. // #include <cstdio> #include <iostream> using namespace std; struct Element { char c; long number; }; void swap(Element &a, Element &b) { Element temp = a; a = b; b = temp; } int partition(Element...
// // main.cpp // QS_ // // Created by ptyuan on 2018/10/30. // Copyright © 2018 YY. All rights reserved. // #include <cstdio> #include <iostream> using namespace std; struct Element { char c; long number; }; void swap(Element &a, Element &b) { Element temp = a; a = b; b = temp; } int partition(Element...
[ "literal.number.change", "variable_declaration.value.change", "variable_declaration.array_dimensions.change" ]
120,971
120,970
u201233769
cpp
p02277
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct Card { char mark; int num; }; Card Cards1[500000]; Card Cards2[500000]; int partition(int p, int r) { int x = Cards1[r].num; int i = p - 1; for (int j = p; j < r; j++) { if (Cards1[j].num <= x) { i++; swa...
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct Card { char mark; int num; }; Card Cards1[500000]; Card Cards2[500000]; int partition(int p, int r) { int x = Cards1[r].num; int i = p - 1; for (int j = p; j < r; j++) { if (Cards1[j].num <= x) { i++; swa...
[ "identifier.change" ]
120,974
120,975
u657361950
cpp
p02277
#include <algorithm> #include <cstdlib> #include <iostream> using namespace std; #define MAX 100000 typedef pair<char, int> paCard; paCard A[MAX], B[MAX]; int Partition(int nLeft, int nRight) { int x = A[nRight].second; int nIndex = nLeft - 1; for (int i = nLeft; i < nRight; i++) // here it is nRight { if...
#include <algorithm> #include <cstdlib> #include <iostream> using namespace std; #define MAX 100000 typedef pair<char, int> paCard; paCard A[MAX], B[MAX]; int Partition(int nLeft, int nRight) { int x = A[nRight].second; int nIndex = nLeft - 1; for (int i = nLeft; i < nRight; i++) // here it is nRight { if...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
120,978
120,979
u609578509
cpp
p02277
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <cstdlib> #include <iostream> #include <math.h> #include <string> using namespace std; #define MAX 100000 #define INFTY 1000000001 struct Card { char suit; int value; }; Card A[MAX], B[MAX], L[MAX / 2 + 1], R[MAX / 2 + 1]; void merge(int le...
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <cstdlib> #include <iostream> #include <math.h> #include <string> using namespace std; #define MAX 100000 #define INFTY 1000000001 struct Card { char suit; int value; }; Card A[MAX], B[MAX], L[MAX / 2 + 1], R[MAX / 2 + 1]; void merge(int le...
[ "variable_declaration.value.change" ]
120,980
120,981
u543955176
cpp
p02277
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a), i##_max = (b); i < i##_max; ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() using namespace std; using vi = vector<int>; using i64 = int64_t; constexpr int INF = 1 << 30; constexpr int M...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a), i##_max = (b); i < i##_max; ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() using namespace std; using vi = vector<int>; using i64 = int64_t; constexpr int INF = 1 << 30; constexpr int M...
[ "expression.operation.binary.remove" ]
120,984
120,985
u324077041
cpp
p02277
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a), i##_max = (b); i < i##_max; ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() using namespace std; using vi = vector<int>; using i64 = int64_t; constexpr int INF = 1 << 30; constexpr int M...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a), i##_max = (b); i < i##_max; ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() using namespace std; using vi = vector<int>; using i64 = int64_t; constexpr int INF = 1 << 30; constexpr int M...
[ "misc.opposites", "expression.operator.compare.change", "call.arguments.change", "function.return_value.change", "expression.operation.binary.change" ]
120,986
120,987
u324077041
cpp
p02277
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <stack> using namespace std; #define MAX 100005 #define INF 0x7fffffff struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(struct Card A[], int n, int left, int mid, int right) { int i, j, ...
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <stack> using namespace std; #define MAX 100005 #define INF 2E9 struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(struct Card A[], int n, int left, int mid, int right) { int i, j, k; in...
[ "preprocessor.define.value.change", "literal.float.change", "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change", "literal.string.change", "literal.string.case.change", "io.output.change" ]
120,988
120,989
u513301554
cpp
p02277
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <stack> using namespace std; #define MAX 100005 #define INF 0x7fffffff struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(struct Card A[], int n, int left, int mid, int right) { int i, j, ...
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <stack> using namespace std; #define MAX 100005 #define INF 2E9 struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(struct Card A[], int n, int left, int mid, int right) { int i, j, k; in...
[ "preprocessor.define.value.change", "literal.float.change", "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
120,990
120,989
u513301554
cpp
p02277
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
[ "literal.number.change", "expression.operation.binary.change", "call.function.change", "call.arguments.change" ]
120,991
120,992
u443673068
cpp
p02277
#include <algorithm> #include <cstdio> using namespace std; #define INF 1234567890; struct Card { char suit; int value; }; Card L[300000], R[300000]; void merge(Card A[], int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0; i < n1; i++) L[i] = A[left + i]; for (i...
#include <algorithm> #include <cstdio> using namespace std; #define INF 1234567890; struct Card { char suit; int value; }; Card L[100000], R[100000]; void merge(Card A[], int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0; i < n1; i++) L[i] = A[left + i]; for (i...
[ "literal.number.change", "variable_declaration.array_dimensions.change", "assignment.value.change", "identifier.change" ]
120,994
120,995
u974611510
cpp
p02277
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
[ "assignment.add" ]
120,996
120,997
u819979588
cpp
p02277
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
[ "variable_declaration.type.primitive.change", "assignment.add" ]
120,998
120,997
u819979588
cpp
p02277
/*! if g++ -g alds_1_6_c.cpp -o alds_1_6_c.out; then ./alds_1_6_c.out < * alds_1_6_c.test; fi */ #include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <iterator> #include <map> #include <nu...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #includ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
121,000
121,001
u213314770
cpp
p02277
#include <iostream> using namespace std; struct card { char suit; int num; }; card A[100000]; int partition(int p, int r) { int x = A[r].num; int i = p - 1; for (int j = p; j < r; j++) { if (A[j].num <= x) { i++; swap(A[i], A[j]); } } swap(A[i + 1], A[r]); return i + 1; } void qui...
#include <iostream> using namespace std; struct card { char suit; int num; }; card A[100000]; int partition(int p, int r) { int x = A[r].num; int i = p - 1; for (int j = p; j < r; j++) { if (A[j].num <= x) { i++; swap(A[i], A[j]); } } swap(A[i + 1], A[r]); return i + 1; } void qui...
[ "identifier.replace.remove", "literal.replace.add", "call.arguments.change", "expression.operation.binary.change" ]
121,002
121,003
u783707634
cpp
p02277
#include <iostream> #include <string> using namespace std; struct Card { char suit; int val; }; const int MAX = 100000, SENTINEL = 2100000000; Card L[MAX / 2 + 2], R[MAX / 2 + 2]; int cnt; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0;...
#include <iostream> #include <string> using namespace std; struct Card { char suit; int val; }; const int MAX = 100000, SENTINEL = 2100000000; Card L[MAX / 2 + 2], R[MAX / 2 + 2]; int cnt; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0;...
[ "function.parameters.parameter.add" ]
121,004
121,005
u633068244
cpp
p02277
#include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <utility> #include <vector> #define MAX 10010 using namespace std; template <typename T> class Sort { public: Sort(); Sort(vector<T> &arr) { A = arr; } vector<T> A; void dispArr() { for (int i = 0; i < A.size() - 1; i++) ...
#include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <utility> #include <vector> #define MAX 10010 using namespace std; template <typename T> class Sort { public: Sort(); Sort(vector<T> &arr) { A = arr; } vector<T> A; void dispArr() { for (int i = 0; i < A.size() - 1; i++) ...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
121,008
121,009
u316203371
cpp
p02277
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; class card { char ch; int num; public: card() { this->ch = ' '; this->num = 0; } card(char a, int m) { this->ch = a, this->num = m; } void set(int m) { this->num = m; ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; class card { char ch; int num; public: card() { this->ch = ' '; this->num = 0; } card(char a, int m) { this->ch = a, this->num = m; } void set(int m) { this->num = m; ...
[ "expression.operation.binary.remove" ]
121,010
121,011
u167841698
cpp
p02277
#include <algorithm> #include <cstdio> #define MAX 100000 #define INF 2e9 struct Card { char suit; int val; }; Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; int i, j; for (int i = 0; i < n1; i++) { L[i] = A[...
#include <algorithm> #include <cstdio> #define MAX 100000 #define INF 2e9 struct Card { char suit; int val; }; Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; int i, j; for (int i = 0; i < n1; i++) { L[i] = A[...
[ "assignment.value.change", "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "control_flow.branch.if.condition.change", "variable_declaration.remove" ]
121,016
121,017
u117454239
cpp
p02277
#include <algorithm> #include <cstdio> #define MAX 100000 #define INF 2e9 struct Card { char suit; int val; }; Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; int i, j; for (int i = 0; i < n1; i++) { L[i] = A[...
#include <algorithm> #include <cstdio> #define MAX 100000 #define INF 2e9 struct Card { char suit; int val; }; Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; int i, j; for (int i = 0; i < n1; i++) { L[i] = A[...
[ "assignment.value.change", "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
121,018
121,017
u117454239
cpp
p02277
#include <algorithm> #include <iostream> #define DUMMY 'X' #define INF 1000000001 using namespace std; int partition(pair<char, int> array[], int p, int r) { pair<char, int> x = array[r]; int i = p - 1; for (int j = p; j < r; j++) { if (array[j].second <= x.second) { i++; swap(array[i], array[j])...
#include <algorithm> #include <iostream> #define DUMMY 'X' #define INF 1000000001 using namespace std; int partition(pair<char, int> array[], int p, int r) { pair<char, int> x = array[r]; int i = p - 1; for (int j = p; j < r; j++) { if (array[j].second <= x.second) { i++; swap(array[i], array[j])...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
121,023
121,024
u651428295
cpp
p02277
#include <algorithm> #include <iostream> #define DUMMY 'X' #define INF 1000000001 using namespace std; int partition(pair<char, int> array[], int p, int r) { pair<char, int> x = array[r]; int i = p - 1; for (int j = p; j < r; j++) { if (array[j].second <= x.second) { i++; swap(array[i], array[j])...
#include <algorithm> #include <iostream> #define DUMMY 'X' #define INF 1000000001 using namespace std; int partition(pair<char, int> array[], int p, int r) { pair<char, int> x = array[r]; int i = p - 1; for (int j = p; j < r; j++) { if (array[j].second <= x.second) { i++; swap(array[i], array[j])...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
121,025
121,024
u651428295
cpp
p02277
#include <iostream> #define INF 1000000000 using namespace std; struct Card { char suit; int num; }; void merge(Card a[], int left, int mid, int right); void mergeSort(Card a[], int left, int right); int partition(Card a[], int p, int r); void quickSort(Card a[], int p, int r); bool isStable(Card a[], Card b[], i...
#include <iostream> #define INF 1000000000 using namespace std; struct Card { char suit; int num; }; void merge(Card a[], int left, int mid, int right); void mergeSort(Card a[], int left, int right); int partition(Card a[], int p, int r); void quickSort(Card a[], int p, int r); bool isStable(Card a[], Card b[], i...
[ "literal.number.change", "variable_declaration.array_dimensions.change", "expression.operation.binary.remove" ]
121,026
121,027
u389538742
cpp
p02277
#include <iostream> #define MAX 100000 #define SENTINEL 2000000000 using namespace std; struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0; i < n1; i++) { ...
#include <iostream> #define MAX 100000 #define SENTINEL 2000000000 using namespace std; struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; void merge(Card A[], int n, int left, int mid, int right) { int n1 = mid - left; int n2 = right - mid; for (int i = 0; i < n1; i++) { ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
121,038
121,039
u326744299
cpp
p02277
#include <iostream> using namespace std; const int MAX = 100000; struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; inline void merge(struct Card A[], int n, int left, int mid, int right) { int i, j, k; int n1 = mid - left; int n2 = right - mid; for (i = 0; i < n1; i++) ...
#include <iostream> using namespace std; const int MAX = 100000; struct Card { char suit; int value; }; struct Card L[MAX / 2 + 2], R[MAX / 2 + 2]; inline void merge(struct Card A[], int n, int left, int mid, int right) { int i, j, k; int n1 = mid - left; int n2 = right - mid; for (i = 0; i < n1; i++) ...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
121,053
121,052
u228579910
cpp
p02277
#include <iostream> #define N 1000000 #define INF 1000000006 using namespace std; struct card { char f; int s; }; card a[N], L[N], R[N], b[N]; int n, cnt; void merge(int l, int m, int r) { int n1 = m - l, n2 = r - m; for (int i = 0; i < n1; i++) L[i] = b[l + i]; for (int i = 0; i < n2; i++) R[i] = ...
#include <iostream> #define N 1000000 #define INF 1000000006 using namespace std; struct card { char f; int s; }; card a[N], L[N], R[N], b[N]; int n, cnt; void merge(int l, int m, int r) { int n1 = m - l, n2 = r - m; for (int i = 0; i < n1; i++) L[i] = b[l + i]; for (int i = 0; i < n2; i++) R[i] = ...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
121,056
121,057
u849340810
cpp
p02277
#include <iostream> #include <limits> #include <vector> using namespace std; struct TCard { int Number; char Mark; }; int Partition(vector<TCard> &A, int p, int r) { int i = p - 1; for (int j = p; j < r; j++) { if (A[j].Number <= A[r].Number) { i++; swap(A[i], A[j]); } } swap(A[i + 1],...
#include <iostream> #include <limits> #include <vector> using namespace std; struct TCard { int Number; char Mark; }; int Partition(vector<TCard> &A, int p, int r) { int i = p - 1; for (int j = p; j < r; j++) { if (A[j].Number <= A[r].Number) { i++; swap(A[i], A[j]); } } swap(A[i + 1],...
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
121,066
121,067
u050511799
cpp
p02277
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct TCard { int Number; char Mark; bool operator<(const TCard &Y) const; bool operator==(const TCard &Y) const; }; bool TCard::operator<(const TCard &Y) const { return Number < Y.Number; } bool TCard::operator==(const TCard &Y...
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct TCard { int Number; char Mark; bool operator<(const TCard &Y) const; bool operator==(const TCard &Y) const; }; bool TCard::operator<(const TCard &Y) const { return Number < Y.Number; } bool TCard::operator==(const TCard &Y...
[ "identifier.change", "function.return_value.change", "expression.operation.binary.change" ]
121,068
121,069
u050511799
cpp
p02277
#include <iostream> #include <string> #include <vector> using namespace std; #define MAX_LEN 50000 #define BIG 2000000000 class MergeSort { private: vector<pair<int, char>> tmp; void merge(vector<pair<int, char>> &data, int l, int m, int h) { for (int i = l; i < h; ++i) tmp[i] = data[i]; int i = l...
#include <iostream> #include <string> #include <vector> using namespace std; #define MAX_LEN 50000 #define BIG 2000000000 class MergeSort { private: vector<pair<int, char>> tmp; void merge(vector<pair<int, char>> &data, int l, int m, int h) { for (int i = l; i < h; ++i) tmp[i] = data[i]; int i = l...
[ "identifier.change", "call.arguments.change" ]
121,076
121,077
u922538592
cpp
p02277
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; long long cnt; struct SSS { string str; int val; SSS(string s = "", int v = 0) : str(s), val(v){}; }; void print(vector<SSS> &data) { for (int i = 0; i...
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; long long cnt; struct SSS { string str; int val; SSS(string s = "", int v = 0) : str(s), val(v){}; }; void print(vector<SSS> &data) { for (int i = 0; i...
[ "control_flow.branch.if.condition.change" ]
121,078
121,079
u922538592
cpp
p02277
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; long long cnt; struct SSS { string str; int val; SSS(string s = "", int v = 0) : str(s), val(v){}; }; void print(vector<SSS> &data) { for (int i = 0; i...
#include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; long long cnt; struct SSS { string str; int val; SSS(string s = "", int v = 0) : str(s), val(v){}; }; void print(vector<SSS> &data) { for (int i = 0; i...
[ "identifier.change", "call.arguments.change", "io.output.change" ]
121,080
121,081
u922538592
cpp
p02277
#include <algorithm> #include <iostream> using namespace std; static const int MAX = 100000; struct Card { char suit; int value; bool operator<=(const Card &right) const { return value <= right.value; } }; Card sentinel = Card{1, 1000000000}; int merge(Card A[], int left, int mid, int right) { int n1 = mid -...
#include <algorithm> #include <iostream> using namespace std; static const int MAX = 100000; struct Card { char suit; int value; bool operator<=(const Card &right) const { return value <= right.value; } }; Card sentinel = Card{1, 1000000000}; int merge(Card A[], int left, int mid, int right) { int n1 = mid -...
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "expression.operation.binary.remove" ]
121,084
121,085
u947975951
cpp
p02277
#include <algorithm> #include <iostream> using namespace std; static const int MAX = 100000; struct Card { char suit; int value; bool operator<=(const Card &right) const { return value <= right.value; } }; Card sentinel = Card{1, 1000000000}; int merge(Card A[], int left, int mid, int right) { int n1 = mid -...
#include <algorithm> #include <iostream> using namespace std; static const int MAX = 100000; struct Card { char suit; int value; bool operator<=(const Card &right) const { return value <= right.value; } }; Card sentinel = Card{1, 1000000000}; int merge(Card A[], int left, int mid, int right) { int n1 = mid -...
[ "expression.operation.binary.remove" ]
121,086
121,085
u947975951
cpp