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
p02887
Python
Runtime Error
#!/usr/bin/env python3 import sys import re def solve(N: int, S: str): result = 0 for s in set(S): regex = re.compile(f"{s}+") # print(regex.findall(S)) result += len(regex.findall(S)) print(result) return def main(): def iterate_tokens(): for line in sys.stdin: ...
#!/usr/bin/env python3 import sys import re def solve(N: int, S: str): result = 0 for s in set(S): regex = re.compile(s + "+") # print(regex.findall(S)) result += len(regex.findall(S)) print(result) return def main(): def iterate_tokens(): for line in sys.stdin: ...
replace
8
9
8
9
0
p02887
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> // #define int long long using namespace std; inline int gi() { char tmp = getchar(); int flag = 1; while (tmp < '0' || tmp > '9') { if (tmp == '-') { flag = ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> // #define int long long using namespace std; inline int gi() { char tmp = getchar(); int flag = 1; while (tmp < '0' || tmp > '9') { if (tmp == '-') { flag = ...
delete
66
69
66
66
TLE
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, c = 0; cin >> n; char s[10001]; for (int i = 0; i < n; i++) { cin >> s[i]; } for (int j = 0; j < n; j++) { if (s[j] != s[j + 1]) c++; } cout << c << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, c = 0; cin >> n; string s; cin >> s; for (int j = 0; j < n; j++) { if (s[j] != s[j + 1]) c++; } cout << c << endl; }
replace
5
9
5
7
0
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; int count = 0; for (int i = 0; i < N - 1; i++) { if (S.at(i) != S.at(i + i)) { count++; } } cout << count + 1 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; int count = 0; for (int i = 0; i + 1 < S.size(); i++) { if (S.at(i) != S.at(i + 1)) { count++; } } cout << count + 1 << endl; }
replace
9
11
9
11
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 10) >= this->size() (which is 10)
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n; string s; cin >> n >> s; vector<char> a(n); int i = 0; while (1) { if (s.at(i) == s.at(i + 1)) { if (i == s.size() - 2) { s.erase(s.begin() + (i + 1)); break; } el...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n; string s; cin >> n >> s; vector<char> a(n); int i = 0; while (1) { if (s.size() == 1) break; else if (s.at(i) == s.at(i + 1)) { if (i == s.size() - 2) { s.erase(s.begi...
replace
11
12
11
14
0
p02887
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; char S[N]; cin >> S; int ans = 1; for (int i = 0; i < N; i++) { for (int j = 1; i + j < N; j++) { if (S[i] != S[i + j]) { ans++; i += j - 1; break; } } } cout << ans << endl; return...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; char S[N]; cin >> S; int ans = 1; for (int i = 0; i < N - 1; i++) { if (S[i] != S[i + 1]) ans++; } cout << ans << endl; return 0; }
replace
9
17
9
12
TLE
p02887
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> //C++ #include <iostream> //C++ #include <math.h> #include <queue> //C++ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> //C++ #include <vector> //C++ using namespace std; // C++ #define rep(i, a, n) for (i = (a); i < (n); i++) in...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> //C++ #include <iostream> //C++ #include <math.h> #include <queue> //C++ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> //C++ #include <vector> //C++ using namespace std; // C++ #define rep(i, a, n) for (i = (a); i < (n); i++) in...
replace
17
18
17
18
0
p02887
C++
Time Limit Exceeded
#include <stdio.h> char a[1000000]; int main() { int n, i; scanf("%d", &n); scanf("%s", &a); int sum = 0; for (i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (a[i] == a[j]) { a[j] = 0; } else { if (a[i] != 0) sum++; break; } } } printf...
#include <stdio.h> char a[1000000]; int main() { int n, i; scanf("%d", &n); scanf("%s", &a); int sum = 0; for (i = 0; i < n - 1; i++) { if (a[i] != a[i + 1]) sum++; } printf("%d", sum + 1); }
replace
7
17
7
10
TLE
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; int count = 1; for (int i = 0; i < N; i++) { if (S.at(i) != S.at(i + 1)) count++; } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; int count = 1; for (int i = 0; i < N - 1; i++) { if (S.at(i) != S.at(i + 1)) count++; } cout << count << endl; }
replace
9
10
9
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 10) >= this->size() (which is 10)
p02887
Python
Time Limit Exceeded
n = int(input()) s = input() conti = True while conti: conti = False for count, char in enumerate(s): if (count - 1) >= 0 and s[count] == s[count - 1]: s = s[:count] + s[count + 1 :] conti = True break print(len(s))
n = int(input()) s = input() conti = True while conti: try: conti = False for count, char in enumerate(s): if (count - 1) >= 0 and s[count] == s[count - 1]: s = s[:count] + s[count + 1 :] conti = True except IndexError: pass print(len(s))
replace
5
11
5
13
TLE
p02887
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, result = 0; string slime; cin >> a; for (int i = 0; i < a; i++) { if (i == 0 || slime[i] != slime[i - 1]) result++; } cout << result << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, result = 0; string slime; cin >> a; cin >> slime; for (int i = 0; i < a; i++) { if (i == 0 || slime[i] != slime[i - 1]) result++; } cout << result << endl; return 0; }
insert
6
6
6
7
0
p02887
C++
Runtime Error
#include <iostream> using namespace std; char s[10005]; int main() { int n; int slimes = 1; cin >> n; cin >> s; for (int i = 1; i < n; i++) { if (s[i] != s[i - 1]) slimes++; } cout << slimes << endl; return 0; }
#include <iostream> using namespace std; char s[100005]; int main() { int n; int slimes = 1; cin >> n; cin >> s; for (int i = 1; i < n; i++) { if (s[i] != s[i - 1]) slimes++; } cout << slimes << endl; return 0; }
replace
3
4
3
4
0
p02887
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <stdlib.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pi 3.14159265359 #define nl printf("\n") #define gcd(a, b) __gcd(a, b) #define yes \ ...
#include <algorithm> #include <bits/stdc++.h> #include <stdlib.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pi 3.14159265359 #define nl printf("\n") #define gcd(a, b) __gcd(a, b) #define yes \ ...
replace
30
33
30
33
0
p02887
C++
Runtime Error
/* @author: sharrad99 */ #include <bits/stdc++.h> using namespace std; #define ll long long #define ld double #define mp make_pair #define ff first #define ss second #define mll map<ll, ll> #define pll pair<ll, ll> #define pb push_back #define pf push_front #define pob pop_back #define pof pop_front #define mod 1000000...
/* @author: sharrad99 */ #include <bits/stdc++.h> using namespace std; #define ll long long #define ld double #define mp make_pair #define ff first #define ss second #define mll map<ll, ll> #define pll pair<ll, ll> #define pb push_back #define pf push_front #define pob pop_back #define pof pop_front #define mod 1000000...
delete
18
22
18
18
-11
p02887
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N; cin >> N; string s; for (int i = 0; i < N; i++) { cin >> s[i]; } int sum = 1; for (int i = 1; i < N; i++) { if (s[i] != s[i - 1]) { sum++; } } cout << sum << endl; }
#include <iostream> using namespace std; int main() { int N; cin >> N; string s; cin >> s; int sum = 1; for (int i = 1; i < N; i++) { if (s[i] != s[i - 1]) { sum++; } } cout << sum << endl; }
replace
6
9
6
7
0
p02887
C++
Runtime Error
#include <algorithm> #include <iostream> #include <utility> #include <vector> #define rep(i, x) for (int i = 0; i < x; i++) #include <string> using namespace std; int main() { long long N; cin >> N; string S; rep(i, N) { cin >> S[i]; } long long count = N; for (long long i = 0; i < (N - 1); i++) { if...
#include <algorithm> #include <iostream> #include <utility> #include <vector> #define rep(i, x) for (int i = 0; i < x; i++) #include <string> using namespace std; int main() { long long N; cin >> N; string S; cin >> S; long long count = N; for (long long i = 0; i < (N - 1); i++) { if (S[i] == S[i + 1...
replace
13
14
13
14
0
p02887
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, cou = 1; char str[10001]; cin >> n >> str; for (int i = 0; i < n - 1; ++i) if (str[i] != str[i + 1]) cou++; cout << cou << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, cou = 1; char str[100001]; cin >> n >> str; for (int i = 0; i < n - 1; ++i) if (str[i] != str[i + 1]) cou++; cout << cou << endl; return 0; }
replace
5
6
5
6
0
p02887
C++
Runtime Error
#include <stdio.h> int main(void) { int N = 0, i = 0, j = 0, sum = 0; char S[10 ^ 5]; scanf("%d", &N); scanf("%s", S); sum = N; for (i = 0; i < N - 1; i++) { // for (j = i + 1; j < N ; j++) //{ if (S[i] == S[i + 1]) { sum -= 1; } //} } printf("%d", sum); return 0; }
#include <stdio.h> int main(void) { int N = 0, i = 0, j = 0, sum = 0; char S[100000]; scanf("%d", &N); scanf("%s", S); sum = N; for (i = 0; i < N - 1; i++) { // for (j = i + 1; j < N ; j++) //{ if (S[i] == S[i + 1]) { sum -= 1; } //} } printf("%d", sum); return 0; }
replace
3
4
3
4
0
p02887
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { int n; string str; cin >> n >> str; int ans = 1; for (int i = 0; i < n; i++)...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { int n; string str; cin >> n >> str; int ans = 1; char c = str.at(0); for (...
replace
18
27
18
25
TLE
p02887
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N; string S; cin >> N >> S; int ans = 1; for (int i = 0; i < N; i++) { char tmp = S[i]; for (int j = i + 1; j < N; j++) { if (S[j] != tmp) { ans++; i = j - 1; break; } } } cout << ans << endl; retur...
#include <iostream> using namespace std; int main() { int N; string S; cin >> N >> S; int ans = 1; for (int i = 0; i < N; i++) { char tmp = S[i]; for (int j = i + 1; j < N; j++) { if (S[j] != tmp) { ans++; i = j - 1; break; } if (j == N - 1) i = j + 1;...
insert
15
15
15
17
TLE
p02887
C++
Runtime Error
#include <stdio.h> int main(void) { char S[10000]; int N; int k = 1; scanf("%d", &N); scanf("%s", S); for (int i = 0; i < N - 1; i++) { if (S[i] != S[i + 1]) { k++; } } printf("%d\n", k); }
#include <stdio.h> int main(void) { char S[100000]; int N; int k = 1; scanf("%d", &N); scanf("%s", S); for (int i = 0; i < N - 1; i++) { if (S[i] != S[i + 1]) { k++; } } printf("%d\n", k); }
replace
2
3
2
3
0
p02887
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, c = 0; cin >> n; string s; cin >> s; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { if (s[i] != s[j]) { c++; i = j - 1; break; } } ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, c = 0; cin >> n; string s; cin >> s; char key = s[0]; for (int i = 1; i < n; i++) { // for(int j=i;j<n;j++) // { // if(s[i]!=s[j]) // { // ...
replace
11
18
11
25
TLE
p02887
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> #include <string> using namespace std; int main() { int n; string s; cin >> n >> s; bool flag = 1; int i = 0; while (flag) { while (s[i] == s[i + 1]) { s.erase(i, 1); if (s.size() == i + 1) { flag = 0; break; } } i++; if...
#include <cstdio> #include <iostream> #include <string> using namespace std; int main() { int n; string s; cin >> n >> s; bool flag = 1; int i = 0; if (n == 1) { cout << 1 << endl; return 0; } while (flag) { while (s[i] == s[i + 1]) { s.erase(i, 1); if (s.size() == i + 1) { ...
insert
10
10
10
14
TLE
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int ans = 1; for (int i = 1; i < S.size() - 1; i++) { if (S.at(i) == S.at(i + 1) && S.at(i - 1) != S.at(i)) { ans++; } else if (S.at(i) != S.at(i + 1) && S.at(i - 1) != S.at(i)) { ans++; ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int ans = 1; if (N == 1) { cout << ans << endl; return 0; } for (int i = 1; i < S.size() - 1; i++) { if (S.at(i) == S.at(i + 1) && S.at(i - 1) != S.at(i)) { ans++; } else if (S.at(i)...
insert
10
10
10
15
0
p02887
C++
Runtime Error
#include <stdio.h> int main() { int i, N; char S[10 ^ 5]; // おいしさ int sum = 1; // おいしさのサム値 // 数を取得 scanf("%d", &N); // 文字列を取得 scanf("%s", S); for (i = 1; i < N; i++) { if (S[i] == S[i - 1]) { // printf("一緒:%d,%c\n", i,S[i]); } else { sum++; // printf("違う:%d,%c\n"...
#include <stdio.h> int main() { long int i, N; char S[10 * 10 * 10 * 10 * 10]; // おいしさ long int sum = 1; // おいしさのサム値 // 数を取得 scanf("%d", &N); // 文字列を取得 scanf("%s", S); for (i = 1; i < N; i++) { if (S[i] == S[i - 1]) { // printf("一緒:%d,%c\n", i,S[i]); } else { sum...
replace
2
5
2
5
0
p02887
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int N, count = 1; char s[10000]; cin >> N >> s[0]; for (int i = 1; i < N; i++) { cin >> s[i]; if (s[i] != s[i - 1]) count += 1; } cout << count << endl; }
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int N, count = 1; char s[100000]; cin >> N >> s[0]; for (int i = 1; i < N; i++) { cin >> s[i]; if (s[i] != s[i - 1]) count += 1; } cout << count << endl; }
replace
10
11
10
11
0
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int a = S.size(); for (int i = 0; i < S.size(); i++) { if (S.at(i) == S.at(i + 1)) { a--; } } cout << a << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S; cin >> S; int a = S.size(); for (int i = 0; i < S.size() - 1; i++) { if (S.at(i) == S.at(i + 1)) { a--; } } cout << a << endl; }
replace
9
10
9
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 10) >= this->size() (which is 10)
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int ans = 0; for (int i = 0; i < n; i++) { if (s.at(i) != s.at(i + 1)) { ans++; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int ans = 1; for (int i = 0; i < n - 1; i++) { if (s.at(i) != s.at(i + 1)) { ans++; } } cout << ans << endl; }
replace
8
10
8
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 10) >= this->size() (which is 10)
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { char s[10001]; int n, c = 0; cin >> n; cin >> s; for (int i = 0; i < strlen(s); i++) { if (s[i] != s[i + 1]) c++; } cout << c; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char s[100001]; int n, c = 0; cin >> n; cin >> s; for (int i = 0; i < strlen(s); i++) { if (s[i] != s[i + 1]) c++; } cout << c; return 0; }
replace
5
6
5
6
0
p02887
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n; char s[10001] = {}; cin >> n; int tag = 0; int ans = 0; cin >> s; for (int i = 0; i < n; i++) { if (s[i] == s[i + 1]) { continue; } ans++; } cout << ans; return 0; }
#include <iostream> using namespace std; int main() { int n; char s[100001] = {}; cin >> n; int tag = 0; int ans = 0; cin >> s; for (int i = 0; i < n; i++) { if (s[i] == s[i + 1]) { continue; } ans++; } cout << ans; return 0; }
replace
5
6
5
6
0
p02887
C++
Runtime Error
#include <stdio.h> #include <string.h> int main(void) { int N; char S[10001]; scanf("%d", &N); scanf("%s", S); int i; int ans = N; for (i = 0; i < N; i++) { if (S[i] == S[i + 1]) { ans = ans - 1; } } printf("%d", ans); return 0; }
#include <stdio.h> #include <string.h> int main(void) { int N; char S[100001]; scanf("%d", &N); scanf("%s", S); int i; int ans = N; for (i = 0; i < N; i++) { if (S[i] == S[i + 1]) { ans = ans - 1; } } printf("%d", ans); return 0; }
replace
4
5
4
5
0
p02887
C++
Runtime Error
#include <stdio.h> int main() { int n, i; char s[10000]; while (~scanf("%d", &n)) { int acm = 1; scanf("%s", s); for (i = 0; i < n - 1; i++) if (s[i] != s[i + 1]) acm++; printf("%d\n", acm); } return 0; }
#include <stdio.h> int main() { int n, i; char s[120000]; while (~scanf("%d", &n)) { int acm = 1; scanf("%s", s); for (i = 0; i < n - 1; i++) if (s[i] != s[i + 1]) acm++; printf("%d\n", acm); } return 0; }
replace
3
4
3
4
0
p02887
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; scanf("%d", &N); string S; cin >> S; int ans = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (S.at(i) == S.at(j)) { continue; } else { ans++; i = j; } } } printf...
#include <bits/stdc++.h> using namespace std; int main() { int N; scanf("%d", &N); string S; cin >> S; int ans = 0; for (int i = 0; i < N - 1; i++) { if (S.at(i) == S.at(i + 1)) { continue; } else { ans++; } } printf("%d", ans + 1); return 0; }
replace
10
18
10
15
TLE
p02887
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; ifstream fin("fisier.in"); ofstream fout("fisier.out"); char s[1005]; char actual; int main() { int n, i, j, answer = 1; cin >> n; cin >> s; actual = s[0]; for (i = 1; i < n; i++) if (s[i] != actual) { actual = s[i]; answer++; } cout ...
#include <bits/stdc++.h> using namespace std; ifstream fin("fisier.in"); ofstream fout("fisier.out"); char s[100005]; char actual; int main() { int n, i, j, answer = 1; cin >> n; cin >> s; actual = s[0]; for (i = 1; i < n; i++) if (s[i] != actual) { actual = s[i]; answer++; } cou...
replace
7
8
7
8
0
p02887
C++
Runtime Error
// Author:: MUKUL KUMAR RAI // Institution:: Jalpaiguri Government Engineering College // If you are not doing well now just stick to it and learn new things one day // you will be... Compete with yourself #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fi first #de...
// Author:: MUKUL KUMAR RAI // Institution:: Jalpaiguri Government Engineering College // If you are not doing well now just stick to it and learn new things one day // you will be... Compete with yourself #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fi first #de...
replace
104
108
104
108
0
p02887
C++
Runtime Error
// 此程序使用了qt专属名称,请勿模仿。侵权必究!!! // 我真是太菜了…… #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 1010, P = 1 << 30; int n, ans = 0; char a[N]; inline int read() { int sum = 0, flag = 1; char c; for (; c < '0' || c > '9'; c = getchar()) if (c == '-') flag = -1; for (; c >= '0' ...
// 此程序使用了qt专属名称,请勿模仿。侵权必究!!! // 我真是太菜了…… #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 100100, P = 1 << 30; int n, ans = 0; char a[N]; inline int read() { int sum = 0, flag = 1; char c; for (; c < '0' || c > '9'; c = getchar()) if (c == '-') flag = -1; for (; c >= '0...
replace
5
6
5
6
0
p02887
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef long double ld; const double pi = acos(-1.0); const ll mod = pow(10, 9) + 7; const ll INF = pow(2, 31) - 1; using str = string; typedef pair<int, int> P; typedef vector<int> vi; ll gcd(ll a, ll b...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef long double ld; const double pi = acos(-1.0); const ll mod = pow(10, 9) + 7; const ll INF = pow(2, 31) - 1; using str = string; typedef pair<int, int> P; typedef vector<int> vi; ll gcd(ll a, ll b...
replace
29
30
29
30
0
p02887
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #define int long long using namespace std; inline void read(int &x) { x = 0; int f = 1; char c = getchar(); while (c > '9' || c < '0') { if (c == '-') f = -1; c = getc...
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #define int long long using namespace std; inline void read(int &x) { x = 0; int f = 1; char c = getchar(); while (c > '9' || c < '0') { if (c == '-') f = -1; c = getc...
replace
22
23
22
23
0
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // Repetitions #define FOR(i, a, n) for (ll i = ((ll)a); i < ((ll)n); ++i) #define FORR(i, s, g) for (ll i = ((ll)s - 1); i >= ((ll)g); --i) #define REP(i, n) FOR(i, 0, n) #define REPR(i, n) FORR(i, n, 0) // Container Utils #define ALL(v) (v).begin(), (v).end() #define R...
#include <bits/stdc++.h> using namespace std; // Repetitions #define FOR(i, a, n) for (ll i = ((ll)a); i < ((ll)n); ++i) #define FORR(i, s, g) for (ll i = ((ll)s - 1); i >= ((ll)g); --i) #define REP(i, n) FOR(i, 0, n) #define REPR(i, n) FORR(i, n, 0) // Container Utils #define ALL(v) (v).begin(), (v).end() #define R...
replace
84
85
84
85
0
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n, i, j, k, flag, count = 0; cin >> n; long long int l[n]; for (i = 0; i < n; i++) { cin >> l[i]; } for (i = 0; i < n; i++) { for (j = i + 1; j < n; j++) { for (k = j...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n, i, j, k, flag, count = 0; cin >> n; long long int l[n]; for (i = 0; i < n; i++) { cin >> l[i]; } sort(l, l + n); for (i = 0; i < n; i++) { for (j = i + 1; j < n; j++) ...
insert
13
13
13
14
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l.at(i); } sort(l.begin(), l.end()); vector<pair<int, int>> combi; for (int i = 0; i < n - 2; i++) { int iL = l.at(i); for (int j = i + 1; j < n - 1; j++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l.at(i); } sort(l.begin(), l.end()); vector<pair<int, int>> combi; for (int i = 0; i < n - 2; i++) { int iL = l.at(i); for (int j = i + 1; j < n - 1; j++) { ...
replace
23
31
23
27
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ll long long #define lld long double #define ALL(x) x.begin(), x.end() #ifdef ...
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ll long long #define lld long double #define ALL(x) x.begin(), x.end() #ifdef ...
replace
28
29
28
29
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; void answer1() { cin.tie(0); ios_base::sync_with_stdio(false); int N; cin >> N; vector<int> l(N); for (auto &l_i : l) { cin >> l_i; } int count = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = j + 1; k < N; ...
#include <bits/stdc++.h> using namespace std; void answer1() { cin.tie(0); ios_base::sync_with_stdio(false); int N; cin >> N; vector<int> l(N); for (auto &l_i : l) { cin >> l_i; } int count = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = j + 1; k < N; ...
replace
26
27
26
55
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int n, num, i; cin >> n; num = 0; vector<int> L; for (i = 0; i < n; i++) { cin >> L[i]; } sort(L.begin(), L.end()); rep(b, n) rep(a, b) { int ab = L[a] + L[b]; int r = lower_bound(L....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int n, num, i; cin >> n; num = 0; vector<int> L(n); for (i = 0; i < n; i++) { cin >> L[i]; } sort(L.begin(), L.end()); rep(b, n) rep(a, b) { int ab = L[a] + L[b]; int r = lower_bound...
replace
8
9
8
9
-11
p02888
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() using namespace std; using Graph = vector<vector<int>>; typedef long long ll; const int mod = 1e+9 + 7; int main() { ll N; cin >> N; vector<ll> l(N); rep(i,...
// #define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() using namespace std; using Graph = vector<vector<int>>; typedef long long ll; const int mod = 1e+9 + 7; int main() { ll N; cin >> N; vector<ll> l(N); rep...
replace
0
1
0
1
TLE
p02888
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int vect[1006]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> vect[i]; } sort(vect + 1, vect + n + 1); int ans = 0; for (int i = 1; i <= n - 2; i++) { for (int j = i + 1; j <= n - 1; j++) { ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int vect[2006]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> vect[i]; } sort(vect + 1, vect + n + 1); int ans = 0; for (int i = 1; i <= n - 2; i++) { for (int j = i + 1; j <= n - 1; j++) { ...
replace
5
6
5
6
0
p02888
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int n; scanf("%d", &n); int l[1005]; for (int i = 0; i < n; ++i) scanf("%d", &l[i]); sort(l, l + n, greater<int>()); long long ans = 0; for (int i = 0; i < n - 2; ++i) { int left = i + 1; int right =...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int n; scanf("%d", &n); int l[2005]; for (int i = 0; i < n; ++i) scanf("%d", &l[i]); sort(l, l + n, greater<int>()); long long ans = 0; for (int i = 0; i < n - 2; ++i) { int left = i + 1; int right =...
replace
9
10
9
10
0
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pii> vii; typedef map<int, int> mii; #define fastIO \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pii> vii; typedef map<int, int> mii; #define fastIO \ ios_base::sync_with_stdio(false); ...
replace
26
32
26
37
TLE
p02888
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int n, l[1002]; cin >> n; for (int i = 0; i < n; i++) cin >> l[i]; sort(l, l + n); int ans = 0; for (int i = n - 1; i > 1; i--) { for (int j = i - 1; j > 0; j--) { int mmin = l[i] - l[j]; for (int k = j - 1; k >= ...
#include <algorithm> #include <iostream> using namespace std; int main() { int n, l[2002]; cin >> n; for (int i = 0; i < n; i++) cin >> l[i]; sort(l, l + n); int ans = 0; for (int i = n - 1; i > 1; i--) { for (int j = i - 1; j > 0; j--) { int mmin = l[i] - l[j]; for (int k = j - 1; k >= ...
replace
4
5
4
5
0
p02888
C++
Runtime Error
#include <bits/stdc++.h> #define PI acos(-1) #define all(a) a.begin(), a.end() #define full(a, n) a, a + n #define ma(type, size) (type *)malloc(sizeof(type) * size) #define F first #define S second #define PB push_back #define MP make_pair #define MT make_tuple #define f0(i, n) for (i = 0; i < (n); i++) #define f1(i,...
#include <bits/stdc++.h> #define PI acos(-1) #define all(a) a.begin(), a.end() #define full(a, n) a, a + n #define ma(type, size) (type *)malloc(sizeof(type) * size) #define F first #define S second #define PB push_back #define MP make_pair #define MT make_tuple #define f0(i, n) for (i = 0; i < (n); i++) #define f1(i,...
insert
87
87
87
90
0
p02888
C++
Time Limit Exceeded
#include "bits/stdc++.h" #define rep(i, a) for (ll i = 0; i < (a); ++i) #define REP(i, a, b) for (int i = (a); i < (b); ++i) #define FORV(a, A) for (auto &a : A) using namespace std; using ll = long long; void Main() { int n; cin >> n; vector<int> l(n); rep(i, n) cin >> l[i]; sort(l.begin(), l.end()); i...
#include "bits/stdc++.h" #define rep(i, a) for (ll i = 0; i < (a); ++i) #define REP(i, a, b) for (int i = (a); i < (b); ++i) #define FORV(a, A) for (auto &a : A) using namespace std; using ll = long long; void Main() { int n; cin >> n; vector<int> l(n); rep(i, n) cin >> l[i]; sort(l.begin(), l.end()); i...
replace
19
22
19
21
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v.at(i); } sort(v.begin(), v.end()); int ans = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1; k < n; k++) { if...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v.at(i); } sort(v.begin(), v.end()); int ans = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int itr = lower_bound(v.begin(), v.end(), v....
replace
14
20
14
16
TLE
p02888
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <uno...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <uno...
insert
32
32
32
34
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, a, cnt = 0; cin >> n; vector<int> v; for (int i = 0; i < n; i++) { cin >> a; v.push_back(a); } sort(v.begin(), v.end(), greater<int>()); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1;...
#include <bits/stdc++.h> using namespace std; int main() { int n, a, cnt = 0; cin >> n; vector<int> v; for (int i = 0; i < n; i++) { cin >> a; v.push_back(a); } sort(v.begin(), v.end(), greater<int>()); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1;...
replace
19
20
19
20
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int ans; ans = 0; vector<int> L; for (int i = 0; i < N; i++) { cin >> L[i]; } sort(L.begin(), L.end()); for (int i = 0; i < N - 2; i++) { for (int j = i + 1; j < N - 1; j++) { for (int k = j + 1; k < N; k++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int ans; ans = 0; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L[i]; } sort(L.begin(), L.end()); for (int i = 0; i < N - 2; i++) { for (int j = i + 1; j < N - 1; j++) { for (int k = j + 1; k < N; k++) {...
replace
7
8
7
8
-11
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> vc(n); for (int i = 0; i < n; i++) { cin >> vc.at(i); } sort(vc.begin(), vc.end()); int ans = 0; int a, b, c; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j +...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> vc(n); for (int i = 0; i < n; i++) { cin >> vc.at(i); } sort(vc.begin(), vc.end()); int ans = 0; int a, b, c; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j +...
replace
22
23
22
23
TLE
p02888
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; int main(void) { int input, ans = 0, flag; cin >> input; vector<int> side(input); for (int i = 0; i < input; i++) { cin >> side.at(i); } sort(side.begin(), side.end()); reverse(side.begin(), side.end()); vector<int> num; for (int i = 0; i < input; ...
#include "bits/stdc++.h" using namespace std; int main(void) { int input, ans = 0, flag; cin >> input; vector<int> side(input); for (int i = 0; i < input; i++) { cin >> side.at(i); } sort(side.begin(), side.end()); reverse(side.begin(), side.end()); vector<int> num; for (int i = 0; i < input; ...
delete
24
25
24
24
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define endl "\n" #define se second #define ls(s) (s & (-s)) #define ll long long const int N = 3000300; #define rep(i, begin, end) \ for (__typeof(end) i = (begin) - ((begin) > (end)); ...
#include <bits/stdc++.h> using namespace std; #define fi first #define endl "\n" #define se second #define ls(s) (s & (-s)) #define ll long long const int N = 3000300; #define rep(i, begin, end) \ for (__typeof(end) i = (begin) - ((begin) > (end)); ...
replace
13
14
13
14
0
p02888
C++
Time Limit Exceeded
#include <algorithm> #include <math.h> #include <stdio.h> using namespace std; int main() { int n; scanf("%d", &n); int a[10000] = {0}; for (int i = 0; i < n; i++) scanf("%d", &a[i]); long long num = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1;...
#include <algorithm> #include <math.h> #include <stdio.h> using namespace std; int main() { int n; scanf("%d", &n); int a[10000] = {0}; for (int i = 0; i < n; i++) scanf("%d", &a[i]); sort(a, a + n); long long num = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { f...
insert
10
10
10
11
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int a[20005]; int main() { int num = 0; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { if (a[i] + a[j...
#include <bits/stdc++.h> using namespace std; int a[20005]; int main() { int num = 0; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { if (a[i] + a[j...
replace
14
18
14
15
TLE
p02888
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; int l[1010]; static int memo[1010][2020] = {}; for (int i = 0; i < n; i++) cin >> l[i]; for (int i = 0; i < n; i++) memo[i][l[i]]++; for (int i = 0; i < n; i++) { for (int j = 0; j + 1 < 2020; j++) ...
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; int l[2020]; static int memo[2020][2020] = {}; for (int i = 0; i < n; i++) cin >> l[i]; for (int i = 0; i < n; i++) memo[i][l[i]]++; for (int i = 0; i < n; i++) { for (int j = 0; j + 1 < 2020; j++) ...
replace
7
9
7
9
0
p02888
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) using namespace std; int main() { int n; cin >> n; vector<int> L(n, 0); rep(i, n) { cin >> L[i]; } i...
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) using namespace std; int main() { int n; cin >> n; vector<int> L(n, 0); rep(i, n) { cin >> L[i]; } so...
replace
16
17
16
17
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll MOD = (1e9) + 7; void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); } int main() { fastIO(); int n; cin >> n; vector<int> sticks(n); for (int i = 0; i < n; i++) { cin >> sticks[i]; } sort(sticks.begin(), sticks.end(...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll MOD = (1e9) + 7; void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); } int main() { fastIO(); int n; cin >> n; vector<int> sticks(n); for (int i = 0; i < n; i++) { cin >> sticks[i]; } sort(sticks.begin(), sticks.end(...
replace
20
32
20
25
TLE
p02888
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; int main() { size_t n; cin >> n; vector<size_t> l(n, 0); for (size_t i = 0; i < n; ++i) cin >> l[i]; size_...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; int main() { size_t n; cin >> n; vector<size_t> l(n, 0); for (size_t i = 0; i < n; ++i) cin >> l[i]; sort(...
insert
19
19
19
20
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int64_t n, a = 0; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v.at(i); sort(v.begin(), v.end()); for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { if (...
#include <bits/stdc++.h> using namespace std; int main() { int64_t n, a = 0; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v.at(i); sort(v.begin(), v.end()); for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { if (...
replace
13
15
13
14
TLE
p02888
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace...
replace
20
21
20
21
TLE
p02888
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
replace
259
260
259
260
0
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N, 0); for (int i = 0; i < N; i++) { cin >> L.at(i); } int cnt = 0; sort(L.begin(), L.end()); /* if(N==3){ if((L.at(0) + L.at(1) > L.at(2)) && (L.at(0) < L.at(1) + L.at(2)) && (L.at(0) ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N, 0); for (int i = 0; i < N; i++) { cin >> L.at(i); } int cnt = 0; sort(L.begin(), L.end()); /* if(N==3){ if((L.at(0) + L.at(1) > L.at(2)) && (L.at(0) < L.at(1) + L.at(2)) && (L.at(0) ...
replace
25
33
25
31
TLE
p02888
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include "bits/stdc++.h" using namespace std; //------------------------------- Libraries --------------------------------// //------------------------------- Type Names -------------------------------// using i64 = int_fast64_t; using seika = string; // akari : 1D, yukari : 2D, maki : 3D ve...
// #define _GLIBCXX_DEBUG #include "bits/stdc++.h" using namespace std; //------------------------------- Libraries --------------------------------// //------------------------------- Type Names -------------------------------// using i64 = int_fast64_t; using seika = string; // akari : 1D, yukari : 2D, maki : 3D...
replace
0
1
0
1
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int l[1005]; for (int i = 0; i < n; ++i) { cin >> l[i]; } sort(l, l + n); int res = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { int tmp = l[i] + l[j]; int *pos = lower_bound(l, l...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int l[2005]; for (int i = 0; i < n; ++i) { cin >> l[i]; } sort(l, l + n); int res = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { int tmp = l[i] + l[j]; int *pos = lower_bound(l, l...
replace
7
8
7
8
0
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l[i]; } sort(l.begin(), l.end()); int count = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++...
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l[i]; } sort(l.begin(), l.end()); int count = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { if (l[n - 1] < l[i] + l[j]) { ...
replace
17
22
17
26
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } sort(L.begin(), L.end()); int count = 0; for (int i = 0; i < N; i++) { int a = L.at(i); for (int j = 0; j < N; j++) { if (i >= j) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } sort(L.begin(), L.end()); int count = 0; for (int i = 0; i < N; i++) { int a = L.at(i); for (int j = 1; i + j < N; j++) { int b = L.at(i + ...
replace
18
28
18
22
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ALL(v) (v).begin(), (v).end() #define REP(i, p, n) for (int i = p; i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) #define SZ(x) ((int)(x).size()) #define debug(x) cerr << #x << ": " << x << '\n' #define INF 999999999 typedef long long int Int; typedef pair<int, i...
#include <bits/stdc++.h> using namespace std; #define ALL(v) (v).begin(), (v).end() #define REP(i, p, n) for (int i = p; i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) #define SZ(x) ((int)(x).size()) #define debug(x) cerr << #x << ": " << x << '\n' #define INF 999999999 typedef long long int Int; typedef pair<int, i...
insert
21
21
21
22
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; long long inf = 100000000000000; typedef pair<int, int> P; int main() { // 全探索できるか int n; cin >> n; int a[1100], i; for (i = 0; i < n; i++) { cin >> a[i]; } stable_sort(a, a + n); int j, k; int ans = 0; for (i = 0; i < n; i++) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; long long inf = 100000000000000; typedef pair<int, int> P; int main() { // 全探索できるか int n; cin >> n; int a[2100], i; for (i = 0; i < n; i++) { cin >> a[i]; } stable_sort(a, a + n); int j, k; int ans = 0; for (i = 0; i < n; i++) { ...
replace
8
9
8
9
0
p02888
Python
Runtime Error
import bisect N = int(input()) L = [int(i) for i in input().split()] SL = sorted(L) ans = 0 for i in range(N - 2): for j in range(i + 1, N - 1): right = bisect.bisect_left(SL, SL[i] + SL[j]) left = j + 1 ans += max(right - left) print(ans)
import bisect N = int(input()) L = [int(i) for i in input().split()] SL = sorted(L) ans = 0 for i in range(N - 2): for j in range(i + 1, N - 1): right = bisect.bisect_left(SL, SL[i] + SL[j]) left = j + 1 ans += right - left print(ans)
replace
11
12
11
12
TypeError: 'int' object is not iterable
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02888/Python/s179459045.py", line 11, in <module> ans += max(right - left) TypeError: 'int' object is not iterable
p02888
Python
Time Limit Exceeded
import bisect N = int(input()) L = list(map(int, input().split())) assert len(L) == N L.sort() n = 0 # Choose two edges for i in range(N): for j in range(i + 1, N): a = L[i] + L[j] k = bisect.bisect_left(L, a, lo=j + 1) # assert all(v < a for v in L[:k]) and all(v >= a for v in L[k:]) ...
import bisect N = int(input()) L = list(map(int, input().split())) assert len(L) == N L.sort() n = 0 # Choose two edges for i in range(N): for j in range(i + 1, N): a = L[i] + L[j] k = bisect.bisect_left(L, a, lo=j + 1) # assert all(v < a for v in L[:k]) and all(v >= a for v in L[k:]) ...
delete
9
10
9
9
TLE
p02888
Python
Time Limit Exceeded
import bisect n = int(input()) L = list(map(int, input().split())) L.sort() ans = 0 for i in range(n - 2): a = L[i] for j in range(i + 1, n - 1): b = L[j] k = bisect.bisect_left(L[j + 1 :], a + b) ans += k print(ans)
import bisect n = int(input()) L = list(map(int, input().split())) L.sort() ans = 0 for i in range(n - 2): a = L[i] for j in range(i + 1, n - 1): b = L[j] k = bisect.bisect_left(L, a + b) ans += k - j - 1 print(ans)
replace
10
12
10
12
TLE
p02888
Python
Time Limit Exceeded
import bisect N = int(input()) L = sorted(map(int, input().split(" "))) ans = 0 for i in range(len(L)): for j in range(i + 1, len(L)): a = L[i] b = L[j] ans += bisect.bisect_right(L[j + 1 :], a + b - 1) print(ans)
import bisect N = int(input()) L = sorted(map(int, input().split(" "))) ans = 0 for i in range(len(L)): for j in range(i + 1, len(L)): a = L[i] b = L[j] ans += max(0, bisect.bisect_right(L, a + b - 1) - (j + 1)) print(ans)
replace
10
11
10
11
TLE
p02888
Python
Time Limit Exceeded
#!/usr/bin/env python3 N = int(input()) L = sorted([int(s) for s in input().split()]) MAX_SEARCH = max(L) + 1 def check_search(middle, idx_short2, l_lng, l_lows): return l_lows[middle] + l_lows[idx_short2] > l_lng l_lows = L[:2] triangles = 0 for l_lng in L[2:]: for idx, l_low in enumerate(l_lows): ...
#!/usr/bin/env python3 N = int(input()) L = sorted([int(s) for s in input().split()]) def check_search(middle, idx_short2, l_lng, l_lows): return l_lows[middle] + l_lows[idx_short2] > l_lng l_lows = L[:2] triangles = 0 for l_lng in L[2:]: for idx, l_low in enumerate(l_lows): left = 0 right...
delete
3
5
3
3
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int(i) = 0; i < (n); i++) int main() { int n, ans = 0; cin >> n; vector<int> l(n, 0); REP(i, n) cin >> l.at(i); sort(l.begin(), l.end()); for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int(i) = 0; i < (n); i++) int main() { int n, ans = 0; cin >> n; vector<int> l(n, 0); REP(i, n) cin >> l.at(i); sort(l.begin(), l.end()); for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + ...
replace
14
22
14
15
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; #define all(x) (x).begin(), (x).end() #define fsp(x) cout << fixed << setprecision(x) #define endl '\n' const ll inf = LLONG_MAX; const long double pi = M_PI; void Yes() { cout << "Yes" << endl; } void No() { cout << "No" << end...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; #define all(x) (x).begin(), (x).end() #define fsp(x) cout << fixed << setprecision(x) #define endl '\n' const ll inf = LLONG_MAX; const long double pi = M_PI; void Yes() { cout << "Yes" << endl; } void No() { cout << "No" << end...
replace
14
15
14
15
TLE
p02888
C++
Runtime Error
// Author:: MUKUL KUMAR RAI // Institution:: Jalpaiguri Government Engineering College // If you are not doing well now just stick to it and learn new things one day // you will be... Compete with yourself #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fi first #de...
// Author:: MUKUL KUMAR RAI // Institution:: Jalpaiguri Government Engineering College // If you are not doing well now just stick to it and learn new things one day // you will be... Compete with yourself #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fi first #de...
replace
104
108
104
108
0
p02888
C++
Runtime Error
// Ruthless Coding #include <bits/stdc++.h> #define uni(x) (x).resize(unique(ALL(x)) - (x).begin()) #define fprint(v) \ for (auto x : v) \ cout << x << ' ' #define ALL(x) (x).begin(), (x).end() ...
// Ruthless Coding #include <bits/stdc++.h> #define uni(x) (x).resize(unique(ALL(x)) - (x).begin()) #define fprint(v) \ for (auto x : v) \ cout << x << ' ' #define ALL(x) (x).begin(), (x).end() ...
delete
68
69
68
68
-6
terminate called after throwing an instance of 'std::length_error' what(): cannot create std::vector larger than max_size()
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1000 + 5; int arr[maxn]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; ++i) cin >> arr[i]; ll res = 0; sort(arr, arr + n); for (int i = 0; i < n; ++i) for (int j = i +...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2000 + 5; int arr[maxn]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; ++i) cin >> arr[i]; ll res = 0; sort(arr, arr + n); for (int i = 0; i < n; ++i) for (int j = i +...
replace
3
4
3
4
0
p02888
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; long long a[1010], n, ans; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); for (int i = 0; i < n - 2; i++) for (int o = i + 1; o < n - 1; o++) for (int j = o + 1; j < n; j++) if (a[i] + a[o] > a[j...
#include <algorithm> #include <iostream> using namespace std; long long a[2010], n, ans; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); for (int i = 0; i < n - 2; i++) for (int o = i + 1; o < n - 1; o++) for (int j = o + 1; j < n; j++) if (a[i] + a[o] > a[j...
replace
3
4
3
4
0
p02888
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (ll i = 0; i < n; i++) #define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup. using namespace s...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (ll i = 0; i < n; i++) #define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup. using namespace s...
replace
44
45
44
45
0
p02888
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define show(x) cerr << #x << " = " << x << endl; #define input_from_file freopen("input.txt", "r", stdin) #define output_to_file freopen("output.txt", "w", stdout) #define fastio ios_base::sync_with_stdio(0) #define endl '\n' const int N = 2e3 + 1; int arr[N]; int main(...
#include "bits/stdc++.h" using namespace std; #define show(x) cerr << #x << " = " << x << endl; #define input_from_file freopen("input.txt", "r", stdin) #define output_to_file freopen("output.txt", "w", stdout) #define fastio ios_base::sync_with_stdio(0) #define endl '\n' const int N = 2e3 + 1; int arr[N]; int main(...
delete
29
30
29
29
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; vector<int> l(n); rep(i, n) cin >> l[i]; int result = 0; for (int i = 0; i < n - 2; ++i) { int a = l[i]; for (int j = i + 1...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; vector<int> l(n); rep(i, n) cin >> l[i]; sort(l.begin(), l.end()); int result = 0; for (int i = 0; i < n - 2; ++i) { int a = l...
replace
14
15
14
15
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int n, tmp, ans = 0; std::vector<int> data; void solve() { sort(data.begin(), data.end()); for (int i = n - 1; i >= 2; i--) { for (int j = i - 1; j >= 1; j--) { for (int k = j - 1; k >= 0; k--) { if (data.at(i) < data.at(j) + data.at(k)) { a...
#include <bits/stdc++.h> using namespace std; int n, tmp, ans = 0; std::vector<int> data; void solve() { sort(data.begin(), data.end()); reverse(data.begin(), data.end()); for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { if (data.at(i) > data.at(j) * 2) { break; } ...
replace
7
10
7
14
TLE
p02888
C++
Time Limit Exceeded
#include <iostream> using namespace std; int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int N; cin >> N; int l[N]; int i; for (i = 0; i < N; i++) cin >> l[i]; std::qsort(l, N, 4, compare_int); int j, k, m; int sum; int count = 0; for (j = N - 1;...
#include <iostream> using namespace std; int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int N; cin >> N; int l[N]; int i; for (i = 0; i < N; i++) cin >> l[i]; std::qsort(l, N, 4, compare_int); int j, k, m; int sum; int count = 0; for (j = N - 1;...
replace
28
29
28
29
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; int L[1002]; long long ans = 0; cin >> N; for (int i = 0; i < N; i++) cin >> L[i]; sort(L, L + N); // for(int i=0;i<N;i++) cout << L[i] << " "; // cout << endl; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N; int L[10002]; long long ans = 0; cin >> N; for (int i = 0; i < N; i++) cin >> L[i]; sort(L, L + N); // for(int i=0;i<N;i++) cout << L[i] << " "; // cout << endl; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { ...
replace
5
6
5
6
0
p02888
C++
Time Limit Exceeded
#include <iostream> using namespace std; #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <vector> #define MOD1 1000000007 #define MOD2 998244353 #define LIMIT1 200002 #define LIMIT2 500002 typedef long long ll; typedef long double ld; typedef const void cv; #define...
#include <iostream> using namespace std; #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <vector> #define MOD1 1000000007 #define MOD2 998244353 #define LIMIT1 200002 #define LIMIT2 500002 typedef long long ll; typedef long double ld; typedef const void cv; #define...
replace
80
81
80
81
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); sort(L.begin(), L.end()); int ans = 0; for (int i = 0; i < N - 2; i++) { for (int j = i + 1; i < N - 1; j++) { int c = L.at(i) + L.at(j); auto itr =...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); sort(L.begin(), L.end()); int ans = 0; for (int i = 0; i < N - 2; i++) { for (int j = i + 1; j < N - 1; j++) { int c = L.at(i) + L.at(j); auto itr =...
replace
11
12
11
12
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 4) >= this->size() (which is 4)
p02888
C++
Time Limit Exceeded
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include "bits/stdc++.h" using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>:...
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include "bits/stdc++.h" using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>:...
insert
53
53
53
54
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int solve(const vector<int> &L, int i, int j) { const auto ab = L[i] + L[j]; const auto len = L.size(); int left = 0, right = len - 1; int count = 0; for (;;) { const auto index = (left + right + 1) / 2; // printf("count=%d, left=%d, right=%d, index = %d...
#include <bits/stdc++.h> using namespace std; int solve(const vector<int> &L, int i, int j) { const auto ab = L[i] + L[j]; const auto len = L.size(); int left = 0, right = len - 1; int count = 0; for (;;) { const auto index = (left + right + 1) / 2; // printf("count=%d, left=%d, right=%d, index = %d...
replace
25
44
25
26
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define M_DEBUG if (0) /****************************************************************************** typedef ******************************************************************************/ typedef unsigned long long int ullint; typedef long long int llint; /*!...
#include <bits/stdc++.h> using namespace std; #define M_DEBUG if (0) /****************************************************************************** typedef ******************************************************************************/ typedef unsigned long long int ullint; typedef long long int llint; /*!...
replace
59
69
59
108
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int my_lower(vector<int> vec, int key, int nimin, int nimax) { int nimid = nimin + (nimax - nimin) / 2; if (vec.at(nimid) > key) { if (vec.at(nimid - 1) < key) { return nimid; } return my_lower(vec, key, nimin, nimid - 1); } if (vec.at(nimid) < ke...
#include <bits/stdc++.h> using namespace std; int my_lower(vector<int> &vec, int key, int nimin, int nimax) { int nimid = nimin + (nimax - nimin) / 2; if (vec.at(nimid) > key) { if (vec.at(nimid - 1) < key) { return nimid; } return my_lower(vec, key, nimin, nimid - 1); } if (vec.at(nimid) < k...
replace
3
4
3
4
TLE
p02888
C++
Time Limit Exceeded
#include <bits/stdc++.h> // 登録しよう!→ https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ using namespace std; using ll = long long; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } // a,bの最大公約数(gcd)を求める ll lcm(ll a, ll b) { return abs(a * b) / gcd(a, b); } // a,bの最小公倍数(lcm)を求める vector<ll> enum_div(ll n) { ...
#include <bits/stdc++.h> // 登録しよう!→ https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ using namespace std; using ll = long long; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } // a,bの最大公約数(gcd)を求める ll lcm(ll a, ll b) { return abs(a * b) / gcd(a, b); } // a,bの最小公倍数(lcm)を求める vector<ll> enum_div(ll n) { ...
delete
49
50
49
49
TLE
p02888
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; constexpr long double EPS = 1e-15; const long double PI = acos(-1); constexpr int inf = 2e9; constexpr ll INF = 2e18; constexpr ll MOD = 1e9 + 7; constexpr ll MOD1 = 998244353; typedef pair<ll, ll> P; // #define all(v) (...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; constexpr long double EPS = 1e-15; const long double PI = acos(-1); constexpr int inf = 2e9; constexpr ll INF = 2e18; constexpr ll MOD = 1e9 + 7; constexpr ll MOD1 = 998244353; typedef pair<ll, ll> P; // #define all(v) (...
replace
22
23
22
23
0
p02888
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; int l[1000]; for (int i = 0; i < n; ++i) cin >> l[i]; sort(l, l + n); int cnt = 0; for (int i = 0; i < n - 2; ++i) for (int j = i + 1; j < n - 1; ++j) for (int k = n - 1; k > j; --k) if (l[...
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; int l[2000]; for (int i = 0; i < n; ++i) cin >> l[i]; sort(l, l + n); int cnt = 0; for (int i = 0; i < n - 2; ++i) for (int j = i + 1; j < n - 1; ++j) for (int k = n - 1; k > j; --k) if (l[...
replace
8
9
8
9
0