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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02268 | C++ | Runtime Error | #include <stdio.h>
int BsearchQ(int A[], int n, int key) {
int l = 0;
int r = n;
while (l < r) {
int mid = (l + r) / 2;
if (A[mid] == key) {
return 1;
} else if (A[mid] < key) {
l = mid + 1;
} else {
r = mid;
}
}
return 0;
}
int main() {
int n, A[10000 + 1], q, key, s... | #include <stdio.h>
int BsearchQ(int A[], int n, int key) {
int l = 0;
int r = n;
while (l < r) {
int mid = (l + r) / 2;
if (A[mid] == key) {
return 1;
} else if (A[mid] < key) {
l = mid + 1;
} else {
r = mid;
}
}
return 0;
}
int main() {
int n, A[100000 + 5], q, key, ... | replace | 19 | 20 | 19 | 20 | 0 | |
p02268 | C++ | Runtime Error | #include <iostream>
int binarySearch(int ary[], int n, int key) {
int left = 0;
int right = n;
int mid = n / 2;
while (left < right) {
if (ary[mid] == key)
return 1;
else if (key < ary[mid])
right = mid;
else
left = mid + 1;
mid = (left + right) / 2;
}
return 0;
}
... | #include <iostream>
int binarySearch(int ary[], int n, int key) {
int left = 0;
int right = n;
int mid = n / 2;
while (left < right) {
if (ary[mid] == key)
return 1;
else if (key < ary[mid])
right = mid;
else
left = mid + 1;
mid = (left + right) / 2;
}
return 0;
}
... | replace | 29 | 30 | 29 | 30 | 0 | |
p02268 | C++ | Runtime Error | #include <stdio.h>
int Binarysearch(int *, int, int);
#define N 10000
int main() {
int i, s, array[N], t, m, sum = 0;
scanf("%d", &s);
for (i = 0; i < s; i++) {
scanf("%d", &array[i]);
}
scanf("%d", &t);
for (i = 0; i < t; i++) {
scanf("%d", &m);
if (Binarysearch(array, s, m))
sum++;
}... | #include <stdio.h>
int Binarysearch(int *, int, int);
#define N 100005
int main() {
int i, s, array[N], t, m, sum = 0;
scanf("%d", &s);
for (i = 0; i < s; i++) {
scanf("%d", &array[i]);
}
scanf("%d", &t);
for (i = 0; i < t; i++) {
scanf("%d", &m);
if (Binarysearch(array, s, m))
sum++;
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02268 | C++ | Runtime Error | #include <cassert>
#include <fstream>
#include <iostream>
#include <map>
#include <stack>
#include <string.h>
#include <vector>
// TODO テンプレート化したい
// std::vector<int>::iterator binarySearch(std::vector<int> sorted_array, int
// value)
// {
// int left = 0;
// int right = sorted_array.size();
// while (le... | #include <cassert>
#include <fstream>
#include <iostream>
#include <map>
#include <stack>
#include <string.h>
#include <vector>
// TODO テンプレート化したい
// std::vector<int>::iterator binarySearch(std::vector<int> sorted_array, int
// value)
// {
// int left = 0;
// int right = sorted_array.size();
// while (le... | delete | 63 | 68 | 63 | 63 | -6 | 1d68f5f0-3617-4774-9b6f-dda702dfac12.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02268/C++/s459023231.cpp:68: int main(): Assertion `false' failed.
|
p02268 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[101];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int t, cnt = 0;
cin >> t;
int q;
for (int i = 0; i < t; i++) {
cin >> q;
if (upper_bound(a, a + n, q) - lower_bound(a, a + n, q)) {
cnt++;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[100001];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int t, cnt = 0;
cin >> t;
int q;
for (int i = 0; i < t; i++) {
cin >> q;
if (upper_bound(a, a + n, q) - lower_bound(a, a + n, q)) {
cnt++;
... | replace | 8 | 9 | 8 | 9 | 0 | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
bool search(vector<int> &S, int s, int b, int e) {
int m = (e + b) / 2;
int _s = S[m];
if (s == _s)
return true;
if (b == e)
return false;
if (_s > s)
return search(S, s, b, m - 1);
if (_s < s)
return search(S, s, m + 1, e);
}
int... | #include <iostream>
#include <vector>
using namespace std;
bool search(vector<int> &S, int s, int b, int e) {
int m = (e + b) / 2;
if (m < b)
return false;
int _s = S[m];
if (s == _s)
return true;
if (b == e)
return false;
if (_s > s)
return search(S, s, b, m - 1);
if (_s < s)
return... | insert | 7 | 7 | 7 | 9 | TLE | |
p02268 | C++ | Runtime Error | #include <stdio.h>
#define N 10000
int S[N], T[N], count = 0, n, q, i, j, minj, temp, left, right, mid;
int binarySearch(int);
int main() {
scanf("%d", &n);
i = 0;
while (i < n) {
scanf("%d", &S[i]);
i++;
}
scanf("%d", &q);
i = 0;
while (i < q) {
scanf("%d", &T[i]);
if (binarySearch(T[i... | #include <stdio.h>
#define N 100000
int S[N], T[N], count = 0, n, q, i, j, minj, temp, left, right, mid;
int binarySearch(int);
int main() {
scanf("%d", &n);
i = 0;
while (i < n) {
scanf("%d", &S[i]);
i++;
}
scanf("%d", &q);
i = 0;
while (i < q) {
scanf("%d", &T[i]);
if (binarySearch(T[... | replace | 2 | 3 | 2 | 3 | 0 | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
void A() {
int S[10000];
int T[500];
int N;
int Q;
int C = 0;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> S[i];
}
cin >> Q;
for (int i = 0; i < Q; i++) {
cin >> T[i];
}
for (int i = 0; i < Q; i++) {
for (int j = 0; j < N; j++) {
if ... | #include <iostream>
using namespace std;
void A() {
int S[10000];
int T[500];
int N;
int Q;
int C = 0;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> S[i];
}
cin >> Q;
for (int i = 0; i < Q; i++) {
cin >> T[i];
}
for (int i = 0; i < Q; i++) {
for (int j = 0; j < N; j++) {
if ... | delete | 47 | 57 | 47 | 47 | TLE | |
p02268 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int binarySearch(int A[], int n, int key) {
int mid, left = 0, right = n;
while (left < right) {
mid = (left + right) / 2;
if (A[mid] == key)
return 1;
else if (key < A[mid])
right = mid;
else
left = mid + 1;
}
return 0;
}
int mai... | #include <bits/stdc++.h>
using namespace std;
int binarySearch(int A[], int n, int key) {
int mid, left = 0, right = n;
while (left < right) {
mid = (left + right) / 2;
if (A[mid] == key)
return 1;
else if (key < A[mid])
right = mid;
else
left = mid + 1;
}
return 0;
}
int mai... | replace | 18 | 19 | 18 | 19 | 0 | |
p02268 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
bool myBinarySearch(int S[], int begin, int end, int target) {
if (begin > end) {
return false;
}
int mid = (begin + end) / 2;
if (S[mid] > target) {
return myBinarySearch(S, begin, mid - 1, target);
} else if (S[mid] < target) {
retu... | #include <algorithm>
#include <iostream>
using namespace std;
bool myBinarySearch(int S[], int begin, int end, int target) {
if (begin > end) {
return false;
}
int mid = (begin + end) / 2;
if (S[mid] > target) {
return myBinarySearch(S, begin, mid - 1, target);
} else if (S[mid] < target) {
retu... | replace | 20 | 22 | 20 | 22 | 0 | |
p02268 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a... | replace | 29 | 30 | 29 | 30 | 0 | |
p02268 | C++ | Runtime Error | #include <iostream>
using namespace std;
int binarySearch(int n, int s[], int t) {
int i = 0;
int j = n - 1;
while (i <= j) {
int mid = i + (j - i) / 2;
int guess = s[mid];
if (guess == t) {
return 1;
}
if (guess < t) {
i = mid + 1;
} else {
j = mid - 1;
}
}
retu... | #include <iostream>
using namespace std;
int binarySearch(int n, int s[], int t) {
int i = 0;
int j = n - 1;
while (i <= j) {
int mid = i + (j - i) / 2;
int guess = s[mid];
if (guess == t) {
return 1;
}
if (guess < t) {
i = mid + 1;
} else {
j = mid - 1;
}
}
retu... | replace | 22 | 23 | 22 | 23 | 0 | |
p02268 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> lake;
int main(void) {
int n, q;
cin >> n;
vector<int> s(n);
for (int i = 0; i < n... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> lake;
int main(void) {
int n, q;
cin >> n;
vector<int> s(n);
for (int i = 0; i < n... | replace | 36 | 37 | 36 | 37 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n, q;
cin >> n;
int S[n];
for (int k = 0; k < n; k++) {
cin >> S[k];
}
cin >> q;
int T[q];
for (int l = 0; l < q; l++) {
cin >> T[l];
}
int count = 0;
for (int j = 0; j < q; j++) {
int left = 0;
int right = n;
while (... | #include <iostream>
using namespace std;
int main() {
int n, q;
cin >> n;
int S[n];
for (int k = 0; k < n; k++) {
cin >> S[k];
}
cin >> q;
int T[q];
for (int l = 0; l < q; l++) {
cin >> T[l];
}
int count = 0;
for (int j = 0; j < q; j++) {
int left = 0;
int right = n;
while (... | insert | 25 | 25 | 25 | 26 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) so... | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) \
for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) so... | replace | 20 | 21 | 20 | 21 | TLE | |
p02268 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, q, S[10000], T, res = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> S[i];
}
sort(S, S + n);
cin >> q;
for (int i = 0; i < q; i++) {
cin >> T;
if (binary_search(S, S + n, T))
res++;
}
cout << res << endl;
return ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, q, S[100000], T, res = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> S[i];
}
sort(S, S + n);
cin >> q;
for (int i = 0; i < q; i++) {
cin >> T;
if (binary_search(S, S + n, T))
res++;
}
cout << res << endl;
return... | replace | 4 | 5 | 4 | 5 | 0 | |
p02268 | C++ | Time Limit Exceeded | #include <cstdio>
using namespace std;
int A[100000];
int search(int key, int n) {
int left = 0;
int right = n;
int mid;
while (left < right) { //??????????????£?????????notfound
mid = (left + right) / 2;
if (A[mid] == key)
return 1;
else if (key < A[mid]) { // motto left
right = mid;
... | #include <cstdio>
using namespace std;
int A[100000];
int search(int key, int n) {
int left = 0;
int right = n;
int mid;
while (left < right) { //??????????????£?????????notfound
mid = (left + right) / 2;
if (A[mid] == key)
return 1;
else if (key < A[mid]) { // motto left
right = mid;
... | replace | 16 | 17 | 16 | 17 | TLE | |
p02268 | C++ | Runtime Error | #include <iostream>
using namespace std;
bool binarySearch(int a[], int n, int x) {
int mid;
int left = 0;
int right = n;
while (left < right) {
mid = (left + right) / 2;
if (a[mid] == x)
return true;
else if (x < a[mid])
right = mid;
else
left = mid + 1;
}
return false;
}... | #include <iostream>
using namespace std;
bool binarySearch(int a[], int n, int x) {
int mid;
int left = 0;
int right = n;
while (left < right) {
mid = (left + right) / 2;
if (a[mid] == x)
return true;
else if (x < a[mid])
right = mid;
else
left = mid + 1;
}
return false;
}... | replace | 21 | 22 | 21 | 22 | 0 | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
#include <map>
#include <set>
#include <vector>
int main(void) {
int ans = 0;
int n, q;
std::cin >> n;
std::vector<int> arr(n);
for (auto &a : arr)
std::cin >> a;
std::cin >> q;
for (size_t i = 0; i < q; i++) {
int in = 0;
std::cin >> in;
int left = 0, mid = n / 2, rig... | #include <iostream>
#include <map>
#include <set>
#include <vector>
int main(void) {
int ans = 0;
int n, q;
std::cin >> n;
std::vector<int> arr(n);
for (auto &a : arr)
std::cin >> a;
std::cin >> q;
for (size_t i = 0; i < q; i++) {
int in = 0;
std::cin >> in;
int left = 0, mid = n / 2, rig... | replace | 25 | 26 | 25 | 26 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <stdio.h>
int A[1000000], n;
int binarySearch(int key) {
int left = 0;
int right = n;
int mid;
while (left < right) {
mid = (left + right) / 2;
if (key == A[mid])
return 1;
if (key > A[mid])
left = mid + 1;
else if (key < A[mid])
right = mid;
}
return 0;
}
int ... | #include <stdio.h>
int A[1000000], n;
int binarySearch(int key) {
int left = 0;
int right = n;
int mid;
while (left < right) {
mid = (left + right) / 2;
if (key == A[mid])
return 1;
if (key > A[mid])
left = mid + 1;
else if (key < A[mid])
right = mid;
}
return 0;
}
int ... | replace | 25 | 26 | 25 | 26 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m... | #include <bits/stdc++.h>
using namespace std;
struct cww {
cww() {
ios::sync_with_stdio(false);
cin.tie(0);
}
} star;
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m... | replace | 27 | 28 | 27 | 28 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int S[100000], T[100000], n, q, key, low = 0, upper = 0, mid, flag;
int i = 0, cnt = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> S[i];
}
cin >> q;
for (int i = 0; i < q; i++) {
cin >> T[i];
}
for (i = 0; i < q; i++) {
///-----... | #include <iostream>
using namespace std;
int main() {
int S[100000], T[100000], n, q, key, low = 0, upper = 0, mid, flag;
int i = 0, cnt = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> S[i];
}
cin >> q;
for (int i = 0; i < q; i++) {
cin >> T[i];
}
for (i = 0; i < q; i++) {
///-----... | replace | 26 | 27 | 26 | 27 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
int binarySearch(int s[], int n, int key) {
int head = 0;
int tail = n - 1;
int center;
while (head != tail) {
center = (head + tail) / 2;
if (s[center] == key) {
return center;
} else if (s[center] < key) {
head = center + 1;
} else {
tail = center - 1;... | #include <iostream>
int binarySearch(int s[], int n, int key) {
int head = 0;
int tail = n - 1;
int center;
while (head != tail) {
center = (head + tail) / 2;
if (s[center] == key) {
return center;
} else if (s[center] < key) {
head = center + 1;
} else {
tail = center;
... | replace | 16 | 17 | 16 | 17 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
#define MAXN 200000 + 10
using namespace std;
int s[MAXN];
int t[MAXN];
int ns, nt;
int tot, l, r, mid;
int main() {
int i, now;
cin >> ns;
for (i = 0; i < ns; ++i)
cin >> s[i];
cin >> nt;
for (i = 0; i < nt; ++i)
cin >> t[i];
for (i = 0; i < nt; ++i) {
now = t[i];
l = 0... | #include <iostream>
#define MAXN 200000 + 10
using namespace std;
int s[MAXN];
int t[MAXN];
int ns, nt;
int tot, l, r, mid;
int main() {
int i, now;
cin >> ns;
for (i = 0; i < ns; ++i)
cin >> s[i];
cin >> nt;
for (i = 0; i < nt; ++i)
cin >> t[i];
for (i = 0; i < nt; ++i) {
now = t[i];
l = 0... | replace | 27 | 28 | 27 | 28 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
#define MAXN 100000
#define MAXQ 50000
using namespace std;
int n, q;
int S[MAXN + 1], T[MAXQ + 1];
int cnt = 0;
bool binarySearch(int num) {
int lo, mi, hi;
bool res = false;
lo = 0;
mi = hi = n;
while (1 < mi) {
mi = (lo + hi) / 2;
if (num < S[mi]) {
hi = mi - 1;
} ... | #include <iostream>
#define MAXN 100000
#define MAXQ 50000
using namespace std;
int n, q;
int S[MAXN + 1], T[MAXQ + 1];
int cnt = 0;
bool binarySearch(int num) {
int lo, mi, hi;
bool res = false;
lo = 0;
mi = hi = n;
while (lo <= hi) {
mi = (lo + hi) / 2;
if (num < S[mi]) {
hi = mi - 1;
... | replace | 16 | 17 | 16 | 17 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 8;
int n, q, x, num... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 8;
int n, q, x, num... | replace | 23 | 24 | 23 | 24 | TLE | |
p02268 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
bool find(const vector<int> &S, int begin, int end, int x) {
if (end - begin <= 0) {
return false;
}
int mid = (begin + end) / 2;
if (x < S[mid]) {
return find(S, begin, mid, x);
} else if (S[mid] < x) {
return find(S, mid, end, x);
} ... | #include <iostream>
#include <vector>
using namespace std;
bool find(const vector<int> &S, int begin, int end, int x) {
if (end - begin == 1) {
return S[begin] == x;
}
int mid = (begin + end) / 2;
if (x < S[mid]) {
return find(S, begin, mid, x);
} else if (S[mid] < x) {
return find(S, mid, end, ... | replace | 6 | 8 | 6 | 8 | TLE | |
p02268 | C++ | Runtime Error | #include <stdio.h>
int binarySearch(int A[], int n, int key) {
int left = 0;
int right = n;
while (left < right) {
int mid = (left + right) / 2;
if (A[mid] == key)
return 1;
else if (A[mid] < key)
left = mid + 1;
else
right = mid;
}
return 0;
}
int main() {
int i, n, A[10... | #include <stdio.h>
int binarySearch(int A[], int n, int key) {
int left = 0;
int right = n;
while (left < right) {
int mid = (left + right) / 2;
if (A[mid] == key)
return 1;
else if (A[mid] < key)
left = mid + 1;
else
right = mid;
}
return 0;
}
int main() {
int i, n, A[10... | replace | 18 | 19 | 18 | 19 | 0 | |
p02268 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define rep(i, n) FOR(i, 0, n)
#define DEBUG(x) cout << #x << ": " << x << endl
#define vint vector<int>
#define vdouble ve... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define rep(i, n) FOR(i, 0, n)
#define DEBUG(x) cout << #x << ": " << x << endl
#define vint vector<int>
#define vdouble ve... | replace | 39 | 40 | 39 | 40 | TLE | |
p02268 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <const int U = 1 << 30> class vEB {
struct node {
int min, max;
node *summary, **cluster;
node() : min(U), max(-1), summary(nullptr), cluster(nullptr) {}
} *root;
int cnt;
private:
int downsqrt(int ub) const { return ub >> 1; }
int upsqrt... | #include <bits/stdc++.h>
using namespace std;
template <const int U = 1 << 30> class vEB {
struct node {
int min, max;
node *summary, **cluster;
node() : min(U), max(-1), summary(nullptr), cluster(nullptr) {}
} *root;
int cnt;
private:
int downsqrt(int ub) const { return ub >> 1; }
int upsqrt... | replace | 18 | 21 | 18 | 21 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define M 104627
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
return 0;
}
long long getKey(char str... | #include <bits/stdc++.h>
using namespace std;
#define M 1046527
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
return 0;
}
long long getKey(char st... | replace | 2 | 3 | 2 | 3 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <string.h>
using namespace std;
#define LIM 519430400
#define LEN 13
char H[LIM][LEN];
int toInt(char str) {
if (str == 'A')
return 1;
else if (str == 'C')
return 2;
else if (str == 'G')
return 3;
else if (str == 'T')
return 4;
else
return 0;
}
long long get... | #include <stdio.h>
#include <string.h>
using namespace std;
#define LIM 519430400
#define LEN 13
char H[LIM][LEN];
int toInt(char str) {
if (str == 'A')
return 1;
else if (str == 'C')
return 2;
else if (str == 'G')
return 3;
else if (str == 'T')
return 4;
else
return 0;
}
long long get... | replace | 27 | 28 | 27 | 28 | TLE | |
p02269 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#define TABLE_SIZE 16777216
#define ORDER_LENGTH 7
#define STR_LENGTH 13
using namespace std;
int translateChar(char ch) {
int ret;
switch (ch) {
case 'A':
ret = 1;
break;
case 'C':
r... | #include <iostream>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#define TABLE_SIZE 16777216
#define ORDER_LENGTH 7
#define STR_LENGTH 13
using namespace std;
int translateChar(char ch) {
int ret;
switch (ch) {
case 'A':
ret = 1;
break;
case 'C':
r... | replace | 55 | 56 | 55 | 56 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, first, to) for (ll i = first; i < to; ++i)
using namespace std;
typedef long long ll;
struct HashSet {
string data[(int)1e6];
const int MAXN = (int)1e6;
const string INIT = "-1";
HashSet() {
rep(i, 0, MAXN) { data[i] = INIT; }
}
bool find(string s) {
int j ... | #include <bits/stdc++.h>
#define rep(i, first, to) for (ll i = first; i < to; ++i)
using namespace std;
typedef long long ll;
struct HashSet {
string data[(int)1e6];
const int MAXN = (int)1e6;
const string INIT = "-1";
HashSet() {
rep(i, 0, MAXN) { data[i] = INIT; }
}
bool find(string s) {
int j ... | replace | 30 | 31 | 30 | 31 | TLE | |
p02269 | C++ | Runtime Error |
#include <cstdio>
#include <cstring>
using namespace std;
typedef unsigned int U;
#define L 1 << 20
bool HA[L];
char T[256];
int main() {
U n, s, t;
char c;
T['A'] = (char)1, T['C'] = (char)2, T['G'] = (char)3, T['T'] = (char)4;
scanf("%d", &n);
while (getchar() != '\n')
;
for (register U i = 0; i++ ... |
#include <cstdio>
#include <cstring>
using namespace std;
typedef unsigned int U;
#define L 1 << 20 + 1
bool HA[L];
char T[256];
int main() {
U n, s, t;
char c;
T['A'] = (char)1, T['C'] = (char)2, T['G'] = (char)3, T['T'] = (char)4;
scanf("%d", &n);
while (getchar() != '\n')
;
for (register U i = 0; ... | replace | 6 | 7 | 6 | 7 | 0 | |
p02269 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
auto encodeString = [](const string &str) {
auto encodeChar = [](char c) {
switch (c) {
case 'A':
return 1;
case 'C':
return 2;
... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
auto encodeString = [](const string &str) {
auto encodeChar = [](char c) {
switch (c) {
case 'A':
return 1;
case 'C':
return 2;
... | replace | 40 | 42 | 40 | 41 | -11 | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
set<string> st;
while (n--) {
string order;
string str;
cin >> order;
cin >> str;
if (order == "insert") {
st.insert(str);
} else {
if (st.find(str) != st.end()) {
... | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
set<string> st;
while (n--) {
string order;
string str;
cin >> order;
cin >> str;
if (order == "insert") {
st.insert(str);
} else ... | insert | 6 | 6 | 6 | 8 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
#include <set>
using namespace std;
int main() {
int n;
cin >> n;
set<string> s;
for (int i = 0; i < n; i++) {
string s1, s2;
cin >> s1 >> s2;
if (s1[0] == 'i')
s.insert(s2);
else {
if (s.find(s2) == s.end())
printf("no\n");
else
... | #include <cstdio>
#include <iostream>
#include <set>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int n;
cin >> n;
set<string> s;
for (int i = 0; i < n; i++) {
string s1, s2;
cin >> s1 >> s2;
if (s1[0] == 'i')
s.insert(s2);
else {
if (s.find(s2) == s.end())
... | replace | 6 | 7 | 6 | 7 | TLE | |
p02269 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 8;
#define MOD 1046... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e7 + 8;
#define MOD 1046... | replace | 15 | 16 | 15 | 16 | 0 | |
p02269 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
using namespace std;
#define LIM 1430400
#define LEN 13
char H[LIM][LEN];
int toInt(char str) {
if (str == 'A')
return 1;
else if (str == 'C')
return 2;
else if (str == 'G')
return 3;
else if (str == 'T')
return 4;
else
return 0;
}
long long getKe... | #include <stdio.h>
#include <string.h>
using namespace std;
#define LIM 48828125
#define LEN 13
char H[LIM][LEN];
int toInt(char str) {
if (str == 'A')
return 1;
else if (str == 'C')
return 2;
else if (str == 'G')
return 3;
else if (str == 'T')
return 4;
else
return 0;
}
long long getK... | replace | 4 | 5 | 4 | 5 | 0 | |
p02269 | C++ | Time Limit Exceeded |
#include <cstdio>
#include <cstring>
#include <set>
using namespace std;
typedef int INT;
set<INT> S;
inline INT get(char c) {
char T[5] = "ACGT";
for (INT i = 0; i < 4; ++i) {
if (c == T[i])
return i + 1;
}
return 0;
}
inline INT get(char *s) {
INT n = strlen(s);
INT sum = 0;
INT t = 1;
f... |
#include <cstdio>
#include <cstring>
#include <set>
using namespace std;
typedef int INT;
set<INT> S;
inline INT get(char c) {
char T[5] = "ACGT";
for (INT i = 0; i < 4; ++i) {
if (c == T[i])
return i + 1;
}
return 0;
}
inline INT get(char *s) {
INT n = strlen(s);
INT sum = 0;
INT t = 1;
f... | replace | 35 | 36 | 35 | 36 | TLE | |
p02269 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
bool dic[1000000] = {0};
long n = 0;
long long k = 0;
string st1, st2;
cin >> n;
for (long i = 0; i < n; i++) {
cin >> st1 >> st2;
k = 0;
for (unsigned int j = 0; j < st2.size(); j++)
switch (st2[j... | #include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main() {
bool dic[10000000] = {0};
long n = 0;
long long k = 0;
string st1, st2;
cin >> n;
for (long i = 0; i < n; i++) {
cin >> st1 >> st2;
k = 0;
for (unsigned int j = 0; j < st2.size(); j++)
switch (st2[... | replace | 6 | 7 | 6 | 7 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
set<string> st;
set<string>::iterator it;
string s1, s2;
int n;
cin >> n;
while (n--) {
cin >> s1 >> s2;
if (s1 == "insert") {
st.insert(s2);
} else {
it = st.find(s2);
if (it != st.end())... | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
set<string> st;
set<string>::iterator it;
string s1, s2;
int n;
cin >> n;
while (n--) {
cin >> s1 >> s2;
if (s1 == "insert") {
st.insert(s2);
} else {
... | insert | 7 | 7 | 7 | 10 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <set>
#include <string>
#include <vector>
// #include <conio.h>
using namespace std;
int main() {
int n;
set<string> list;
string key;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> key;
if (key == "insert") {
... | #include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <set>
#include <string>
#include <vector>
// #include <conio.h>
using namespace std;
int main() {
std::ios_base::sync_with_stdio(false);
int n;
set<string> list;
string key;
cin >> n;
for (int i = 0; i < n; ++i) {
c... | insert | 11 | 11 | 11 | 12 | TLE | |
p02269 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <string.h>
#define M 1046527 // It's a "prime number".
#define L 14 // Why?
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
r... | #include <cstdio>
#include <iostream>
#include <string.h>
#define M 1046527 // It's a "prime number".
#define L 14 // Why?
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
r... | replace | 38 | 39 | 38 | 39 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, e) for ((i) = (s); (i) < (int)(e); (i)++)
#define REP(i, e) FOR(i, 0, e)
#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x, y) make_pair((x), (y))
typedef long long ll;
typedef pair<int, int> PII;
const double EPS = 1e-10;... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, e) for ((i) = (s); (i) < (int)(e); (i)++)
#define REP(i, e) FOR(i, 0, e)
#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x, y) make_pair((x), (y))
typedef long long ll;
typedef pair<int, int> PII;
const double EPS = 1e-10;... | replace | 23 | 24 | 23 | 28 | TLE | |
p02269 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
#define M 104652
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
re... | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
#define M 1046527
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
r... | replace | 6 | 7 | 6 | 7 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main(void) {
int n;
string o, s;
set<string> set;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> o >> s;
if (o == "insert") {
set.insert(s);
} else {
if (set.find(s) != set.end()) {
cout << "yes" << e... | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
int n;
string o, s;
set<string> set;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> o >> s;
if (o == "insert") {
set.insert(s);
} else {
if (set.find(s) != set... | insert | 5 | 5 | 5 | 6 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main(void) {
int n;
string order, str;
set<string> set;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> order >> str;
if (order == "insert") {
set.insert(str);
} else {
if (set.find(str) != set.end()) {
... | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main(void) {
ios::sync_with_stdio(false);
int n;
string order, str;
set<string> set;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> order >> str;
if (order == "insert") {
set.insert(str);
} else {
if (set.f... | insert | 5 | 5 | 5 | 6 | TLE | |
p02269 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
#define LEN 14
#define LIM 2000000
char H[LIM][LEN];
int toInt(char c) {
if (c == 'A')
return 1;
else if (c == 'C')
return 2;
else if (c == 'G')
return 3;
else if (c == 'T')
return 4;
else
return 0;
}
int getKey(char str[]) {
int sum = 0, p = 1;... | #include <stdio.h>
#include <string.h>
#define LEN 14
#define LIM 2000000
char H[LIM][LEN];
int toInt(char c) {
if (c == 'A')
return 1;
else if (c == 'C')
return 2;
else if (c == 'G')
return 3;
else if (c == 'T')
return 4;
else
return 0;
}
int getKey(char str[]) {
int sum = 0, p = 1;... | replace | 33 | 34 | 33 | 34 | 0 | |
p02269 | C++ | Runtime Error | /*
filename:4_C-Dictionary.c
created on 17.9.2015 by charis
last edited on 17.9.2015 by charis
*/
#include <cstdio>
#include <cstring>
int m;
int getkey(char str[]) {
int sum = 0, p = 1;
for (int k = 0; k < strlen(str); k++) {
if (str[k] == 'A')
sum += p * 1;
else if (str[k] == 'C')
sum += p ... | /*
filename:4_C-Dictionary.c
created on 17.9.2015 by charis
last edited on 17.9.2015 by charis
*/
#include <cstdio>
#include <cstring>
int m;
int getkey(char str[]) {
int sum = 0, p = 1;
for (int k = 0; k < strlen(str); k++) {
if (str[k] == 'A')
sum += p * 1;
else if (str[k] == 'C')
sum += p ... | replace | 56 | 57 | 56 | 57 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <typeinfo>
#include <vector>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, ... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <typeinfo>
#include <vector>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, ... | replace | 44 | 45 | 44 | 45 | TLE | |
p02269 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
int n, r[128], t[13];
bool used[22370000];
char com[8], s[14];
int main() {
scanf("%d", &n);
r[65] = 1, r[67] = 2, r[71] = 3;
for (int i = 2; i < 12; i++)
t[i] = t[i - 1] + 1 << (2 * i - 2);
for (int i = 0; i < n; i++) {
scanf("%s %s", com, s);
int h = 0, l = s... | #include <stdio.h>
#include <string.h>
int n, r[128], t[13];
bool used[22370000];
char com[8], s[14];
int main() {
scanf("%d", &n);
r[65] = 1, r[67] = 2, r[71] = 3;
for (int i = 2; i < 13; i++)
t[i] = t[i - 1] + (1 << (2 * i - 2));
for (int i = 0; i < n; i++) {
scanf("%s %s", com, s);
int h = 0, l =... | replace | 8 | 10 | 8 | 10 | 0 | |
p02269 | C++ | Runtime Error | //
// main.cpp
// dictionary
//
// Created by ???????????? on 2017/10/06.
// Copyright ?? 2017 ????????????. All rights reserved.
//
#include <cmath>
#include <cstring>
#include <iostream>
#include <stdio.h>
#define NIL (0)
using namespace std;
int m = 10000000;
int char_to_int(char str) {
if (str == 'A') {
... | //
// main.cpp
// dictionary
//
// Created by ???????????? on 2017/10/06.
// Copyright ?? 2017 ????????????. All rights reserved.
//
#include <cmath>
#include <cstring>
#include <iostream>
#include <stdio.h>
#define NIL (0)
using namespace std;
int m = 1046527;
int char_to_int(char str) {
if (str == 'A') {
... | replace | 17 | 18 | 17 | 18 | -11 | |
p02269 | C++ | Runtime Error | //
// main.cpp
// dictionary
//
// Created by ???????????? on 2017/10/06.
// Copyright ?? 2017 ????????????. All rights reserved.
//
#include <cmath>
#include <cstring>
#include <iostream>
#include <stdio.h>
#define NIL (0)
using namespace std;
int m = 1000107;
int char_to_int(char str) {
if (str == 'A') {
... | //
// main.cpp
// dictionary
//
// Created by ???????????? on 2017/10/06.
// Copyright ?? 2017 ????????????. All rights reserved.
//
#include <cmath>
#include <cstring>
#include <iostream>
#include <stdio.h>
#define NIL (0)
using namespace std;
int m = 1000207;
int char_to_int(char str) {
if (str == 'A') {
... | replace | 17 | 18 | 17 | 18 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
#define SIZE 1000039
using namespace std;
string hashTable[SIZE];
int hashValue(string str) {
int res = 0;
int v = 1;
for (int i = 0; i < str.length(); i++) {
res += v * (str[i] - '0');
v *= 7;
}
return res;
}
int main(void) {
for (int i = 0; i < SIZE; i++)
... | #include <iostream>
#include <vector>
#define SIZE 1000039
using namespace std;
string hashTable[SIZE];
int hashValue(string str) {
int res = 0;
int v = 1;
for (int i = 0; i < str.length(); i++) {
res += v * (str[i] - '0');
v *= 7;
}
return res;
}
int main(void) {
ios::sync_with_stdio(false);
c... | insert | 18 | 18 | 18 | 20 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <string.h>
using namespace std;
const int M = 1000003;
const int L = 12;
char dict[M][L];
int h1(long key) { return key % M; }
int h2(long key) { return 1 + key % (M - 1); }
int h(long key, int i) { return (h1(key) + i * h2(key)) % M; }
long strToKey(char str[]) {
long result = 0;
... | #include <iostream>
#include <string.h>
using namespace std;
const int M = 1000003;
const int L = 12;
char dict[M][L];
int h1(long key) { return key % M; }
int h2(long key) { return 1 + key % (M - 1); }
int h(long key, int i) { return (h1(key) + i * h2(key)) % M; }
long strToKey(char str[]) {
long result = 0;
... | insert | 63 | 63 | 63 | 66 | TLE | |
p02269 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
// #include "toollib.h"
// #in... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
// #include "toollib.h"
// #in... | replace | 29 | 30 | 29 | 30 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int C = 1046527;
char baca[C][13];
int hs(int key, int i) { return (key % C + i * (1 + key % (C - 1))) % C; }
int cToI(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return... | #include <bits/stdc++.h>
using namespace std;
const int C = 1046527;
char baca[C][13];
int hs(int key, int i) { return (key % C + i * (1 + key % (C - 1))) % C; }
int cToI(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return... | insert | 24 | 24 | 24 | 25 | TLE | |
p02269 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
#define M 122222
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long lo... | #include <stdio.h>
#include <string.h>
#define M 1006000
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long l... | replace | 3 | 4 | 3 | 4 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <string.h>
#define M 1046527
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
return 0;
}
long long getKey(char str[]) {
... | #include <stdio.h>
#include <string.h>
#define M 1046527
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
return 0;
}
long long getKey(char str[]) {
... | replace | 25 | 26 | 25 | 26 | TLE | |
p02269 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
#define M 1000000
std::vector<std::vector<std::string>> dic(M);
int hash(char ch) {
if (ch == 'A')
return 1;
if (ch == 'C')
return 2;
if (ch == 'G')
return 3;
if (ch == 'T')
return 4;
return 0;
}
long long key(std::string str) {
long l... | #include <iostream>
#include <string>
#include <vector>
#define M 1000000
std::vector<std::vector<std::string>> dic(M);
int hash(char ch) {
if (ch == 'A')
return 1;
if (ch == 'C')
return 2;
if (ch == 'G')
return 3;
if (ch == 'T')
return 4;
return 0;
}
long long key(std::string str) {
long l... | replace | 24 | 25 | 24 | 25 | 0 | |
p02269 | C++ | Time Limit Exceeded | /*
//alds1_4_c:Dictionary
//算法:开放地址法散列表
//Time: 2018/1/8 星期一
*/
#include <stdio.h>
#include <string.h>
const int M = 1000003;
const int L = 14;
char H[M][L];
// 对于每个字符返回的定义值
int getChar(char ch) {
if (ch == 'A')
return 1;
if (ch == 'C')
return 2;
if (ch == 'D')
return 3;
if (ch == 'T')
return... | /*
//alds1_4_c:Dictionary
//算法:开放地址法散列表
//Time: 2018/1/8 星期一
*/
#include <stdio.h>
#include <string.h>
const int M = 1000003;
const int L = 14;
char H[M][L];
// 对于每个字符返回的定义值
int getChar(char ch) {
if (ch == 'A')
return 1;
if (ch == 'C')
return 2;
if (ch == 'D')
return 3;
if (ch == 'T')
return... | replace | 39 | 40 | 39 | 43 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <set>
#include <string>
int main() {
std::set<std::string> dic;
int n;
std::cin >> n;
for (int i = 0; i < n; ++i) {
std::string command, str;
std::cin >> command >> str;
if (command == "insert") {
dic.insert(str);
} else if (command == "find") {
std::cou... | #include <iostream>
#include <set>
#include <string>
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
std::set<std::string> dic;
int n;
std::cin >> n;
for (int i = 0; i < n; ++i) {
std::string command, str;
std::cin >> command >> str;
if (command == "insert") {
dic.insert(s... | insert | 5 | 5 | 5 | 7 | TLE | |
p02269 | C++ | Memory Limit Exceeded | #include <stdio.h>
#include <string.h>
#define M 20000000
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long ... | #include <stdio.h>
#include <string.h>
#define M 2000000
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long l... | replace | 3 | 4 | 3 | 4 | MLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define PUSH(n, v) ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define PUSH(n, v) ... | replace | 49 | 50 | 49 | 50 | TLE | |
p02269 | C++ | Runtime Error | #include <bits/stdc++.h>
#define M 1046527
using namespace std;
long long h1(long long key) { return key % M; }
long long h2(long long key) { return 1 + (key % (M - 1)); }
long long getNum(char c) {
if (c == 'A')
return 1;
if (c == 'C')
return 2;
if (c == 'G')
return 3;
if (c == 'T')
return 4;
... | #include <bits/stdc++.h>
#define M 1046527
using namespace std;
long long h1(long long key) { return key % M; }
long long h2(long long key) { return 1 + (key % (M - 1)); }
long long getNum(char c) {
if (c == 'A')
return 1;
if (c == 'C')
return 2;
if (c == 'G')
return 3;
if (c == 'T')
return 4;
... | replace | 24 | 25 | 24 | 25 | 0 | |
p02269 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const unsigned long M = 1046527;
const int L = 14;
char H[M][L];
long long getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
els... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const unsigned long M = 1046527;
const int L = 14;
char H[M][L];
long long getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
els... | replace | 52 | 53 | 52 | 53 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
set<string> dict;
for (int i = 0; i < N; ++i) {
string command;
string val;
cin >> command;
cin >> val;
if (command[0] == 'i') {
// insert... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int N;
cin >> N;
set<string> dict;
for (int i = 0; i < N; ++i) {
string command;
string val;
cin >> command;
cin >> val;
if (comma... | insert | 9 | 9 | 9 | 10 | TLE | |
p02269 | C++ | Memory Limit Exceeded | #include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define M 10465277
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return ... | #include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define M 1046527
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4... | replace | 6 | 7 | 6 | 7 | MLE | |
p02269 | C++ | Time Limit Exceeded |
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
typedef long long ll;
#define row 1001333 // 取一个比h2(k)大的质数
#define col 20
char H[row][col];
ll h1(ll key) { return key % row; }
ll h2(ll key) { return 1 + (key % (row - 1)); }
ll chtonum(char s) { // character to number
if (s ==... |
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
typedef long long ll;
#define row 1001333 // 取一个比h2(k)大的质数
#define col 20
char H[row][col];
ll h1(ll key) { return key % row; }
ll h2(ll key) { return 1 + (key % (row - 1)); }
ll chtonum(char s) { // character to number
if (s ==... | insert | 47 | 47 | 47 | 49 | TLE | |
p02269 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
#define M 1000000
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long l... | #include <stdio.h>
#include <string.h>
#define M 1000000
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long l... | replace | 32 | 33 | 32 | 33 | 0 | |
p02269 | C++ | Memory Limit Exceeded | #include <stdio.h>
#include <string.h>
#define M 10000000
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long ... | #include <stdio.h>
#include <string.h>
#define M 1000000
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an integer value */
long l... | replace | 3 | 4 | 3 | 4 | MLE | |
p02269 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
#define M 1046527
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
return 0;
}
long long getKey(char str[]) {... | #include <stdio.h>
#include <string.h>
#define M 1046527
#define NIL (-1)
#define L 14
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
else
return 0;
}
long long getKey(char str[]) {... | replace | 26 | 27 | 26 | 27 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <list>
#include <stack>
#include <stdio.h>
#include <utility>
#include <vector>
using namespace std;
#define N 1000000
class Hash {
private:
list<string> *a;
unsigned long long getChar(char ch) {
switch (ch) {
case 'A':
return 1;
case 'C':
... | #include <algorithm>
#include <iostream>
#include <list>
#include <stack>
#include <stdio.h>
#include <utility>
#include <vector>
using namespace std;
#define N 1000000
class Hash {
private:
list<string> *a;
unsigned long long getChar(char ch) {
switch (ch) {
case 'A':
return 1;
case 'C':
... | replace | 34 | 35 | 34 | 35 | TLE | |
p02269 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
int Hash[244140];
char s[13];
int getChar(char ch) {
if (ch == 'A') {
return 1;
} else if (ch == 'C') {
return 2;
} else if (ch == 'G') {
return 3;
}
return 4;
}
int getKey() {
int sum = 0, p = 1;
for (int i = 0; i < strlen(s); i++) {
sum += p * (g... | #include <stdio.h>
#include <string.h>
int Hash[244140625];
char s[13];
int getChar(char ch) {
if (ch == 'A') {
return 1;
} else if (ch == 'C') {
return 2;
} else if (ch == 'G') {
return 3;
}
return 4;
}
int getKey() {
int sum = 0, p = 1;
for (int i = 0; i < strlen(s); i++) {
sum += p *... | replace | 3 | 4 | 3 | 4 | 0 | |
p02269 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define M 10000019 /* your task*/
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an i... | #include <bits/stdc++.h>
using namespace std;
#define M 1000033 /* your task*/
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return 4;
}
/* convert a string into an in... | replace | 2 | 3 | 2 | 3 | MLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
int main(void) {
std::ios_base::sync_with_stdio(false);
int n;
std::cin >> n;
std::set<std::string> DICTIONARY;
std::string COMMAND;
std::string WORD;
for (int i = 0; i < n; ++i) {
std::cin >> COMMAND >> WORD;
if (COMMAND ==... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
int main(void) {
std::ios_base::sync_with_stdio(false);
int n;
std::cin >> n;
std::set<std::string> DICTIONARY;
std::string COMMAND;
std::string WORD;
for (int i = 0; i < n; ++i) {
std::cin >> COMMAND >> WORD;
if (COMMAND ==... | replace | 17 | 20 | 17 | 20 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define M 1050011
#define L 14
char H[M][L];
long long h1(long long k) { return k % M; }
long long h2(long long k) { return 1 + (k % (M - 1)); }
long long h(long long k, long long i) { return (h1(k) + i * h2(k)) % M; }
int getChar(char ... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define M 1050011
#define L 14
char H[M][L];
long long h1(long long k) { return k % M; }
long long h2(long long k) { return 1 + (k % (M - 1)); }
long long h(long long k, long long i) { return (h1(k) + i * h2(k)) % M; }
int getChar(char ... | insert | 69 | 69 | 69 | 70 | TLE | |
p02269 | C++ | Time 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 | 245 | 246 | 245 | 246 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
typedef long long lli;
const int M = 5000001;
const int P = 32;
lli C[128];
lli X[M];
lli convert(const char s[]) {
lli j = 0;
for (lli i = 0; s[i] != '\0'; ++i) {
j |= C[s[i]] << (i * 3LL);
... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
typedef long long lli;
const int M = 5000001;
const int P = M / 10;
lli C[128];
lli X[M];
lli convert(const char s[]) {
lli j = 0;
for (lli i = 0; s[i] != '\0'; ++i) {
j |= C[s[i]] << (i * 3L... | replace | 10 | 11 | 10 | 11 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
typedef unsigned int uint;
const uint M = 6000011u;
const uint P = 2u;
uint Five[13];
uint C[128];
uint X[M];
uint convert(const char s[]) {
uint j = 0;
for (uint i = 0u; s[i] ... | #include <algorithm>
#include <climits>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
typedef unsigned int uint;
const uint M = 6000011u;
const uint P = M / 10u + 1u;
uint Five[13];
uint C[128];
uint X[M];
uint convert(const char s[]) {
uint j = 0;
for (uint i =... | replace | 11 | 12 | 11 | 12 | TLE | |
p02269 | C++ | Runtime Error | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
class dictionary {
private:
string *hashtable;
long long table_size;
int el_num;
long long hash1(string);
long long hash2(string);
long long str_n(string);
public:
dictionary(int n);
voi... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
class dictionary {
private:
string *hashtable;
long long table_size;
int el_num;
long long hash1(string);
long long hash2(string);
long long str_n(string);
public:
dictionary(int n);
voi... | replace | 82 | 83 | 82 | 83 | 0 | |
p02269 | C++ | Runtime Error | #include <iostream>
#include <list>
#include <stdio.h>
#include <string>
using namespace std;
#define N 22369620
#define X 25
struct hush {
list<int> a;
};
int main(void) {
int n, sum = 0, x, f[1000000] = {0}, cou = 0;
char str[7], acgt[13];
hush H[N / X];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
... | #include <iostream>
#include <list>
#include <stdio.h>
#include <string>
using namespace std;
#define N 22369620
#define X 50
struct hush {
list<int> a;
};
int main(void) {
int n, sum = 0, x, f[1000000] = {0}, cou = 0;
char str[7], acgt[13];
hush H[N / X];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
... | replace | 6 | 7 | 6 | 7 | -11 | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
// std::ios_base::sync_with_stdio(false);
set<string> st;
int n;
cin >> n;
while (n--) {
string BUFF, c;
cin >> BUFF >> c;
if (BUFF == "insert")
st.insert(c);
else
cout << (... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
std::ios_base::sync_with_stdio(false);
set<string> st;
int n;
cin >> n;
while (n--) {
string BUFF, c;
cin >> BUFF >> c;
if (BUFF == "insert")
st.insert(c);
else
cout << (st.... | replace | 7 | 8 | 7 | 8 | TLE | |
p02269 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
const long N = 1046527;
char str[N][13];
long n;
int getInt(char ch) {
switch (ch) {
case 'A':
return 1;
case 'T':
return 2;
case 'G':
return 3;
c... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
const long N = 16777216;
char str[N][13];
long n;
int getInt(char ch) {
switch (ch) {
case 'A':
return 1;
case 'T':
return 2;
case 'G':
return 3;
... | replace | 9 | 10 | 9 | 10 | 0 | |
p02269 | C++ | Time Limit Exceeded | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
int n, i;
cin >> n;
string command, str;
set<string> S;
for (i = 0; i < n; i++) {
cin >> command >> str;
if (command == "insert") {
S.insert(str);
} else {
if (S.find(str) == S.end()) {
cou... | #include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int n, i;
cin >> n;
string command, str;
set<string> S;
for (i = 0; i < n; i++) {
cin >> command >> str;
if (command == "insert") {
S.insert(str);
} else {
if (S.find... | insert | 6 | 6 | 6 | 7 | TLE | |
p02269 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits.h>
#include <time.h>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;
typedef long long ll;... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits.h>
#include <time.h>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;
typedef long long ll;... | replace | 19 | 20 | 19 | 20 | 0 | |
p02269 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
ull pow(ull x, ull n) {
ull res = 1;... | #include <cstdio>
#include <iostream>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
ull pow(ull x, ull n) {
ull res = 1;... | replace | 48 | 49 | 48 | 49 | 0 | |
p02269 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <limits.h>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
ull pow(ull x, ull ... | #include <cstdio>
#include <iostream>
#include <limits.h>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
ull pow(ull x, ull ... | replace | 63 | 64 | 63 | 64 | -11 | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
set<string> st;
int n;
cin >> n;
while (n--) {
string BUFF, c;
cin >> BUFF >> c;
if (BUFF == "insert")
st.insert(c);
else
cout << (st.find(c) != st.end() ? "yes" : "no") << end... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main() {
std::ios_base::sync_with_stdio(false);
set<string> st;
int n;
cin >> n;
while (n--) {
string BUFF, c;
cin >> BUFF >> c;
if (BUFF == "insert")
st.insert(c);
else
cout << (st.f... | insert | 6 | 6 | 6 | 7 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define Lim 9999991
#define Jmp 13
int dic[Lim];
int toint(string s) {
int ret = 0;
for (int i = 0; i < s.size(); ++i) {
ret *= 5;
switch (s[i]) {
case 'A':
ret += 1;
break;
case 'T':
ret += 2;
break;
case 'G':
ret += ... | #include <bits/stdc++.h>
using namespace std;
#define Lim 9999991
#define Jmp 1000003
int dic[Lim];
int toint(string s) {
int ret = 0;
for (int i = 0; i < s.size(); ++i) {
ret *= 5;
switch (s[i]) {
case 'A':
ret += 1;
break;
case 'T':
ret += 2;
break;
case 'G':
re... | replace | 3 | 4 | 3 | 4 | TLE | |
p02269 | C++ | Time Limit Exceeded | /*
* ALDS1_4_C.cpp
*
* Created on: Apr 26, 2018
* Author: 13743
*/
#include <cstdio>
using namespace std;
const int SIZE = 1045527;
int table[SIZE];
int getKey(char *s) {
int key = 0;
int exp = 1;
for (int i = 0; s[i] != '\0'; i++) {
switch (s[i]) {
case 'A':
key += 4 * exp;
bre... | /*
* ALDS1_4_C.cpp
*
* Created on: Apr 26, 2018
* Author: 13743
*/
#include <cstdio>
using namespace std;
const int SIZE = 1045527;
int table[SIZE];
int getKey(char *s) {
int key = 0;
int exp = 1;
for (int i = 0; s[i] != '\0'; i++) {
switch (s[i]) {
case 'A':
key += 4 * exp;
bre... | insert | 56 | 56 | 56 | 58 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <cstdio>
#include <cstring>
#include <string>
#define M 5070721
#define NIL (-1)
#define L 14
using namespace std;
typedef long long ll;
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return ... | #include <cstdio>
#include <cstring>
#include <string>
#define M 5070721
#define NIL (-1)
#define L 14
using namespace std;
typedef long long ll;
char H[M][L];
int getChar(char ch) {
if (ch == 'A')
return 1;
else if (ch == 'C')
return 2;
else if (ch == 'G')
return 3;
else if (ch == 'T')
return ... | insert | 28 | 28 | 28 | 29 | TLE | |
p02269 | C++ | Memory Limit Exceeded | #include <iostream>
#include <vector>
#define M 10000000
long long StrToID(std::string str) {
long long id = 0;
for (int i = 0; i < str.length(); ++i) {
switch (str[i]) {
case 'A':
id = 1 + id * 10;
break;
case 'C':
id = 2 + id * 10;
break;
case 'G':
id = 3 + id * 10;... | #include <iostream>
#include <vector>
#define M 1000003
long long StrToID(std::string str) {
long long id = 0;
for (int i = 0; i < str.length(); ++i) {
switch (str[i]) {
case 'A':
id = 1 + id * 10;
break;
case 'C':
id = 2 + id * 10;
break;
case 'G':
id = 3 + id * 10;
... | replace | 3 | 4 | 3 | 4 | MLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
#define M 1020751
long long convert(string word);
void insert(long long *d, long long key);
int find_key(long long *d, long long key);
int h1(long... | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
#define M 1020751
long long convert(string word);
void insert(long long *d, long long key);
int find_key(long long *d, long long key);
int h1(long... | replace | 79 | 80 | 79 | 80 | TLE | |
p02269 | C++ | Time Limit Exceeded | #ifdef LOCAL_BUILD
#include "pch.h"
#define DLOG(msg) cout << "#" << __LINE__ << ":" << msg << endl;
#define DLOG_V(var) \
cout << "#" << __LINE__ << ":" << #var << " : " << var << endl;
#else
#include <bits/stdc++.h>
#define DLOG(msg)
#define DLOG_V(var)
#en... | #ifdef LOCAL_BUILD
#include "pch.h"
#define DLOG(msg) cout << "#" << __LINE__ << ":" << msg << endl;
#define DLOG_V(var) \
cout << "#" << __LINE__ << ":" << #var << " : " << var << endl;
#else
#include <bits/stdc++.h>
#define DLOG(msg)
#define DLOG_V(var)
#en... | replace | 30 | 31 | 30 | 31 | TLE | |
p02269 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
string PopFront(string X) {
string Y;
for (int i = 1; i < X.size(); i++) {
Y.push_back(X[i]);
}
return Y;
}
bool operator<(string &A, string &B) {
int a = 0;
int b = 0;
while (!A.empty() && !B.empty()) {
... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
using namespace std;
string PopFront(string X) {
string Y;
for (int i = 1; i < X.size(); i++) {
Y.push_back(X[i]);
}
return Y;
}
bool operator<(string &A, string &B) {
int a = 0;
int b = 0;
while (!A.empty() && !B.empty()) {
... | replace | 40 | 41 | 40 | 42 | TLE | |
p02270 | C++ | Time Limit Exceeded | /**************
* Allocation
*************/
#include <algorithm>
#include <iostream>
#include <numeric> //??¢??°
#include <vector> //??£?¨?
using namespace std;
//??\???
vector<int> getLoadList(int n) //??????????????°
{
vector<int> loadList(n); //?????????
for (int i = 0; i < n; i++) {
cin >> loadList[i]... | /**************
* Allocation
*************/
#include <algorithm>
#include <iostream>
#include <numeric> //??¢??°
#include <vector> //??£?¨?
using namespace std;
//??\???
vector<int> getLoadList(int n) //??????????????°
{
vector<int> loadList(n); //?????????
for (int i = 0; i < n; i++) {
cin >> loadList[i]... | replace | 52 | 53 | 52 | 53 | TLE | |
p02270 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
#define MAX 100000
typedef long long llong;
int n, k;
llong T[MAX];
int check(llong P) {
int i = 0;
for (int j = 0; j < k; j++) {
llong s = 0;
while (s + T[i] <= P) {
s += T[i];
i++;
if (i == n)
return n;
}
}
return i;
}
int solve... | #include <iostream>
using namespace std;
#define MAX 100000
typedef long long llong;
int n, k;
llong T[MAX];
int check(llong P) {
int i = 0;
for (int j = 0; j < k; j++) {
llong s = 0;
while (s + T[i] <= P) {
s += T[i];
i++;
if (i == n)
return n;
}
}
return i;
}
int solve... | replace | 26 | 27 | 26 | 27 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.