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
p02262
C++
Runtime Error
#include <iostream> #include <string> using namespace std; long d = 0, z = 0, b[1000000]; void ChentrucTiep(long long a[], long n, long h) { int x, k; for (int i = h; i < n; i++) { x = a[i]; k = i - h; while (k >= 0 && a[k] > x) { a[k + h] = a[k]; k -= h; d++; } a[k + h] = x; ...
#include <iostream> #include <string> using namespace std; long d = 0, z = 0, b[1000000]; void ChentrucTiep(long long a[], long n, long h) { int x, k; for (int i = h; i < n; i++) { x = a[i]; k = i - h; while (k >= 0 && a[k] > x) { a[k + h] = a[k]; k -= h; d++; } a[k + h] = x; ...
replace
30
31
30
31
0
p02262
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; static long long cnt; static int l; static int A[100000]; static int n; vector<int> G; void insertion(int *A, int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; whi...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; long long cnt; int l; int A[100000000]; int n; vector<int> G; void insertion(int *A, int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) {...
replace
7
11
7
11
0
p02262
C++
Runtime Error
#include <iostream> using namespace std; int insertion_sort(int *seq, int length, int g) { int temp, count = 0; int v, j; for (int i = g; i < length; i++) { v = seq[i]; j = i - g; while (j >= 0 && seq[j] > v) { seq[j + g] = seq[j]; j = j - g; count++; } seq[j + g] = v; } ...
#include <iostream> using namespace std; int insertion_sort(int *seq, int length, int g) { int temp, count = 0; int v, j; for (int i = g; i < length; i++) { v = seq[i]; j = i - g; while (j >= 0 && seq[j] > v) { seq[j + g] = seq[j]; j = j - g; count++; } seq[j + g] = v; } ...
replace
41
42
41
42
0
p02262
C++
Runtime Error
#include <cstdlib> #include <iostream> #include <sstream> #include <stdio.h> #include <string.h> using namespace std; #define BUF_SIZE 1024 int count = 0; void insertionSort(int array[], int n, int g) { int v, j; for (int i = g; i < n; i++) { v = array[i]; j = i - g; while (j >= 0 && array[j] > v) {...
#include <cstdlib> #include <iostream> #include <sstream> #include <stdio.h> #include <string.h> using namespace std; #define BUF_SIZE 1024 int count = 0; void insertionSort(int array[], int n, int g) { int v, j; for (int i = g; i < n; i++) { v = array[i]; j = i - g; while (j >= 0 && array[j] > v) {...
replace
63
64
63
64
0
p02262
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; long long cnt = 0; void insertionSort(int numbers[], int n, int g) { for (int i = g; i < n; i++) { int v = numbers[i]; int j = i - g; while (j >= 0 && numbers[j] > v) { numbers[j + g] = numbers[j]; j = j - g; cnt++; } nu...
#include <iostream> #include <vector> using namespace std; long long cnt = 0; void insertionSort(int numbers[], int n, int g) { for (int i = g; i < n; i++) { int v = numbers[i]; int j = i - g; while (j >= 0 && numbers[j] > v) { numbers[j + g] = numbers[j]; j = j - g; cnt++; } nu...
replace
39
40
39
40
0
p02262
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; long long cnt; int l; int A[1000000]; int n; vector<int> G; // 間隔gを指定した挿入ソート void insertionSort(int A[], int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; while (j ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; long long cnt; int l; int A[1000000]; int n; vector<int> G; // 間隔gを指定した挿入ソート void insertionSort(int A[], int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; while (j ...
insert
30
30
30
32
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02262
C++
Runtime Error
#include <stdio.h> long long cnt; int G[100]; int m; void insertionSort(int A[], int n, int g) { int v, i, j; for (i = g; i < n; i++) { v = A[i]; j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] = v; } } void print(int m, int G[], int A...
#include <stdio.h> long long cnt; int G[100]; int m; void insertionSort(int A[], int n, int g) { int v, i, j; for (i = g; i < n; i++) { v = A[i]; j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] = v; } } void print(int m, int G[], int A...
replace
57
58
57
58
0
p02262
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; template <typename T> void insertion_sort(vector<T> &A, int g); template <typename T> void shell_sort(vector<T> &A); int cnt = 0; int main() { int n = 0; cin >> n; vector<int> A(n); for (auto &ai : A) cin >> ai; shell_sort...
#include <algorithm> #include <iostream> #include <vector> using namespace std; template <typename T> void insertion_sort(vector<T> &A, int g); template <typename T> void shell_sort(vector<T> &A); int cnt = 0; int main() { int n = 0; cin >> n; vector<int> A(n); for (auto &ai : A) cin >> ai; shell_sort...
replace
37
38
37
38
0
p02262
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; long InsertionSort(vector<int> &A, int n, int g) { long cnt = 0; for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; ++cnt; } A[j + g] = v; } return cnt; } void S...
#include "bits/stdc++.h" using namespace std; long InsertionSort(vector<int> &A, int n, int g) { long cnt = 0; for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; ++cnt; } A[j + g] = v; } return cnt; } void S...
replace
49
50
49
50
0
sh: 1: pause: not found
p02262
C++
Runtime Error
#include <iostream> using namespace std; template <typename T> void cout_seq(T seq[], int n) { for (int i = 0; i < n; i++) { if (i) { cout << " "; } cout << seq[i]; } cout << endl; } int insertion_sort(int A[], int n, int g) { int cnt = 0; for (int i = g; i < n; i++) { int v = A[i]; ...
#include <iostream> using namespace std; template <typename T> void cout_seq(T seq[], int n) { for (int i = 0; i < n; i++) { if (i) { cout << " "; } cout << seq[i]; } cout << endl; } int insertion_sort(int A[], int n, int g) { int cnt = 0; for (int i = g; i < n; i++) { int v = A[i]; ...
replace
32
33
32
33
0
p02262
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long lli; typedef vector<lli> vll; typedef vector<bool> vbl; typedef vector<vector<lli>> mat;...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long lli; typedef vector<lli> vll; typedef vector<bool> vbl; typedef vector<vector<lli>> mat;...
replace
31
32
31
32
0
p02262
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int n, a[1111111], c, g[20]; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } g[0] = 1; c = 0; while (true) { g[c + 1] = g[c] * 3 + 1; if (g[++c] >= n) break; } ...
#include <algorithm> #include <iostream> using namespace std; int n, a[1111111], c, g[20]; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } g[0] = 1; c = 0; while (true) { g[c + 1] = g[c] * 3 + 1; if (g[++c] >= n) break; } ...
replace
20
21
20
21
-11
p02262
C++
Runtime Error
#include <cstdio> #include <iostream> #include <vector> using namespace std; long long ShellSort(int elem[], int num) { int i, j, k; int h; int target; long long cnt = 0; vector<int> vect; for (h = 1;;) { if (h <= num) { vect.push_back(h); } else { break; } h = 3 * h + 1; } ...
#include <cstdio> #include <iostream> #include <vector> using namespace std; long long ShellSort(int elem[], int num) { int i, j, k; int h; int target; long long cnt = 0; vector<int> vect; for (h = 1;;) { if (h <= num) { vect.push_back(h); } else { break; } h = 3 * h + 1; } ...
replace
51
52
51
52
0
p02262
C++
Memory Limit Exceeded
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
replace
199
200
199
200
MLE
p02262
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <vector> unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap = 1) { unsigned count = 0; for (unsigned i = gap; i < n; i++) { unsigned v = a[i]; int j = i - gap; while (j >= 0 && a[j] > v) { a[j + gap] = a[j]; j -=...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap = 1) { unsigned count = 0; for (unsigned i = gap; i < n; i++) { unsigned v = a[i]; int j = i - gap; while (j >= 0 && a[j] > v) { a[j + gap] = a[j]; j -=...
delete
36
37
36
36
0
1
p02262
C++
Runtime Error
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
replace
195
199
195
200
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02262
C++
Time Limit Exceeded
#include <iostream> unsigned gaps[] = {1, 8, 23, 77, 281, 1073, 4193, 16577, 65921, 262913}; // generated from pow(4,i)+3*pow(2,i-1)+1 (prefixed with 1) unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap) { unsigned count = 0; for (unsigned i = gap; i < n; i++) { unsigned v = a[i]; int j; ...
#include <iostream> unsigned gaps[] = {1, 8, 23, 77, 281, 1073, 4193, 16577, 65921, 262913}; // generated from pow(4,i)+3*pow(2,i-1)+1 (prefixed with 1) unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap) { unsigned count = 0; for (unsigned i = gap; i < n; i++) { unsigned v = a[i]; int j = i -...
replace
9
11
9
11
TLE
p02262
C++
Runtime Error
#include <iostream> using std::cin; using std::cout; unsigned gaps[] = {1, 8, 23, 77, 281, 1073, 4193, 16577, 65921, 262913, 1050113}; // generated from pow(4,i)+3*pow(2,i-1)+1 (prefixed with 1) unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap) { unsigned count = 0;...
#include <iostream> using std::cin; using std::cout; unsigned gaps[] = {1, 8, 23, 77, 281, 1073, 4193, 16577, 65921, 262913, 1050113}; // generated from pow(4,i)+3*pow(2,i-1)+1 (prefixed with 1) unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap) { unsigned count = 0;...
replace
26
27
26
27
0
p02262
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <vector> using namespace std; #define maxn 100000 int a[maxn]; int n; // size of the array vector<int> G; int cnt = 0; void insertionSort(int g) { for (int i = g; i < n; i++) { int key = a[i]; int j = i - g; while (j >=...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <vector> using namespace std; #define maxn 1000005 int a[maxn]; int n; // size of the array vector<int> G; int cnt = 0; void insertionSort(int g) { for (int i = g; i < n; i++) { int key = a[i]; int j = i - g; while (j >...
replace
6
7
6
7
0
p02262
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { int n; int A[1000000]; cin >> n; for (int i = 0; i < n; i++) cin >> A[i]; int m = 0; int g = 0; int cnt = 0; vector<int> G; while (3 * g + 1 < n) g = 3 * g + 1; for (; g > 0; g...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { int n; int A[1000000]; cin >> n; for (int i = 0; i < n; i++) cin >> A[i]; int m = 0; int g = 0; int cnt = 0; vector<int> G; while (3 * g + 1 <= n) g = 3 * g + 1; for (; g > 0; ...
replace
17
18
17
18
0
p02262
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int g_count = 0; const int MAX_N = 10000; vector<int> g; void insertionSort(int *a, int n, int g) { for (int i = g; i < n; i++) { int v = a[i]; int j = i - g; while (j >= 0 && a[j] > v) { a[j + g] = a[j]; j = j - g; g_count++;...
#include <iostream> #include <vector> using namespace std; long long g_count = 0; const int MAX_N = 1000000; vector<int> g; void insertionSort(int *a, int n, int g) { for (int i = g; i < n; i++) { int v = a[i]; int j = i - g; while (j >= 0 && a[j] > v) { a[j + g] = a[j]; j = j - g; g_...
replace
5
7
5
7
0
p02262
C++
Runtime Error
#include <iostream> #include <vector> unsigned gaps[] = {1, 8, 23, 77, 281, 1073, 4193, 16577, 65921, 262913}; // generated from pow(4,i)+3*pow(2,i-1)+1 (prefixed with 1) unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap = 1) { unsigned count = 0; for (unsigned i = gap; i < n; i++) { unsigned v =...
#include <iostream> #include <vector> unsigned gaps[] = {1, 8, 23, 77, 281, 1073, 4193, 16577, 65921, 262913}; // generated from pow(4,i)+3*pow(2,i-1)+1 (prefixed with 1) unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap = 1) { unsigned count = 0; for (unsigned i = gap; i < n; i++) { unsigned v =...
replace
34
36
34
36
0
1
p02262
C++
Runtime Error
#include <cstdio> #include <iostream> using namespace std; int m = 0, cnt = 0, G[100]; void shellSort(int a[], int n) { int i, j; cnt = 0; G[0] = 1; while (1) { G[m + 1] = 3 * G[m] + 1; if (G[m + 1] >= n) break; else m++; } m++; for (i = m - 1; i >= 0; i--) { int k, j, tmp; ...
#include <cstdio> #include <iostream> using namespace std; int m = 0, cnt = 0, G[100]; void shellSort(int a[], int n) { int i, j; cnt = 0; G[0] = 1; while (1) { G[m + 1] = 3 * G[m] + 1; if (G[m + 1] >= n) break; else m++; } m++; for (i = m - 1; i >= 0; i--) { int k, j, tmp; ...
replace
34
35
34
35
0
p02262
C++
Runtime Error
#include <cstdio> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; int A[n]; for (int i = 0; i < n; i++) { scanf("%d", A[i]); } int cnt = 0; vector<int> G; for (int h = 1;;) { if (h > n) { break; } G.push_back(h); h = 3 * h + 1; } fo...
#include <cstdio> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; int A[n]; for (int i = 0; i < n; i++) { scanf("%d", &A[i]); } int cnt = 0; vector<int> G; for (int h = 1;;) { if (h > n) { break; } G.push_back(h); h = 3 * h + 1; } f...
replace
10
11
10
11
-11
p02262
C++
Runtime Error
#include <cmath> #include <iostream> #include <memory> constexpr int max_size() { return static_cast<int>(1e+6); } int insert(int *a, const int i, const int gear) { if (i < gear) { return 0; } if (a[i - gear] <= a[i]) { return 0; } std::swap(a[i - gear], a[i]); return 1 + insert(a, i - gear, gea...
#include <cmath> #include <iostream> #include <memory> constexpr int max_size() { return static_cast<int>(1e+6); } int insert(int *a, const int i, const int gear) { if (i < gear) { return 0; } if (a[i - gear] <= a[i]) { return 0; } std::swap(a[i - gear], a[i]); return 1 + insert(a, i - gear, gea...
replace
39
40
39
46
0
p02262
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int maxn = 105; int s[maxn], n, cnt; vector<int> v; void insertionsort(int g) { for (int i = g; i < n; i++) { int v = s[i], j = i - g; while (j >= 0 && s[j] > v) { s[j + g] = s[j]; j -= g; cnt++; } s[j + g] = v; } } void she...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5; int s[maxn], n, cnt; vector<int> v; void insertionsort(int g) { for (int i = g; i < n; i++) { int v = s[i], j = i - g; while (j >= 0 && s[j] > v) { s[j + g] = s[j]; j -= g; cnt++; } s[j + g] = v; } } void...
replace
5
6
5
6
0
p02262
C++
Runtime Error
#include <iostream> #include <math.h> using namespace std; int insertionSort(int, int, int); void shellSort(int *, int); int cnt = 0; int main(void) { int A[100], N; cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; } shellSort(A, N); } int insertionSort(int A[], int n, int g) { int v, j, cnt = 0; ...
#include <iostream> #include <math.h> using namespace std; int insertionSort(int, int, int); void shellSort(int *, int); int cnt = 0; int main(void) { int A[1000000], N; cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; } shellSort(A, N); } int insertionSort(int A[], int n, int g) { int v, j, cnt = 0...
replace
7
8
7
8
0
p02262
C++
Runtime Error
/** * Shell Sort ?¬????????????°?????????????????\?????????????????¨?????? n ????????´??°???????????°??? A ??????????????´?????????????????°????????§?????? 1 insertionSort(A, n, g) 2 for i = g to n-1 3 v = A[i] 4 j = i - g 5 while j >= 0 && A[j] > v 6 A[j+g] = A[j] 7 ...
/** * Shell Sort ?¬????????????°?????????????????\?????????????????¨?????? n ????????´??°???????????°??? A ??????????????´?????????????????°????????§?????? 1 insertionSort(A, n, g) 2 for i = g to n-1 3 v = A[i] 4 j = i - g 5 while j >= 0 && A[j] > v 6 A[j+g] = A[j] 7 ...
replace
149
150
149
150
0
p02262
C++
Time Limit Exceeded
#include <iostream> #include <string> #include <vector> using namespace std; //?????§????????????=?????\??????????????????????´???¨??????????????? void InsertionSort(vector<long> &A, long n, long g, long &cnt) { long i, v, j; // g????????????????????????,n???????´???° // for (i = g; i < n; ++i) { v = A[i...
#include <iostream> #include <string> #include <vector> using namespace std; //?????§????????????=?????\??????????????????????´???¨??????????????? void InsertionSort(vector<long> &A, long n, long g, long &cnt) { long i, v, j; // g????????????????????????,n???????´???° // for (i = g; i < n; ++i) { v = A[i...
replace
41
43
41
43
TLE
p02262
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef long double lb; const int INF = 1 << 27; const int MOD = (int)1e9 + 7; int cnt; void read(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef long double lb; const int INF = 1 << 27; const int MOD = (int)1e9 + 7; int cnt; void read(...
replace
58
59
58
59
0
p02262
C++
Runtime Error
#include <cstdio> int G[101]; int A[1000002]; int insertion_sort(int *A, int n, int g) { int cnt = 0; for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; cnt++; } A[j + g] = v; } return cnt; } int shell_sort(in...
#include <cstdio> int G[101]; int A[1000002]; int insertion_sort(int *A, int n, int g) { int cnt = 0; for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; cnt++; } A[j + g] = v; } return cnt; } int shell_sort(in...
replace
24
29
24
27
0
p02262
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int cnt = 0; void insertionSort(vector<int> &A, int g) { for (int i = g; i < A.size(); ++i) { if (A[i - g] > A[i]) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; ++cnt; ...
#include <iostream> #include <vector> using namespace std; int cnt = 0; void insertionSort(vector<int> &A, int g) { for (int i = g; i < A.size(); ++i) { if (A[i - g] > A[i]) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; ++cnt; ...
replace
31
32
31
32
0
p02262
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; long long cnt; int A[1000005]; vector<int> G; void insertionSort(int A[], int n, int g); void shellSort(int A[], int n); int main() { int n; cin >> n; for (int i = 0; i < n; i++) { scanf("%d", ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; long long cnt; int A[1000005]; vector<int> G; void insertionSort(int A[], int n, int g); void shellSort(int A[], int n); int main() { int n; cin >> n; for (int i = 0; i < n; i++) { scanf("%d", ...
replace
39
40
39
40
0
p02262
C++
Runtime Error
#include <stdio.h> #include <string.h> struct NUM { int cnt; int m; int G[100]; }; int InsertionSort(int A[], int n, int g) { int i, v, j, cnt = 0; for (i = g; i < n; i++) { v = A[i]; j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] ...
#include <stdio.h> #include <string.h> struct NUM { int cnt; int m; int G[100]; }; int InsertionSort(int A[], int n, int g) { int i, v, j, cnt = 0; for (i = g; i < n; i++) { v = A[i]; j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] ...
replace
44
45
44
45
0
p02262
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; class cShell { int m_n; int cnt; vector<int> vA; vector<int> vg; void insertionSort(int g); public: cShell(int n, vector<int> &v) { ...
#include <algorithm> #include <cmath> #include <cstring> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; class cShell { int m_n; int cnt; vector<int> vA; vector<int> vg; void insertionSort(int g); public: cShell(int n, vector<int> &v) { ...
replace
53
55
53
59
0
p02262
C++
Runtime Error
#include <iostream> #include <ostream> #include <vector> void trace_space(std::vector<int> v) { for (std::vector<int>::iterator i = v.begin(); i != v.end(); ++i) { std::cout << *i << " "; } std::cout << std::endl; } void trace_endl(std::vector<int> v) { for (std::vector<int>::iterator i = v.begin(); i != ...
#include <iostream> #include <ostream> #include <vector> void trace_space(std::vector<int> v) { for (std::vector<int>::iterator i = v.begin(); i != v.end(); ++i) { std::cout << *i << " "; } std::cout << std::endl; } void trace_endl(std::vector<int> v) { for (std::vector<int>::iterator i = v.begin(); i != ...
replace
32
33
32
33
0
p02262
C++
Runtime Error
#include <cstdio> #include <vector> using namespace std; #define NMAX 1000000 void printArr(int A[], int N) { for (int i = 0; i < N; ++i) { printf("%d\n", A[i]); } } void printG(vector<int> v) { int N = v.size(); for (int i = N - 1; i >= 1; --i) { printf("%d ", v[i]); } printf("%d\n", v[0]); } lo...
#include <cstdio> #include <vector> using namespace std; #define NMAX 1000000 void printArr(int A[], int N) { for (int i = 0; i < N; ++i) { printf("%d\n", A[i]); } } void printG(vector<int> v) { int N = v.size(); for (int i = N - 1; i >= 1; --i) { printf("%d ", v[i]); } printf("%d\n", v[0]); } lo...
replace
41
42
41
42
0
p02262
C++
Runtime Error
#include <cmath> #include <iostream> using namespace std; int cnt = 0; int m = 100; int G[100] = {}; void insertionsort(int A[], int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] ...
#include <cmath> #include <iostream> using namespace std; int cnt = 0; int m = 20; int G[20] = {}; void insertionsort(int A[], int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] = ...
replace
5
7
5
7
-11
p02262
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; long long cnt; int l; int A[1000000]; int n; vector<int> G; void insertionSort(int A[], int n, int g) { for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; cnt++; } A[j + g...
#include "bits/stdc++.h" using namespace std; long long cnt; int l; int A[1000000]; int n; vector<int> G; void insertionSort(int A[], int n, int g) { for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; cnt++; } A[j + g...
replace
28
29
28
29
-11
p02262
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <stdio.h> #include <vector> using namespace std; long long cnt; int l, n; int A[1000000]; vector<int> G; void insertion(int A[], int n, int g) { int i, V, j; for (i = g; i < n; i++) { V = A[i]; j = i - g; while (j >= ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <stdio.h> #include <vector> using namespace std; long long cnt; int l, n; int A[1000000]; vector<int> G; void insertion(int A[], int n, int g) { int i, V, j; for (i = g; i < n; i++) { V = A[i]; j = i - g; while (j >= ...
delete
40
41
40
40
0
p02262
C++
Runtime Error
#include <cmath> #include <cstdio> int cnt; int m; int G[100]; void insertionSort(int *A, int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] = v; } } void shellSort(int *A, int ...
#include <cmath> #include <cstdio> int cnt; int m; int G[100]; void insertionSort(int *A, int n, int g) { for (int i = g; i < n; i++) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] = v; } } void shellSort(int *A, int ...
replace
39
40
39
40
0
p02262
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> using namespace std; int cnt = 0; vector<int> G; void insertsort(int A[], int n, int g) { for (int i = g; i < n; i++) { int temp = A[i], j = i - g; while (j >= 0 && A[j] > temp) { A[j + g] = A[j]; j -= g; cnt++; ...
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> using namespace std; int cnt = 0; vector<int> G; void insertsort(int A[], int n, int g) { for (int i = g; i < n; i++) { int temp = A[i], j = i - g; while (j >= 0 && A[j] > temp) { A[j + g] = A[j]; j -= g; cnt++; ...
replace
30
31
30
31
-11
p02262
C++
Runtime Error
#include <bits/stdc++.h> int count; void insertionSort(int A[], int N, int G) { for (int i = G; i < N; ++i) { int v = A[i]; int j = i - G; while (j >= 0 and A[j] > v) { A[j + G] = A[j]; j = j - G; count += 1; } A[j + G] = v; } return; } void shellSort(int A[], int N) { c...
#include <bits/stdc++.h> int count; void insertionSort(int A[], int N, int G) { for (int i = G; i < N; ++i) { int v = A[i]; int j = i - G; while (j >= 0 and A[j] > v) { A[j + G] = A[j]; j = j - G; count += 1; } A[j + G] = v; } return; } void shellSort(int A[], int N) { c...
replace
20
21
20
21
0
p02262
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <vector> #define Lens 100005 #define Nil -1 using namespace std; int N, sum; int a[Lens]; vector<int> b, G; void selectionsort(int a[], int g) { for (int i = g; i < N; i++) { int j = i - g; int mini = a[i]; while (j >= ...
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <vector> #define Lens 1000005 #define Nil -1 using namespace std; int N, sum; int a[Lens]; vector<int> b, G; void selectionsort(int a[], int g) { for (int i = g; i < N; i++) { int j = i - g; int mini = a[i]; while (j >=...
replace
5
6
5
6
0
p02262
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <vector> #define MAX_N 1000000 using namespace std; long long A[MAX_N]; vector<int> G; int cnt = 0; void printNums(int n) { for (int i = 0; i < n; i++) { printf("%lld\n", A[i]); } } void getG(int n) { int k = 1; while (k < n) { G.push_back(k); k =...
#include <algorithm> #include <cstdio> #include <vector> #define MAX_N 1000000 using namespace std; long long A[MAX_N]; vector<int> G; int cnt = 0; void printNums(int n) { for (int i = 0; i < n; i++) { printf("%lld\n", A[i]); } } void getG(int n) { int k = 1; while (k <= n) { G.push_back(k); k ...
replace
20
21
20
21
0
p02262
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; void printa(int A[], int len, string separator) { cout << A[0]; for (int i = 1; i < len; i++) cout << separator << A[i]; cout << endl; } int insertionSort(int A[], int len, int g) { int cnt = 0; for (int i = g; i < len; i++) { int v = A[i];...
#include <iostream> #include <vector> using namespace std; void printa(int A[], int len, string separator) { cout << A[0]; for (int i = 1; i < len; i++) cout << separator << A[i]; cout << endl; } int insertionSort(int A[], int len, int g) { int cnt = 0; for (int i = g; i < len; i++) { int v = A[i];...
replace
30
31
30
31
0
p02262
C++
Runtime Error
#include <cmath> #include <iostream> using namespace std; void insertionSort(int *, int, int); void shellSort(int *, int); void write(int *, int, int *, int); int cnt = 0; int main() { int n, A[100010]; cin >> n; for (int i = 0; i < n; i++) { cin >> A[i]; } shellSort(A, n); } void insertionSort(int *A, ...
#include <cmath> #include <iostream> using namespace std; void insertionSort(int *, int, int); void shellSort(int *, int); void write(int *, int, int *, int); int cnt = 0; int main() { int n, A[1000010]; cin >> n; for (int i = 0; i < n; i++) { cin >> A[i]; } shellSort(A, n); } void insertionSort(int *A,...
replace
9
10
9
10
0
p02262
C++
Runtime Error
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, cnt; vector<int> nums; auto insertionSort = [&nums, &n, &cnt](int d) { for (int i = d; i < n; ++i) { int top = nums[i]; int j; for (j = i - d; i >= 0 && nums[j] > top; j -= d) { nums[j + ...
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, cnt; vector<int> nums; auto insertionSort = [&nums, &n, &cnt](int d) { for (int i = d; i < n; ++i) { int top = nums[i]; int j; for (j = i - d; j >= 0 && nums[j] > top; j -= d) { nums[j + ...
replace
12
13
12
13
0
p02262
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int m; vector<int> G; int insertionSort(int A[], int n, int g) { int cnt = 0; for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; cnt++; } ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int m; vector<int> G; int insertionSort(int A[], int n, int g) { int cnt = 0; for (int i = g; i < n; ++i) { int v = A[i]; int j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j -= g; cnt++; } ...
replace
39
40
39
40
0
p02262
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <list> #include <string> #include <vector> using namespace std; template <typename T> void WriteLine_Container(const T &container); void InsertionSort(vector<int> &v, int n, int g, int &cnt); void ShellSort(vector<int> &v, int n); int main() { int len; cin >> len...
#include <algorithm> #include <iostream> #include <list> #include <string> #include <vector> using namespace std; template <typename T> void WriteLine_Container(const T &container); void InsertionSort(vector<int> &v, int n, int g, int &cnt); void ShellSort(vector<int> &v, int n); int main() { int len; cin >> len...
replace
32
33
32
35
TLE
p02262
C++
Runtime Error
#include <iostream> #include <utility> using namespace std; void output(int n, int elements[]) { for (int i = 0; i < n; i++) cout << elements[i] << '\n'; } int insertion_sort(int n, int elements[], int g) { int cnt = 0; for (int i = g; i < n; i++) { int key = elements[i], j = i - g; while (0 <= j &...
#include <iostream> #include <utility> using namespace std; void output(int n, int elements[]) { for (int i = 0; i < n; i++) cout << elements[i] << '\n'; } int insertion_sort(int n, int elements[], int g) { int cnt = 0; for (int i = g; i < n; i++) { int key = elements[i], j = i - g; while (0 <= j &...
replace
28
29
28
29
0
p02262
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; vector<int> A; int cnt; void insertionSort(int n, int g) { int j, v; for (int i = g; i < n; i++) { v = A[i]; j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] = v; } } void shellSort(int n) { ...
#include <bits/stdc++.h> using namespace std; vector<int> A; int cnt; void insertionSort(int n, int g) { int j, v; for (int i = g; i < n; i++) { v = A[i]; j = i - g; while (j >= 0 && A[j] > v) { A[j + g] = A[j]; j = j - g; cnt++; } A[j + g] = v; } } void shellSort(int n) { ...
replace
23
24
23
24
TLE
p02263
C++
Time Limit Exceeded
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; #define MAX 100 #define max 1000000 void initialize(); int isEmpty(); int isFull(); void push(int); int pop(); int top; int S[max]; int main() { char c[max]; int sum = 0; int a, b; initialize(); while (cin >> c) { if (c[0] ...
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; #define MAX 200 #define max 1000000 void initialize(); int isEmpty(); int isFull(); void push(int); int pop(); int top; int S[max]; int main() { char c[max]; int sum = 0; int a, b; initialize(); while (cin >> c) { if (c[0] ...
replace
4
5
4
5
TLE
p02263
C++
Runtime Error
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int top, S[1000]; void push(int x); int pop(); int main() { top = 0; int a, b; char c; while (scanf("%s", &c)) { switch (c) { case '+': b = pop(); a = pop(); push(a + b); break; case '-': ...
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int top, S[1000]; void push(int x); int pop(); int main() { top = 0; int a, b; char c; while (scanf("%s", &c) != EOF) { switch (c) { case '+': b = pop(); a = pop(); push(a + b); break; case '-':...
replace
15
16
15
16
-11
p02263
C++
Runtime Error
#include <iostream> #include <string> using namespace std; const int MAX = 100; int top, stack[MAX]; void initialize() { top = 0; } void push(int num) { stack[++top] = num; } int pop() { top--; return stack[top + 1]; } int main() { string str; int a, b; initialize(); while (cin >> str) { // cout ...
#include <iostream> #include <string> using namespace std; const int MAX = 1000; int top, stack[MAX]; void initialize() { top = 0; } void push(int num) { stack[++top] = num; } int pop() { top--; return stack[top + 1]; } int main() { string str; int a, b; initialize(); while (cin >> str) { // cout...
replace
4
5
4
5
0
p02263
C++
Runtime Error
#include <iostream> #include <iterator> #include <string> #include <vector> using namespace std; int const MAX = 100; int top; int s[MAX]; void initalise() { top = 0; } bool isEmpty() { return top == 0; } bool isFull() { return top >= MAX - 1; } void push(int x) { if (isFull()) cout << "エラー(オーバーフロー)" << endl...
#include <iostream> #include <iterator> #include <string> #include <vector> using namespace std; int const MAX = 1000; int top; int s[MAX]; void initalise() { top = 0; } bool isEmpty() { return top == 0; } bool isFull() { return top >= MAX - 1; } void push(int x) { if (isFull()) cout << "エラー(オーバーフロー)" << end...
replace
6
7
6
7
0
p02263
C++
Memory Limit Exceeded
#include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; int main() { vector<int> NumberRow; while (true) { string in; cin >> in; if (in == "END") { break; } if (in != "+" && in != "-" && in != "*") { int Num; stringstream ss; ss <<...
#include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; int main() { vector<int> NumberRow; while (true) { string in; cin >> in; if (cin.good() == false) { break; } if (in != "+" && in != "-" && in != "*") { int Num; stringstream ss; ...
replace
11
12
11
12
MLE
p02263
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> #include <string.h> void add(int num[], int *pa) { *pa = (*pa) - 1; num[(*pa) - 1] += num[*pa]; num[*pa] = 0; } void minus(int num[], int *pa) { *pa = (*pa) - 1; num[(*pa) - 1] -= num[*pa]; num[*pa] = 0; } void multiply(int num[], int *pa) { *pa = (*pa) - 1; num...
#include <stdio.h> #include <stdlib.h> #include <string.h> void add(int num[], int *pa) { *pa = (*pa) - 1; num[(*pa) - 1] += num[*pa]; num[*pa] = 0; } void minus(int num[], int *pa) { *pa = (*pa) - 1; num[(*pa) - 1] -= num[*pa]; num[*pa] = 0; } void multiply(int num[], int *pa) { *pa = (*pa) - 1; num...
replace
34
35
34
35
-11
p02263
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <vector> #define INF 999999 #define EPS 1.0e-6 using namespace std; int main() { stack<int> s; char b[315]; scanf("%[^\n...
#include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <vector> #define INF 999999 #define EPS 1.0e-6 using namespace std; int main() { stack<int> s; char b[1050]; scanf("%[^\...
replace
18
19
18
19
0
p02263
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define MAX 100 int top; int S[MAX]; void initialize() { top = 0; } bool isEmpty() { return top == 0; } bool isFull() { return top >= MAX - 1; } void push(int x) { // if (isFull()){ // cout << "Error" <<endl; // exit(-1); //...
#include <stdio.h> #include <stdlib.h> #include <string.h> // using namespace std; #define MAX 1000 int top; int S[MAX]; void initialize() { top = 0; } bool isEmpty() { return top == 0; } bool isFull() { return top >= MAX - 1; } void push(int x) { // if (isFull()){ // cout << "Error" <<endl; // exit(-1); ...
replace
3
5
3
5
0
p02263
C++
Runtime Error
#include <ctype.h> #include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; stack<int> s; int main() { while (!s.empty()) { s.pop(); } while (cin.eof()) { string tmp = ""; cin >> tmp; stringstream ss; int a = 0; if (isdigit(tmp[0])) { ss << t...
#include <ctype.h> #include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; stack<int> s; int main() { while (!s.empty()) { s.pop(); } string tmp = ""; while (getline(cin, tmp, ' ')) { stringstream ss; int a = 0; if (isdigit(tmp[0])) { ss << tmp; ...
replace
14
18
14
16
-11
p02263
C++
Runtime Error
#include <algorithm> //std::sort #include <bitset> //std::bitset #include <chrono> //std::chrono(C++11) #include <cmath> //abs,std::pow,sqrt,sin,cos,round,floor,ceil #include <cstdlib> //abs #include <ctime> //localtime_s #include <fstream> //std::ifstream,std::ofstream #include <functional> //...
#include <algorithm> //std::sort #include <bitset> //std::bitset #include <chrono> //std::chrono(C++11) #include <cmath> //abs,std::pow,sqrt,sin,cos,round,floor,ceil #include <cstdlib> //abs #include <ctime> //localtime_s #include <fstream> //std::ifstream,std::ofstream #include <functional> //...
replace
25
27
25
26
-11
p02263
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> #include <string.h> int top, S[100]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } // int ToInt(char *s){ // int res=s[0]-'0'; // for(int i=1;s[i]!=0;i++){ // res = res*10+s[i]-'0'; // } // // return res; // } int main() { int a, b; top =...
#include <stdio.h> #include <stdlib.h> #include <string.h> int top, S[105]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } // int ToInt(char *s){ // int res=s[0]-'0'; // for(int i=1;s[i]!=0;i++){ // res = res*10+s[i]-'0'; // } // // return res; // } int main() { int a, b; top =...
replace
4
5
4
5
0
p02263
C++
Runtime Error
#include <cassert> #include <stdio.h> #include <stdlib.h> #include <string.h> int top, S[1000]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } int main() { int a, b, x, no, np; top = 0; char s[100]; no = np = 0; while (scanf("%s", s) != EOF) { if (s[0] == '+') { a...
#include <cassert> #include <stdio.h> #include <stdlib.h> #include <string.h> int top, S[1000]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } int main() { int a, b, x, no, np; top = 0; char s[100]; no = np = 0; while (scanf("%s", s) != EOF) { if (s[0] == '+') { a...
replace
43
44
43
44
0
p02263
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, start, end) for (int i = (start); i < (end); ++i) #define REP(i, n) FOR(i, 0, n) const int OP_PLUS = -1; const int O...
/** * ????????? runtime error ????????? */ #include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, start, end) for (int i = (start); i < (end); ++i) #define REP(i, n) FOR...
insert
0
0
0
4
0
p02263
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> #define MAX 1000 void initialize(); int isEmpty(); int isFull(); void push(int x); int pop(); int top; int S[100]; int main() { int i, n, ans, n1, n2, n3; char c[100]; initialize(); while (1) { if (scanf("%s", c) == EOF) break; if (c[0] == '+' || c[0] ...
#include <stdio.h> #include <stdlib.h> #define MAX 1000 void initialize(); int isEmpty(); int isFull(); void push(int x); int pop(); int top; int S[1000]; int main() { int i, n, ans, n1, n2, n3; char c[100]; initialize(); while (1) { if (scanf("%s", c) == EOF) break; if (c[0] == '+' || c[0]...
replace
12
13
12
13
0
p02263
C++
Runtime Error
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int top, S[100]; void push(int x) { S[++top] = x; } int pop() { return S[top--]; } int main() { char str[10]; int a, b; top = 0; while (scanf("%s", str) != EOF) { if (str[0] == '+') { a = pop(); b = pop(); p...
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int top, S[101]; void push(int x) { S[++top] = x; } int pop() { return S[top--]; } int main() { char str[10]; int a, b; top = 0; while (scanf("%s", str) != EOF) { if (str[0] == '+') { a = pop(); b = pop(); p...
replace
5
6
5
6
0
p02263
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; #define N 100 class Stack { public: void initialize(); bool isEmpty(); bool isFull(); void push(const int); int pop(); Stack(const int); ~Stack(); private: int top, STACKSIZE; vector<int> S; }; void addition(Stack &s) { int a = s.pop(), ...
#include <iostream> #include <vector> using namespace std; #define N 101 class Stack { public: void initialize(); bool isEmpty(); bool isFull(); void push(const int); int pop(); Stack(const int); ~Stack(); private: int top, STACKSIZE; vector<int> S; }; void addition(Stack &s) { int a = s.pop(), ...
replace
4
5
4
5
0
p02263
C++
Runtime Error
#include <cstdlib> #include <iostream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> using namespace std; #define abs(N) ((N > 0) ? N : -1 * N) #define lt(A, B) ((A > B) ? B : A) #define gt(A, B) ((A < B) ? B : A) #define print(S) (cout << S) #define println(S) (cout << S << endl) templ...
#include <cstdlib> #include <iostream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> using namespace std; #define abs(N) ((N > 0) ? N : -1 * N) #define lt(A, B) ((A > B) ? B : A) #define gt(A, B) ((A < B) ? B : A) #define print(S) (cout << S) #define println(S) (cout << S << endl) templ...
replace
16
17
16
17
0
p02263
C++
Runtime Error
#include <cstdio> #include <cstdlib> #include <iostream> #include <stack> #include <string> using namespace std; int main() { stack<int> num; string s; int a, b; while (cin >> s) { if (s >= "1") num.push(atoi(s.c_str())); else if (s == "+" || s == "-" || s == "*") { a = num.top(); nu...
#include <cstdio> #include <cstdlib> #include <iostream> #include <stack> #include <string> using namespace std; int main() { stack<int> num; string s; int a, b; while (cin >> s) { if (s >= "0") num.push(atoi(s.c_str())); else if (s == "+" || s == "-" || s == "*") { a = num.top(); nu...
replace
13
14
13
14
0
p02263
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <iomanip> #include <iostream> #include <stack> #include <string> #include <vector> using namespace std; int main() { int a, b; stack<int> st; string op; while (cin >> op) { cin >> op; if (isdigit(op[0])) st.push(stoi(op)); else...
#include <algorithm> #include <cctype> #include <cmath> #include <iomanip> #include <iostream> #include <stack> #include <string> #include <vector> using namespace std; int main() { int a, b; stack<int> st; string op; while (cin >> op) { // cout << op << endl; if (isdigit(op[0])) st.push(stoi(op...
replace
16
17
16
17
-11
p02263
C++
Runtime Error
#include <iostream> #include <stack> #include <stdlib.h> #include <string> using namespace std; int main() { string word; stack<int> S; int n, n1, n2, p; while (cin >> word) { if (word == "+") { n1 = S.top(); S.pop(); n2 = S.top(); S.pop(); n = n1 + n2; S.push(n); } ...
#include <iostream> #include <stack> #include <stdlib.h> #include <string> using namespace std; int main() { string word; stack<int> S; int n, n1, n2, p; while (cin >> word) { if (word == "+") { n1 = S.top(); S.pop(); n2 = S.top(); S.pop(); n = n1 + n2; S.push(n); } ...
replace
38
39
38
39
3
p02263
C++
Runtime Error
#include <iostream> #include <sstream> #include <string> using namespace std; class Stack { private: int sp; int S[10]; public: Stack() { sp = 0; } bool isFull() const { return sp == 100; } bool isEmpty() const { return sp == 0; } void push(int d) { if (isFull()) return; S[sp] = d; sp++;...
#include <iostream> #include <sstream> #include <string> using namespace std; class Stack { private: int sp; int S[100]; public: Stack() { sp = 0; } bool isFull() const { return sp == 100; } bool isEmpty() const { return sp == 0; } void push(int d) { if (isFull()) return; S[sp] = d; sp++...
replace
8
9
8
9
0
p02263
C++
Runtime Error
#include <iostream> #include <stack> using namespace std; int main() { stack<int> t; string s; int a, b, c; while (cin >> s) { if ("0" <= s && s <= "9") { if (s.size() >= 2) { a = s.size(); b = 1; for (int i = 0; i < a - 1; i++) b *= 10; c = 0; for (i...
#include <iostream> #include <stack> using namespace std; int main() { stack<int> t; string s; int a, b, c; while (cin >> s) { if ('0' <= s[0] && s[0] <= '9') { if (s.size() >= 2) { a = s.size(); b = 1; for (int i = 0; i < a - 1; i++) b *= 10; c = 0; ...
replace
9
10
9
10
0
p02263
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; void push(int A); int pop(void); int S[1000]; int Top = 0; int main(void) { string str; int a, b; Top = 0; while (str != "-1") { cin >> str; if (str[0] == '+') { a = pop(); b = pop(); push(a + b); } else if (str[0] == '-') { ...
#include "bits/stdc++.h" using namespace std; void push(int A); int pop(void); int S[1000]; int Top = 0; int main(void) { string str; int a, b; Top = 0; while (cin >> str) { if (str[0] == '+') { a = pop(); b = pop(); push(a + b); } else if (str[0] == '-') { b = pop(); ...
replace
14
16
14
15
-6
terminate called after throwing an instance of 'std::__ios_failure' what(): basic_ios::clear: iostream error
p02263
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <stdlib.h> #include <string> #include <vector> using namespace std; int top, s[100]; int pop() { top--; return s[top + 1]; } void push(int a) { s[++top] = a; // cout<<a<<endl; } int main() { char temp[100...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <stdlib.h> #include <string> #include <vector> using namespace std; int top, s[101]; int pop() { top--; return s[top + 1]; } void push(int a) { s[++top] = a; // cout<<a<<endl; } int main() { char temp[100...
replace
9
10
9
10
0
p02263
C++
Runtime Error
#include <cstdlib> #include <iostream> using namespace std; int top, S[100]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } int main() { int a, b; top = 0; string s; while (cin >> s) { if (s[0] == '+') { a = pop(); b = pop(); push(a + b); } else if ...
#include <cstdlib> #include <iostream> using namespace std; int top, S[101]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } int main() { int a, b; top = 0; string s; while (cin >> s) { if (s[0] == '+') { a = pop(); b = pop(); push(a + b); } else if ...
replace
5
6
5
6
0
p02263
C++
Runtime Error
#include <cstdio> #include <iostream> using namespace std; int main() { string s; long int stk[50]; int indx = 0; int i = 0; getline(cin, s); while (i < (int)s.size()) { if (s[i] == ' ') { } else if (s[i] == '+') { stk[indx - 2] += stk[indx - 1]; indx--; } else if (s[i] == '-') ...
#include <cstdio> #include <iostream> using namespace std; int main() { string s; int stk[100]; int indx = 0; int i = 0; getline(cin, s); while (i < (int)s.size()) { if (s[i] == ' ') { } else if (s[i] == '+') { stk[indx - 2] += stk[indx - 1]; indx--; } else if (s[i] == '-') { ...
replace
7
8
7
8
0
p02263
C++
Runtime Error
#include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; int main() { string str; getline(cin, str); stack<int> sta; stringstream ss(str); string item; while (getline(ss, item, ' ')) { if ('0' < item[0] && item[0] < '9') { sta.push(stoi(item)); contin...
#include <iostream> #include <sstream> #include <stack> #include <string> using namespace std; int main() { string str; getline(cin, str); stack<int> sta; stringstream ss(str); string item; while (getline(ss, item, ' ')) { if ('0' <= item[0] && item[0] <= '9') { sta.push(stoi(item)); cont...
replace
15
16
15
16
0
p02263
C++
Runtime Error
#include <cstdlib> #include <iostream> #include <string> using namespace std; struct stack { public: int top; int stk[5]; void reset() { top = 0; } void push(int x) { top++; stk[top] = x; } int pop() { top--; return stk[top + 1]; } }; int main() { string in; stack stack; stack.res...
#include <cstdlib> #include <iostream> #include <string> using namespace std; struct stack { public: int top; int stk[10000]; void reset() { top = 0; } void push(int x) { top++; stk[top] = x; } int pop() { top--; return stk[top + 1]; } }; int main() { string in; stack stack; stack...
replace
8
9
8
9
0
p02263
C++
Runtime Error
#include <iostream> #include <string> using namespace std; template <typename T, int N> class stack { private: int size; T array[N]; public: stack() { size = 0; } bool push(T x) { if (isFull()) { return false; } array[size] = x; size++; return true; } T pop() { size--; ...
#include <iostream> #include <string> using namespace std; template <typename T, int N> class stack { private: int size; T array[N]; public: stack() { size = 0; } bool push(T x) { if (isFull()) { return false; } array[size] = x; size++; return true; } T pop() { size--; ...
replace
48
52
48
49
0
p02263
C++
Runtime Error
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; int s[1000], top = 0; void push(int x) { s[++top] = x; } int pop() { --top; return s[top + 1]; } int main() { int c, b; char a[100]; while (scanf("%s", a)) { if (a[0] == '+') { b = pop(); c = ...
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; int s[1000], top = 0; void push(int x) { s[++top] = x; } int pop() { --top; return s[top + 1]; } int main() { int c, b; char a[100]; while (scanf("%s", a) != EOF) { if (a[0] == '+') { b = pop(); ...
replace
16
17
16
17
-11
p02264
C++
Runtime Error
#include <iostream> #include <string> using namespace std; class Process { private: string name; int time; public: Process() = default; Process(string name, int time) { this->name = name; this->time = time; } string getName() { return this->name; } int getTime() { return this->time; } void se...
#include <iostream> #include <string> using namespace std; class Process { private: string name; int time; public: Process() = default; Process(string name, int time) { this->name = name; this->time = time; } string getName() { return this->name; } int getTime() { return this->time; } void se...
replace
23
24
23
24
0
p02264
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> #include <queue> #define LEN 100005 using namespace std; typedef struct node { char name[100]; int time; } P; P Q[LEN + 1]; int head, tail, n; void enqueue(P x) { Q[tail + 1] = x; } P dequeue() { return Q[head]; } int main(int argc, char *argv[]) { int...
#include <cstdio> #include <cstring> #include <iostream> #include <queue> #define LEN 300005 using namespace std; typedef struct node { char name[100]; int time; } P; P Q[LEN + 1]; int head, tail, n; void enqueue(P x) { Q[tail + 1] = x; } P dequeue() { return Q[head]; } int main(int argc, char *argv[]) { int...
replace
4
5
4
5
0
p02264
C++
Runtime Error
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; #define MAX 100000 int tail = 0; int head = 0; typedef struct _queue { char name[10]; int time; } queuecell; queuecell queue[MAX]; void enqueue(char *name, int time) { tail++; strcpy(queue[tail].name, name); queue[tail].time ...
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; #define MAX 200000 int tail = 0; int head = 0; typedef struct _queue { char name[10]; int time; } queuecell; queuecell queue[MAX]; void enqueue(char *name, int time) { tail++; strcpy(queue[tail].name, name); queue[tail].time ...
replace
4
5
4
5
0
p02264
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; class Process { public: string name; int time; }; class myqueue { public: int size; int begin; int end; Process v[111111]; myqueue() { size = 111111; begin = 0; end = 0; //[begin, end) } void push(Process a) { v[end] = a; end = (end ...
#include <bits/stdc++.h> using namespace std; class Process { public: string name; int time; }; class myqueue { public: int size; int begin; int end; Process v[111111]; myqueue() { size = 111111; begin = 0; end = 0; //[begin, end) } void push(Process a) { v[end] = a; end = (end ...
replace
26
27
26
27
0
p02264
C++
Runtime Error
#include <cstdlib> #include <iostream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> using namespace std; #define abs(N) ((N > 0) ? N : -1 * N) #define lt(A, B) ((A > B) ? B : A) #define gt(A, B) ((A < B) ? B : A) #define print(S) (cout << S) #define println(S) (cout << S << endl) templ...
#include <cstdlib> #include <iostream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> using namespace std; #define abs(N) ((N > 0) ? N : -1 * N) #define lt(A, B) ((A > B) ? B : A) #define gt(A, B) ((A < B) ? B : A) #define print(S) (cout << S) #define println(S) (cout << S << endl) templ...
replace
16
17
16
17
0
p02264
C++
Memory Limit Exceeded
#include <iostream> #include <string> using namespace std; struct queue { string name; int time; }; int tail, head; queue Q[10000000]; void enqueue(queue x); queue dequeue(); int main() { int n, q, t = 0, sum = 0; string str; cin >> n >> q; tail = n; head = 0; for (int i = 0; i < n; i++) cin >> ...
#include <iostream> #include <string> using namespace std; struct queue { string name; int time; }; int tail, head; queue Q[1000000]; void enqueue(queue x); queue dequeue(); int main() { int n, q, t = 0, sum = 0; string str; cin >> n >> q; tail = n; head = 0; for (int i = 0; i < n; i++) cin >> Q...
replace
10
11
10
11
MLE
p02264
C++
Runtime Error
#include <iostream> #include <queue> #include <string> using namespace std; int main() { int n; int q; int time_cnt = 0; std::queue<string> name; std::queue<int> time; std::string name1[10000]; int time1[10000]; std::string k_name; int k_time; std::cin >> n >> q; for (int i = 0; i < n; i++) { ...
#include <iostream> #include <queue> #include <string> using namespace std; int main() { int n; int q; int time_cnt = 0; std::queue<string> name; std::queue<int> time; std::string name1[100000]; int time1[100000]; std::string k_name; int k_time; std::cin >> n >> q; for (int i = 0; i < n; i++) ...
replace
12
14
12
14
0
p02264
C++
Runtime Error
#include <stdio.h> #include <string.h> #define LEN 100005 /* プロセスを表す構造体 */ typedef struct pp { char name[100]; int t; } P; P Q[LEN]; int head, tail, n; void enqueue(P x) { Q[tail] = x; tail = (tail + 1) % LEN; } P dequeue() { P x = Q[head]; head = (head + 1) % LEN; return x; } int min(int a, int b) {...
#include <stdio.h> #include <string.h> #define LEN 100005 /* プロセスを表す構造体 */ typedef struct pp { char name[100]; int t; } P; P Q[LEN]; int head, tail, n; void enqueue(P x) { Q[tail] = x; tail = (tail + 1) % LEN; } P dequeue() { P x = Q[head]; head = (head + 1) % LEN; return x; } int min(int a, int b) {...
replace
49
50
49
50
-11
p02264
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define Rep(b, e, i) for...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define Rep(b, e, i) for...
replace
42
43
42
43
0
p02264
C++
Runtime Error
#include <iostream> #include <utility> #include <vector> using namespace std; struct Process { string name; int time; }; int const MAX = 100000; int head; int tail; Process Q[MAX]; void initalize() { head = tail = 0; } bool isEmpty() { return head == tail; } bool isFull() { return head == (tail + 1) % MAX; } ...
#include <iostream> #include <utility> #include <vector> using namespace std; struct Process { string name; int time; }; int const MAX = 1000000; int head; int tail; Process Q[MAX]; void initalize() { head = tail = 0; } bool isEmpty() { return head == tail; } bool isFull() { return head == (tail + 1) % MAX; } ...
replace
10
11
10
11
0
p02264
C++
Runtime Error
#include <iostream> using namespace std; struct Process { string name; int time; int count; }; class Queue { private: Process store[100000]; int head, tail; Process firstProcess; public: Queue() { head = 0; tail = 0; } void enqueue(string name, int time) { Process p; p.name = name;...
#include <iostream> using namespace std; struct Process { string name; int time; int count; }; class Queue { private: Process store[1000000]; int head, tail; Process firstProcess; public: Queue() { head = 0; tail = 0; } void enqueue(string name, int time) { Process p; p.name = name...
replace
11
12
11
12
0
p02264
C++
Runtime Error
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; #define M 100000 typedef struct PT { char name[11]; int time; } PT; PT a[M + 1]; int head = 0, tail = 0; void Init() { head = tail = 0; } bool IsFull() { return tail - head == -1 || tail - head == M; } bool IsEmpty() { return head == tail...
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; #define M 100000 typedef struct PT { char name[11]; int time; } PT; PT a[M + 1]; int head = 0, tail = 0; void Init() { head = tail = 0; } bool IsFull() { return tail - head == -1 || tail - head == M; } bool IsEmpty() { return head == tail...
replace
50
51
50
51
-11
p02264
C++
Runtime Error
#include <iostream> #include <stdlib.h> #define N_MAX 1000000 using namespace std; typedef struct _a { char name[10]; int time; } P; int main() { int i; int n; int q; int head; int tail; int res_time = 0; char temp[10]; P A[N_MAX]; cin >> n; cin >> q; for (i = 0; i < n; i++) { cin >...
#include <iostream> #include <stdlib.h> #define N_MAX 99999 using namespace std; typedef struct _a { char name[10]; int time; } P; int main() { int i; int n; int q; int head; int tail; int res_time = 0; char temp[10]; P A[N_MAX]; cin >> n; cin >> q; for (i = 0; i < n; i++) { cin >> ...
replace
3
4
3
4
-11
p02264
C++
Memory Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int top = 0; int last = 0; int s[10000010]; string name[10000010]; void push(string a, int n) { s[last] = n; name[last] = a; ++last; } int front_time() { return s...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int top = 0; int last = 0; int s[1000010]; string name[1000010]; void push(string a, int n) { s[last] = n; name[last] = a; ++last; } int front_time() { return s[t...
replace
11
13
11
13
MLE
p02264
C++
Runtime Error
#include <iostream> using namespace std; struct Task { char name[10]; int rtime; }; Task task[100000]; int head, tail, n, q, len = 1000001; void unit() { head = 0; tail = 0; cin >> n >> q; } void enquene(Task t) { task[tail] = t; tail = (tail + 1) % len; } Task dequene() { Task t = task[head]; hea...
#include <iostream> using namespace std; struct Task { char name[10]; int rtime; }; Task task[100000]; int head, tail, n, q, len = 100000; void unit() { head = 0; tail = 0; cin >> n >> q; } void enquene(Task t) { task[tail] = t; tail = (tail + 1) % len; } Task dequene() { Task t = task[head]; head...
replace
9
10
9
10
0
p02264
C++
Memory Limit Exceeded
#include <iostream> #include <string> using namespace std; pair<string, int> D[10000000]; int n, q, b[100000]; string s[100000]; int main() { scanf("%d%d", &n, &q); int cnt = 0, t = 0; for (int i = 0; i < n; i++) { cin >> s[i] >> b[i]; D[cnt] = make_pair(s[i], b[i]); cnt++; } for (int i = 0; i < c...
#include <iostream> #include <string> using namespace std; pair<string, int> D[1000000]; int n, q, b[100000]; string s[100000]; int main() { scanf("%d%d", &n, &q); int cnt = 0, t = 0; for (int i = 0; i < n; i++) { cin >> s[i] >> b[i]; D[cnt] = make_pair(s[i], b[i]); cnt++; } for (int i = 0; i < cn...
replace
3
4
3
4
MLE
p02264
C++
Runtime Error
//============================================================================ // Name : AOJCpp.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <al...
//============================================================================ // Name : AOJCpp.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <al...
replace
12
13
12
13
0
p02264
C++
Runtime Error
//============================================================================ // Name : AOJCpp.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <al...
//============================================================================ // Name : AOJCpp.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <al...
replace
12
13
12
13
0