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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
s.at(k) = s.at(k) + 0x20;
for (int i = 0; i < s.size(); i++) {
cout << s.at(i);
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
s.at(k - 1) = s.at(k - 1) + 0x20;
for (int i = 0; i < s.size(); i++) {
cout << s.at(i);
}
} | replace | 10 | 11 | 10 | 11 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
string s;
getline(cin, s);
s.at(K - 1) = s.at(K - 1) + 0x20;
cout << s << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<char> s(N);
for (int i = 0; i < N; i++) {
cin >> s.at(i);
if (i == K - 1) {
s.at(i) += 0x20;
}
cout << s.at(i);
}
cout << endl;
} | replace | 6 | 10 | 6 | 15 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p03041 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
int n, k;
cin >> n >> k;
char s[k];
for (int i = 0; i < n; i++) {
cin >> s[i];
}
s[k - 1] += 32;
for (int i = 0; i < n; i++) {
cout << s[i];
}
cout << endl;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int n, k;
cin >> n >> k;
char s[50];
cin >> s;
if (s[k - 1] == 'A')
s[k - 1] = 'a';
else if (s[k - 1] == 'B')
s[k - 1] = 'b';
else
s[k - 1] = 'c';
cout << s << endl;
} | replace | 5 | 15 | 5 | 14 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
string S;
cin >> S;
if (S.at(K) == 'A')
S.at(K) = 'a';
if (S.at(K) == 'B')
S.at(K) = 'b';
if (S.at(K) == 'C')
S.at(K) = 'c';
cout << S << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
string S;
cin >> S;
if (S.at(K - 1) == 'A')
S.at(K - 1) = 'a';
if (S.at(K - 1) == 'B')
S.at(K - 1) = 'b';
if (S.at(K - 1) == 'C')
S.at(K - 1) = 'c';
cout << S << endl;
} | replace | 8 | 14 | 8 | 14 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
string S;
S[B--] -= 32;
cout << S << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
string S;
cin >> S;
int C = B - 1;
cin >> C;
S[C] += 32;
cout << S << endl;
}
| replace | 7 | 8 | 7 | 11 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<char> x(N);
for (int i = 0; i < N; i++) {
cin >> x.at(i);
}
if (x.at(K) = 'A')
x.at(K) = 'a';
if (x.at(K) = 'B')
x.at(K) = 'b';
if (x.at(K) = 'C')
x.at(K) = 'c';
for (int j = 0; j < N; j++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
char S[N + 1];
cin >> S;
if (S[K - 1] == 'A')
S[K - 1] = 'a';
if (S[K - 1] == 'B')
S[K - 1] = 'b';
if (S[K - 1] == 'C')
S[K - 1] = 'c';
cout << S << endl;
return 0;
}
| replace | 6 | 19 | 6 | 16 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
string c;
cin >> a >> b;
cin >> c;
if (c.at(b) == 'A')
c.at(b) == 'a';
if (c.at(b) == 'B')
c.at(b) == 'b';
if (c.at(b) == 'C')
c.at(b) == 'c';
cout << c << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
string c;
cin >> a >> b;
cin >> c;
if (c.at(b - 1) == 'A')
c.at(b - 1) = 'a';
if (c.at(b - 1) == 'B')
c.at(b - 1) = 'b';
if (c.at(b - 1) == 'C')
c.at(b - 1) = 'c';
cout << c << endl;
}
| replace | 8 | 14 | 8 | 15 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
if (s.at(k - 1) == 'A') {
s.at(k - 1) = 'a';
} else if (s.at(k) == 'B') {
s.at(k - 1) = 'b';
} else {
s.at(k - 1) = 'c';
}
cout << s << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
char in[55];
int a, b;
cin >> a >> b >> in;
in[b - 1] += 32;
cout << in << endl;
} | replace | 3 | 15 | 3 | 8 | 0 | |
p03041 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
char s[3];
for (int i = 0; i < n; i++)
cin >> s[i];
s[k - 1] = s[k - 1] + 32;
for (int i = 0; i < n; i++)
cout << s[i];
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
char s[n];
for (int i = 0; i < n; i++)
cin >> s[i];
s[k - 1] = s[k - 1] + 32;
for (int i = 0; i < n; i++)
cout << s[i];
return 0;
} | replace | 6 | 7 | 6 | 7 | TLE | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
char a;
cin >> n >> k >> s;
a = s.at(k);
if (a == 'A') {
s.at(k - 1) = 'a';
} else if (a == 'B') {
s.at(k - 1) = 'b';
} else {
s.at(k - 1) = 'c';
}
cout << s << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
char a;
cin >> n >> k >> s;
a = s.at(k - 1);
if (a == 'A') {
s.at(k - 1) = 'a';
} else if (a == 'B') {
s.at(k - 1) = 'b';
} else {
s.at(k - 1) = 'c';
}
cout << s << endl;
} | replace | 8 | 9 | 8 | 9 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
string S;
(char)tolower(S.at(K - 1));
cout << S << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
string S;
cin >> N >> K >> S;
if (S.at(K - 1) == 'A')
S.at(K - 1) = 'a';
else if (S.at(K - 1) == 'B')
S.at(K - 1) = 'b';
else
S.at(K - 1) = 'c';
cout << S << endl;
} | replace | 5 | 6 | 5 | 12 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 32628) >= this->size() (which is 0)
|
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
string S;
cin >> S;
if (S.at(K) == 'A')
S.at(K) = 'a';
else if (S.at(K) == 'B')
S.at(K) = 'b';
else if (S.at(K) == 'C')
S.at(K) = 'c';
cout << S << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
string S;
cin >> S;
if (S.at(K - 1) == 'A')
S.at(K - 1) = 'a';
else if (S.at(K - 1) == 'B')
S.at(K - 1) = 'b';
else if (S.at(K - 1) == 'C')
S.at(K - 1) = 'c';
cout << S << endl;
} | replace | 8 | 14 | 8 | 14 | 0 | |
p03041 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int number, count;
string str;
cin >> number >> count;
cin >> str;
str.at(count) += 0x20;
cout << str << endl;
return 0;
}
| #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int number, count;
string str;
cin >> number >> count;
cin >> str;
str.at(count - 1) += 0x20;
cout << str << endl;
return 0;
}
| replace | 9 | 10 | 9 | 10 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
char s[n];
cin >> n >> k;
cin >> s;
s[k - 1] += 32;
cout << s;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
char s[k];
cin >> n >> k;
cin >> s;
s[k - 1] += 32;
cout << s;
}
| replace | 4 | 5 | 4 | 5 | -11 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
string S;
cin >> N >> K >> S;
S.at(K) = tolower(S.at(K));
cout << S;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
string S;
cin >> N >> K >> S;
S.at(K - 1) = tolower(S.at(K - 1));
cout << S;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p03041 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vec... | #include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vec... | replace | 44 | 46 | 44 | 47 | -6 | e424e92d-1952-4a8b-bfb4-0b4c97cdff4b.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03041/C++/s447244952.cpp:63: int main(): Assertion `S.length() == N' failed.
|
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
if (s.at(k) == 'A')
s.at(k) = 'a';
else if (s.at(k) == 'B')
s.at(k) = 'b';
else if (s.at(k) == 'C')
s.at(k) = 'c';
cout << s;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
if (s.at(k - 1) == 'A')
s.at(k - 1) = 'a';
else if (s.at(k - 1) == 'B')
s.at(k - 1) = 'b';
else if (s.at(k - 1) == 'C')
s.at(k - 1) = 'c';
cout << s;
} | replace | 8 | 14 | 8 | 14 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
char s[] = {};
cin >> n >> k;
cin >> s;
s[k - 1] = s[k - 1] + 32;
cout << s << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
char s[256];
cin >> n >> k;
cin >> s;
s[k - 1] = s[k - 1] + 32;
cout << s << endl;
return 0;
}
| replace | 5 | 6 | 5 | 6 | -6 | *** stack smashing detected ***: terminated
|
p03041 | C++ | Runtime Error | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
int main() {
int n, k;
std::string input, copy;
std::cin >> n >> k >> input;
copy = input;
transform(copy.begin(), copy.end(), copy.begin(),
[](unsigned char c) -> unsigned char { return std::tolower(c); });
input[k... | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
int main() {
int n, k;
std::string input, copy;
std::cin >> n >> k >> input;
copy = input;
transform(copy.begin(), copy.end(), copy.begin(),
[](unsigned char c) -> unsigned char { return std::tolower(c); });
input[k... | replace | 18 | 19 | 18 | 19 | 1 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
s.at(k) = s.at(k) - ('A' - 'a');
cout << s << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
s.at(k - 1) = s.at(k - 1) - ('A' - 'a');
cout << s << endl;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p03041 | C++ | Runtime Error | /*
Author: Racer5x
*************************************** UNAUTHORISED COPYING OF CODE
PROHIBITED **********************************
*/
#include <bits/stdc++.h>
#define int long long
#define double long double
#define pb push_back
#define pf push_front
#define pii pair<int, int>
#define vi vector<int>
#define vi... | /*
Author: Racer5x
*************************************** UNAUTHORISED COPYING OF CODE
PROHIBITED **********************************
*/
#include <bits/stdc++.h>
#define int long long
#define double long double
#define pb push_back
#define pf push_front
#define pii pair<int, int>
#define vi vector<int>
#define vi... | delete | 39 | 44 | 39 | 39 | -11 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
char s[10];
cin >> n >> k;
cin >> s;
s[k - 1] += 32;
cout << s;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
char s[49];
cin >> n >> k;
cin >> s;
s[k - 1] += 32;
cout << s;
}
| replace | 4 | 5 | 4 | 5 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
string S;
cin >> S;
if (S.at(K) == 'A')
S.at(K) = 'a';
if (S.at(K) == 'B')
S.at(K) = 'b';
if (S.at(K) == 'C')
S.at(K) = 'c';
cout << S << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
string S;
cin >> S;
if (S.at(K - 1) == 'A')
S.at(K - 1) = 'a';
if (S.at(K - 1) == 'B')
S.at(K - 1) = 'b';
if (S.at(K - 1) == 'C')
S.at(K - 1) = 'c';
cout << S << endl;
} | replace | 8 | 14 | 8 | 14 | 0 | |
p03041 | C++ | Runtime Error | /***************************************
Author : Susanka Majumder ( bingobong )
***************************************/
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjm... | /***************************************
Author : Susanka Majumder ( bingobong )
***************************************/
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjm... | replace | 186 | 191 | 186 | 192 | -11 | |
p03041 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
//----------------
#define int long long
//---------... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
//----------------
#define int long long
//---------... | replace | 80 | 87 | 80 | 81 | TLE | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
char x = s.at(k - 1);
if (x == 'A') {
x = 'a';
} else if (x == 'B') {
x = 'b';
} else {
x = 'c';
}
s.at(k - 1) = x;
cout << s << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k;
cin >> s;
char x = s.at(k - 1);
if (x == 'A') {
x = 'a';
} else if (x == 'B') {
x = 'b';
} else {
x = 'c';
}
s.at(k - 1) = x;
cout << s << endl;
}
| insert | 6 | 6 | 6 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 32533) >= this->size() (which is 0)
|
p03041 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
if (s.at(k) == 'A')
s.at(k) = 'a';
else if (s.at(k) == 'B')
s.at(k) = 'b';
else
s.at(k) = 'c';
cout << s << endl;
} | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, k;
string s;
cin >> n >> k >> s;
k = k - 1;
if (s.at(k) == 'A')
s.at(k) = 'a';
else if (s.at(k) == 'B')
s.at(k) = 'b';
else
s.at(k) = 'c';
cout << s << endl;
} | insert | 10 | 10 | 10 | 11 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
string S;
cin >> N >> K;
cin >> S;
S.at(K) = tolower(S.at(K - 1));
cout << S << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
string S;
cin >> N >> K;
cin >> S;
S.at(K - 1) = tolower(S.at(K - 1));
cout << S << endl;
}
| replace | 7 | 8 | 7 | 8 | 0 | |
p03041 | C++ | Runtime Error | // TOPSIC001_0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef int _loop_int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); ++i)
#define FOR(i, a, b) for (_loop_int i = (_l... | // TOPSIC001_0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef int _loop_int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); ++i)
#define FOR(i, a, b) for (_loop_int i = (_l... | insert | 42 | 42 | 42 | 43 | 0 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int K;
cin >> N;
cin >> K;
string S;
cin >> S;
S[K - 1] = S[K - 1] + 32;
cout << S << endl;
return 1;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int K;
cin >> N;
cin >> K;
string S;
cin >> S;
S[K - 1] = S[K - 1] + 32;
cout << S << endl;
return 0;
} | replace | 12 | 13 | 12 | 13 | 1 | |
p03041 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, B;
cin >> N >> B;
string S;
B--;
if (S.at(B) == 'A') {
S.at(B) = 'a';
cout << S << endl;
} else if (S.at(B) == 'B') {
S.at(B) = 'b';
cout << S << endl;
} else if (S.at(B) == 'C') {
S.at(B) = 'c';
cout << S << endl;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, B;
cin >> N >> B;
string S;
cin >> S;
B--;
if (S.at(B) == 'A') {
S.at(B) = 'a';
cout << S << endl;
} else if (S.at(B) == 'B') {
S.at(B) = 'b';
cout << S << endl;
} else if (S.at(B) == 'C') {
S.at(B) = 'c';
cout <<... | insert | 7 | 7 | 7 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p03042 | Python | Runtime Error | s = input()
if s[:2] == "00" or s[2:] == "00":
print("NA")
elif s[:2] > 12 and 0 <= s[2:] <= 12:
print("YYMM")
elif 0 <= s[:2] <= 12 and 0 <= s[2:] <= 12:
print("AMBIGUOUS")
else:
print("MMYY")
| s = input()
f = 0 < int(s[:2]) < 13
s = 0 < int(s[2:]) < 13
ans = "NA"
if f and s:
ans = "AMBIGUOUS"
elif s:
ans = "YYMM"
elif f:
ans = "MMYY"
print(ans)
| replace | 1 | 9 | 1 | 12 | TypeError: '>' not supported between instances of 'str' and 'int' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03042/Python/s048876965.py", line 4, in <module>
elif s[:2] > 12 and 0 <= s[2:] <= 12:
TypeError: '>' not supported between instances of 'str' and 'int'
|
p03042 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
while (1) {
int a;
cin >> a;
int b = a / 100;
int c = a % 100;
if (b <= 12 && c <= 12 && b >= 1 && c >= 1) {
cout << "AMBIGIOUS" << endl;
} else if (b <= 12 && b >= 1 && c >= 1) {
cout << "MMYY" << endl;
} else if (b >=... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
scanf("%d", &a);
int L = a / 100;
int R = a % 100;
if (1 <= L && L <= 12) {
if (1 <= R && R <= 12)
printf("AMBIGUOUS\n");
else
printf("MMYY\n");
} else {
if (1 <= R && R <= 12)
printf("YYMM\n");
else
pr... | replace | 3 | 16 | 3 | 17 | TLE | |
p03042 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define pb(a) push_back(a)
using namespace std;
typedef long long ll;
int main() {
int s;
cin >>... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define pb(a) push_back(a)
using namespace std;
typedef long long ll;
int main() {
int s;
cin >>... | replace | 25 | 26 | 25 | 26 | 0 | |
p03042 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
int syc(long i, long Min, long Max) {
if (Min <= i && i <= Max) {
return 1;
} else {
exit(1);
// return 0;
}
}
int main() {
int x;
cin >> x;
syc(x, 1, 9999)... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
int syc(long i, long Min, long Max) {
if (Min <= i && i <= Max) {
return 1;
} else {
exit(1);
// return 0;
}
}
int main() {
int x;
cin >> x;
syc(x, 0, 9999)... | replace | 21 | 22 | 21 | 22 | 0 | |
p03042 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#define REP(i, m, n) for (int i = m; i < n; i++)
#define rep(i, n) REP(i, 0, n)
template <class T> void chmax(T &a, T b) {
if (a < b) {
a = b;
}
}
template <class T> void chmin(T &a, T b) {
if (a... | #include <algorithm>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#define REP(i, m, n) for (int i = m; i < n; i++)
#define rep(i, n) REP(i, 0, n)
template <class T> void chmax(T &a, T b) {
if (a < b) {
a = b;
}
}
template <class T> void chmin(T &a, T b) {
if (a... | replace | 25 | 26 | 25 | 26 | 0 | |
p03042 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
int main(void) {
char s[4];
scanf("%s", s);
int i1 = (s[0] - '0') * 10 + (s[1] - '0');
int i2 = (s[2] - '0') * 10 + (s[3] - '0');
if (1 <= i1 && i1 <= 12) {
if (1 <= i2 && i2 <= 12) {
... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
int main(void) {
char s[10];
scanf("%s", s);
int i1 = (s[0] - '0') * 10 + (s[1] - '0');
int i2 = (s[2] - '0') * 10 + (s[3] - '0');
if (1 <= i1 && i1 <= 12) {
if (1 <= i2 && i2 <= 12) {
... | replace | 9 | 10 | 9 | 10 | 0 | |
p03042 | C++ | Runtime Error | /*coderanant*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define f1(i, a, b) for (i = a; i < b; i++)
#define f2(i, a, b) for (i = a; i >= b; i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair
const int mod =... | /*coderanant*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define f1(i, a, b) for (i = a; i < b; i++)
#define f2(i, a, b) for (i = a; i >= b; i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair
const int mod =... | replace | 22 | 26 | 22 | 26 | 0 | |
p03042 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
int num[2] = {0, 0};
string mes[4] = {"NA", "MMYY", "YYMM", "AMBIGUOUS"};
for (int i = 0; i < 3; i++) {
char c;
cin >> c;
num[i / 2] = num[i / 2] * 10 + (c - '0');
if (i % 2) {
num[i / 2] = (num[i / 2] > 0 && num[i / 2] <= 12) ? 1 :... | #include <iostream>
using namespace std;
int main(void) {
int num[2] = {0, 0};
string mes[4] = {"NA", "MMYY", "YYMM", "AMBIGUOUS"};
for (int i = 0; i < 4; i++) {
char c;
cin >> c;
num[i / 2] = num[i / 2] * 10 + (c - '0');
if (i % 2) {
num[i / 2] = (num[i / 2] > 0 && num[i / 2] <= 12) ? 1 :... | replace | 7 | 8 | 7 | 8 | 0 | |
p03042 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod ... | #include <bits/stdc++.h>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod ... | replace | 32 | 38 | 32 | 33 | 0 | |
p03042 | C++ | Time Limit Exceeded | #include <iostream>
#include <string>
using namespace std;
int strtoint(string str) {
int res = 0;
int i = 0;
while (i < str.length() && str[i] >= '0' && str[i] <= '9') {
res *= 10;
res += str[i];
}
return res;
}
int main() {
string str;
cin >> str;
int former = strtoint(str.substr(0, 2));
... | #include <iostream>
#include <string>
using namespace std;
int strtoint(string str) {
int res = 0;
int i = 0;
while (i < str.length() && str[i] >= '0' && str[i] <= '9') {
res *= 10;
res += str[i] - 48;
i++;
}
return res;
}
int main() {
string str;
cin >> str;
int former = strtoint(str.su... | replace | 10 | 11 | 10 | 12 | TLE | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<pll> vplll;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(N... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<pll> vplll;
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// #endif
ios_base::sync_with_stdio(fal... | replace | 10 | 13 | 10 | 13 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(c) reverse((c).begin(), (c).end())
#define ALL(x) (x).begin(), (x).end()
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
int main() {
int ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(c) reverse((c).begin(), (c).end())
#define ALL(x) (x).begin(), (x).end()
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
int main() {
int ... | replace | 11 | 12 | 11 | 12 | -11 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (long long i = 0; i < (n); i++)
using ll = long long;
using vl = vector<long long>;
using P = pair<long lo... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (long long i = 0; i < (n); i++)
using ll = long long;
using vl = vector<long long>;
using P = pair<long lo... | replace | 14 | 15 | 14 | 15 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Map = map<string, ll>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
ll INF = 1LL << 60;
ll MOD = 1000000007;
ll N, K;
// dp[i]はiからコインふって勝つ確率
vector<double> dp(100005, -1);
double F(ll e) {
if (dp[e] != -1) {
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Map = map<string, ll>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
ll INF = 1LL << 60;
ll MOD = 1000000007;
ll N, K;
// dp[i]はiからコインふって勝つ確率
vector<double> dp(100005, -1);
double F(ll e) {
if (e >= 0 && e <= 1... | replace | 14 | 15 | 14 | 15 | 0 | |
p03043 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
#include <iomanip>
using namespace std;
vector<int> db;
int rec(int i, int K) {
if (db[i] != -1)
return db[i];
if (i >= K) {
db[i] = 0;
return 0;
}
db[i] = rec(i * 2, K) + 1;
return db[i];
}
int main() {
int i, N, K, a, b, c;
double ... | #include <iostream>
#include <string>
#include <vector>
#include <iomanip>
using namespace std;
vector<int> db;
int rec(int i, int K) {
if (db[i] != -1)
return db[i];
if (i >= K) {
db[i] = 0;
return 0;
}
db[i] = rec(i * 2, K) + 1;
return db[i];
}
int main() {
int i, N, K, a, b, c;
double ... | replace | 25 | 26 | 25 | 26 | 0 | |
p03043 | C++ | Runtime Error | #include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N, K;
cin >> N >> K;
double ans = 0.0;
long long cnt_abs_win = 0LL;
int mx_bunbo = 0;
vector<int> bunbo, bunsi;
for (int i = 1;... | #include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N, K;
cin >> N >> K;
double ans = 0.0;
long long cnt_abs_win = 0LL;
int mx_bunbo = 0;
vector<int> bunbo, bunsi;
for (int i = 1;... | replace | 47 | 50 | 47 | 59 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vvvi = vector<vvi>;
using ll = long long; // long longをllだけにした
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vb = vector<bool>... | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vvvi = vector<vvi>;
using ll = long long; // long longをllだけにした
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vb = vector<bool>... | replace | 280 | 281 | 280 | 281 | 0 | |
p03043 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
int cnt[200000];
for (int i = k * 2 - 1; i >= 1; i--) {
if (i % 2 == 0) {
cnt[i / 2] = cnt[i] + 1;
}
}
double p[25];
p[0] = 1.0;
for ... | #include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
int cnt[500000];
for (int i = k * 2 - 1; i >= 1; i--) {
if (i % 2 == 0) {
cnt[i / 2] = cnt[i] + 1;
}
}
double p[25];
p[0] = 1.0;
for ... | replace | 10 | 11 | 10 | 11 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
double dp[10000]; // dp[i]: 現在の得点がiのときの勝率
int main() {
int N, K;
cin >> N >> K;
for (int i = K - 1; i >= 1; i--) {
dp[i] = 0.5 * (i * 2 >= K ? 1.0 : dp[i * 2]) + 0.5 * 0;
}
double ans = 0;
for (int i = 1; i <= N; i++) {
ans += (i >= K ? 1.0 : dp[i]) / N;... | #include <bits/stdc++.h>
using namespace std;
double dp[100000]; // dp[i]: 現在の得点がiのときの勝率
int main() {
int N, K;
cin >> N >> K;
for (int i = K - 1; i >= 1; i--) {
dp[i] = 0.5 * (i * 2 >= K ? 1.0 : dp[i * 2]) + 0.5 * 0;
}
double ans = 0;
for (int i = 1; i <= N; i++) {
ans += (i >= K ? 1.0 : dp[i]) / N... | replace | 2 | 3 | 2 | 3 | 0 | |
p03043 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
#define intv vector<v>
#define llv vector<long long>
#define intvv vector<vector<int>>
#define llvv vector<vector<long long>>
using namespace s... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
#define intv vector<v>
#define llv vector<long long>
#define intvv vector<vector<int>>
#define llvv vector<vector<long long>>
using namespace s... | replace | 27 | 28 | 27 | 28 | 15 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define pi pair<ll, ll>
#define pii pair<ll, pi>
#define pb push_back
#define mk make_pair
ll binpow(ll a, ll b) {
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a;
a = a * a;
b >>= 1;
}
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define pi pair<ll, ll>
#define pii pair<ll, pi>
#define pb push_back
#define mk make_pair
ll binpow(ll a, ll b) {
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a;
a = a * a;
b >>= 1;
}
... | replace | 20 | 24 | 20 | 24 | TLE | |
p03043 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
double sum = 0;
for (int i = 0; i < N; i++) {
double kaku = 1.0 / N;
int now = i;
while (K > now) {
now *= 2;
kaku /= 2;
}
sum += kaku;
}
cout << setprecision(12) << sum << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
double sum = 0;
for (int i = 1; i <= N; i++) {
double kaku = 1.0 / N;
int now = i;
while (K > now) {
now *= 2;
kaku /= 2;
}
sum += kaku;
}
cout << setprecision(12) << sum << endl;
}
| replace | 7 | 8 | 7 | 8 | TLE | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define all(a) a.begin(), a.end()
typedef pair<int, int> pint;
typede... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define all(a) a.begin(), a.end()
typedef pair<int, int> pint;
typede... | delete | 54 | 56 | 54 | 54 | -6 | malloc(): corrupted top size
|
p03043 | Python | Time Limit Exceeded | from functools import reduce
from operator import mul
def main():
N, K = map(int, input().split())
print(
sum(
[
reduce(mul, [0.5 for j in range(K) if i << j < K], 1 / N)
for i in range(1, N + 1)
]
)
)
return
main()
| from functools import reduce
from operator import mul
def main():
N, K = map(int, input().split())
ans = []
lst = []
for i in range(1, N + 1):
lst.clear()
for j in range(K):
if K <= i << j:
break
lst.append(0.5)
ans.append(reduce(mul, lst... | replace | 6 | 14 | 6 | 16 | TLE | |
p03043 | C++ | Time Limit Exceeded | #include <stdio.h>
int main(void) {
int a, b;
scanf("%d %d", &a, &b);
double ret = 0;
for (int loop = 0; loop <= a; loop++) {
double tmp = 1.0 * a;
int now = loop;
while (now < b) {
now *= 2;
tmp /= 2;
}
ret += tmp;
}
printf("%.12f\n", ret);
return 0;
} | #include <stdio.h>
int main(void) {
int a, b;
scanf("%d %d", &a, &b);
double ret = 0;
for (int loop = 1; loop <= a; loop++) {
double tmp = 1.0 / a;
int now = loop;
while (now < b) {
now *= 2;
tmp /= 2;
}
ret += tmp;
}
printf("%.12f\n", ret);
return 0;
} | replace | 5 | 7 | 5 | 7 | TLE | |
p03043 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
long gcd(long a, long b) {
if (a < 0) {
a = -a;
}
if (b < 0) {
b = -b;
}
if (a == 0) {
return b;
}
if (b == 0) {
return a;
}
if ... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
long gcd(long a, long b) {
if (a < 0) {
a = -a;
}
if (b < 0) {
b = -b;
}
if (a == 0) {
return b;
}
if (b == 0) {
return a;
}
if ... | replace | 39 | 40 | 39 | 43 | 0 | |
p03043 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
int main() {
double n, k, ans;
cin >> n >> k;
ans ... | #include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
int main() {
double n, k, ans;
cin >> n >> k;
ans ... | replace | 16 | 17 | 16 | 17 | TLE | |
p03043 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
int main... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
int main... | replace | 25 | 26 | 25 | 30 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef pair<uint, uint> puu;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<double, double> pdd;
typedef vector<int> vi... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef pair<uint, uint> puu;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<double, double> pdd;
typedef vector<int> vi... | replace | 78 | 79 | 78 | 79 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
array<int, 17> pow2;
vector<double> ns(N);
int tmp = 1;
for (auto &x : pow2) {
x = tmp;
tmp *= 2;
}
// q(n) は サイコロの目が n-1 の確立
for (int i = 1; i <= N; ++i) {
for (int j = 0;; ++j) {
if (K <= i * po... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
array<int, 18> pow2;
vector<double> ns(N);
int tmp = 1;
for (auto &x : pow2) {
x = tmp;
tmp *= 2;
}
// q(n) は サイコロの目が n-1 の確立
for (int i = 1; i <= N; ++i) {
for (int j = 0;; ++j) {
if (K <= i * po... | replace | 7 | 8 | 7 | 8 | 0 | |
p03043 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
int main() {
ll n, k, pw = 1;
cin >> n >> k;
double p;
p = max((ll)0, n - k + 1);
for (ll i = k;... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
int main() {
ll n, k, pw = 1;
cin >> n >> k;
double p;
p = max((ll)0, n - k + 1);
for (ll i = k;... | replace | 15 | 16 | 15 | 16 | TLE | |
p03043 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int devide_by2(int i, int K) {
int count = 0;
while (i < K) {
i *= 2;
count++;
}
return count;
}
double bi(double &ans, int i, double N, int K) {
double count = 1;
for (int j = 0; j < devide_by2(i, K); j++) {
count /= 2;
}
return count * (1 / N... | #include <bits/stdc++.h>
using namespace std;
int devide_by2(int i, int K) {
i++;
int count = 0;
while (i < K) {
i *= 2;
count++;
}
return count;
}
double bi(double &ans, int i, double N, int K) {
double count = 1;
for (int j = 0; j < devide_by2(i, K); j++) {
count /= 2;
}
return count *... | insert | 4 | 4 | 4 | 5 | TLE | |
p03043 | Python | Runtime Error | import math
n, k = map(int, input().split())
# for small
score = 0
times = []
for i in range(1, min(n + 1, k)):
times.append(math.ceil(math.log2((k / i))))
bottom_max = times[0]
for t in times:
score += 2 ** (bottom_max - t)
score /= 2 ** (bottom_max) * n
# for big
big = [i for i in range(k, max(k, n + 1))]
... | import math
n, k = map(int, input().split())
# for small
score = 0
times = []
for i in range(1, min(n + 1, k)):
times.append(math.ceil(math.log2((k / i))))
if len(times):
bottom_max = times[0]
for t in times:
score += 2 ** (bottom_max - t)
score /= 2 ** (bottom_max) * n
# for big
big = [i fo... | replace | 9 | 13 | 9 | 15 | 0 | |
p03043 | Python | Runtime Error | import math
N, K = map(int, input().split())
p = 0
for i in range(1, min(K, N + 1)):
print(math.ceil(math.log2(K / i)))
p += 2 ** (-math.ceil(math.log2(K / i)))
p += max(0, N - K + 1)
print(p / N)
| import math
N, K = map(int, input().split())
p = 0
count = 1
while True:
p += (
max(0, min(N + 1, math.ceil(K / 2 ** (count - 1))) - math.ceil(K / 2**count))
* 0.5**count
)
count += 1
if K / 2**count < 0.5:
break
p += max(0, N - K + 1)
print(p / N)
| replace | 5 | 8 | 5 | 14 | 0 | |
p03043 | Python | Runtime Error | def resolve():
N, K = [int(i) for i in input().split()]
import math
ans = 0
for i in range(1, N + 1):
if i < K:
coin = math.ceil(math.log2(K / i))
ans += (1 / N) * ((1 / 2) ** coin)
else:
ans += 1 / N
print(ans)
resolve()
| n, k = map(int, input().split())
ans = 0
for i in range(1, n + 1):
tmp = 1 / n
p = i
while p < k:
p = 2 * p
tmp = tmp / 2
ans += tmp
print(ans)
| replace | 0 | 15 | 0 | 10 | 0 | |
p03043 | Python | Runtime Error | [n, m] = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
for i in range(m):
idx = a.index(max(a))
a[idx] = int(a[idx] / 2)
print(sum(a))
| [n, k] = [int(i) for i in input().split()]
total = 0
for i in range(1, n + 1):
point = i
prob = 1 / n
while point < k:
point *= 2
prob /= 2
total += prob
print(total)
| replace | 0 | 6 | 0 | 10 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03043/Python/s545196678.py", line 2, in <module>
a = [int(i) for i in input().split()]
EOFError: EOF when reading a line
|
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <class T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/// find_by_order()
/// order_of_key()
templa... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <class T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/// find_by_order()
/// order_of_key()
templa... | delete | 71 | 75 | 71 | 71 | 0 | |
p03043 | C++ | Time Limit Exceeded |
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;
// << fixed << setprecision(10) <<
int main() {
int n, k;
... |
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;
// << fixed << setprecision(10) <<
int main() {
int n, k;
... | replace | 21 | 24 | 21 | 23 | TLE | |
p03043 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int N, K;
double t[10012];
int main() {
while (cin >> N >> K) {
memset(t, 0, sizeof(t));
for (int i = K; i >= 1; i--) {
if (i >= K) {
t[i] = 1.... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int N, K;
double t[100120];
int main() {
while (cin >> N >> K) {
memset(t, 0, sizeof(t));
for (int i = K; i >= 1; i--) {
if (i >= K) {
t[i] = 1... | replace | 11 | 12 | 11 | 12 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, K;
cin >> N >> K;
double ans = 0;
/* 出目がiのとき */
for (int i = 1; i <= N; i++) {
double p = 1. / N;
int num = 0;
for (int point = i; point <= K - 1; point *= 2) {
p *= 1. / 2.;
num++;
}
ans += p;
}
assert... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, K;
cin >> N >> K;
double ans = 0;
/* 出目がiのとき */
for (int i = 1; i <= N; i++) {
double p = 1. / N;
int num = 0;
for (int point = i; point <= K - 1; point *= 2) {
p *= 1. / 2.;
num++;
}
ans += p;
}
cout <... | delete | 18 | 19 | 18 | 18 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
#define F first
#define S second
#define endl '\n'
#define MP make_pair
#define pb push_back
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> i_P;
typedef long long LL;
static const int INF = INT_MAX;
static const int MIN = INT_MIN;
static const LL L_INF = LLONG_MAX;
stati... | #include <bits/stdc++.h>
#define F first
#define S second
#define endl '\n'
#define MP make_pair
#define pb push_back
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> i_P;
typedef long long LL;
static const int INF = INT_MAX;
static const int MIN = INT_MIN;
static const LL L_INF = LLONG_MAX;
stati... | replace | 29 | 30 | 29 | 30 | 0 | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> iP;
typedef pair<P, P> PP;
static const int INF = INT_MAX;
static const LL LINF = LL... | #include <bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> iP;
typedef pair<P, P> PP;
static const int INF = INT_MAX;
static const LL LINF = LL... | insert | 39 | 39 | 39 | 41 | 0 | |
p03043 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long inf = 1000000007;
int main() {
int n, k;
cin >> n >> k;
double total = 0;
for (int i = 0; i < n; i++) {
long a = i;
double count = 1.0 / n;
while (a < k) {
a *= 2;
count = count / 2.0;
}
total += count;
}
cout << total <<... | #include <bits/stdc++.h>
using namespace std;
long inf = 1000000007;
int main() {
int n, k;
cin >> n >> k;
double total = 0;
cout << fixed << setprecision(16);
for (int i = 1; i <= n; i++) {
long a = i;
double count = 1.0 / n;
while (a < k) {
a *= 2;
count = count / 2.0;
}
to... | replace | 8 | 10 | 8 | 10 | TLE | |
p03043 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define f(i, x, n) for (int i = x; i < n; i++)
#define all(c) c.begin(), c.end()
#define deg(x) cout << x << " "
using ld = long double;
using ll = long long;
using pll = pair<ll, ll>;
using pii = ... | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define f(i, x, n) for (int i = x; i < n; i++)
#define all(c) c.begin(), c.end()
#define deg(x) cout << x << " "
using ld = long double;
using ll = long long;
using pll = pair<ll, ll>;
using pii = ... | delete | 21 | 25 | 21 | 21 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03043 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
/*long long n, k; cin >> n >> k;
double res = 0.0;
for(long long i=1; i<n+1; ++i){
double tmp = 1.0;
long long d = i;
while (d < k) d *= 2, tmp /= 2.0;
res += tmp;
}
res /= n;
cout << fixed << setprecision(10) << res << endl;*/
long long n, k;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
/*long long n, k; cin >> n >> k;
double res = 0.0;
for(long long i=1; i<n+1; ++i){
double tmp = 1.0;
long long d = i;
while (d < k) d *= 2, tmp /= 2.0;
res += tmp;
}
res /= n;
cout << fixed << setprecision(10) << res << endl;*/
long long n, k;
... | replace | 23 | 24 | 23 | 24 | TLE | |
p03043 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, k;
cin >> n >> k;
double ans = 0;
for (int i = 1; i <= n; i++) {
int tmp = i;
double count = 1.0 / n;
while (k > i) {
tmp *= 2;
count /= 2;
}
ans += count;
}
cout << setprecision(15) << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
double n, k;
cin >> n >> k;
double ans = 0;
for (int i = 1; i <= n; i++) {
int tmp = i;
double count = 1.0 / n;
while (k > tmp) {
tmp *= 2;
count /= 2;
}
ans += count;
}
cout << setprecision(15) << ans << endl;
}
| replace | 11 | 12 | 11 | 12 | TLE | |
p03044 | Python | Runtime Error | def dfs(i, d):
# print(i, d)
for j, w in node_array[i]:
if color_array[j] == -1:
color_array[j] = (d + w) % 2
dfs(j, d + w)
N = int(input())
node_array = [[] for i in range(N)]
color_array = [-1] * N
for _ in range(N - 1):
i, j, w = map(int, input().split())
node_array... | from sys import setrecursionlimit
setrecursionlimit(10**8)
def dfs(i, d):
# print(i, d)
for j, w in node_array[i]:
if color_array[j] == -1:
color_array[j] = (d + w) % 2
dfs(j, d + w)
N = int(input())
node_array = [[] for i in range(N)]
color_array = [-1] * N
for _ in range(... | insert | 0 | 0 | 0 | 5 | 0 | |
p03044 | Python | Runtime Error | class Tree:
WHITE = 0
GRAY = 1
BLACK = 2
def __init__(self, adj):
n = len(adj)
self.adj = adj
self.colors = [self.WHITE] * n
self.depths = [-1] * n
self.depth = 0
def dfs(self, u):
if self.colors[u] == self.BLACK:
return
self.col... | import sys
sys.setrecursionlimit(10**6)
class Tree:
WHITE = 0
GRAY = 1
BLACK = 2
def __init__(self, adj):
n = len(adj)
self.adj = adj
self.colors = [self.WHITE] * n
self.depths = [-1] * n
self.depth = 0
def dfs(self, u):
if self.colors[u] == self.... | insert | 0 | 0 | 0 | 5 | 0 | |
p03044 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
vector<int> dir;
void dfs(const Graph &G, int v, int p, int cur) {
dir[v] = cur;
for (auto e : G[v]) {
if (e.first == p)
continue; // e.first(nv)が親pだったらダメ
if (e.second % 2)
... | #include <iostream>
#include <vector>
using namespace std;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
vector<int> dir;
void dfs(const Graph &G, int v, int p, int cur) {
dir[v] = cur;
for (auto e : G[v]) {
if (e.first == p)
continue; // e.first(nv)が親pだったらダメ
if (e.second % 2)
... | insert | 29 | 29 | 29 | 30 | -11 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
vector<vector<int>> vec(100001, vector<int>());
vector<bool> ans(100001, true);
vector<bool> used(100001, false);
void func(int idx) {
used[idx] = true;
// cout << "idx : " << idx << endl;
for (int i = 0; i < vec[idx].size(); i += 2) {
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
vector<vector<int>> vec(100001, vector<int>());
vector<bool> ans(100001, true);
vector<bool> used(100001, false);
void func(int idx) {
used[idx] = true;
// cout << "idx : " << idx << endl;
for (int i = 0; i < vec[idx].size(); i += 2) {
... | replace | 22 | 23 | 22 | 23 | 0 | |
p03044 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<vector<int>> to(N);
vector<vector<int>> cost(N);
for (int i = 1; i < N; i++) {
int a, b, w;
cin >> a >> b >> w;
to[a].push_back(b);
cost[a].push_back(w);
... | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<vector<int>> to(N);
vector<vector<int>> cost(N);
for (int i = 1; i < N; i++) {
int a, b, w;
cin >> a >> b >> w;
a--;
b--;
to[a].push_back(b);
cost[a].... | insert | 15 | 15 | 15 | 17 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03044 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int n;
vector<vector<int>> to(n + 100);
vector<vector<int>> cost(n + 100);
int main() {
/* 入力受け取り */
cin >> n;
for (int i = 0; i < n - 1; ++i) {
int a, b, w;
cin >> a >> b >> w;
a--;
b--;
to[a].push_back(b);
to[b]... | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int n;
vector<vector<int>> to(n + 1000000);
vector<vector<int>> cost(n + 1000000);
int main() {
/* 入力受け取り */
cin >> n;
for (int i = 0; i < n - 1; ++i) {
int a, b, w;
cin >> a >> b >> w;
a--;
b--;
to[a].push_back(b);
... | replace | 5 | 7 | 5 | 7 | 0 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
... | replace | 57 | 59 | 57 | 59 | -11 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using multiInt = boost::multiprecision::cpp_int;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp... | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using multiInt = boost::multiprecision::cpp_int;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp... | replace | 58 | 59 | 58 | 59 | 0 | |
p03044 | Python | Time Limit Exceeded | N = int(input())
node_array = [list(map(int, input().split())) for i in range(N - 1)]
# print(node_array)
tree_num_array = [-1] * N
# print(tree_num_array)
tree_num_max = -1
tree = {}
last_tree_num = -1
for node in node_array:
# print(tree)
i, j, w = node
i = i - 1
j = j - 1
if tree_num_array[i] ==... | N = int(input())
node_array = [list(map(int, input().split())) for i in range(N - 1)]
# print(node_array)
tree_num_array = [-1] * N
# print(tree_num_array)
tree_num_max = -1
tree = {}
last_tree_num = -1
for node in node_array:
# print(tree)
i, j, w = node
i = i - 1
j = j - 1
if tree_num_array[i] ==... | replace | 35 | 44 | 35 | 53 | TLE | |
p03044 | C++ | Runtime Error | #include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
type... | #include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
type... | replace | 28 | 29 | 28 | 29 | 0 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int col[100000];
struct edge {
int to;
ll w;
};
vector<edge> G[100000];
void dfs(int u, bool c) {
col[u] = c;
for (int i = 0; i < G[u].size(); i++) {
if (col[G[u][i].to] != -1)
continue;
ll dif;
dif = G[u][i].w;
if (... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int col[100000];
struct edge {
int to;
ll w;
};
vector<edge> G[100000];
void dfs(int u, bool c) {
col[u] = c;
for (int i = 0; i < G[u].size(); i++) {
if (col[G[u][i].to] != -1)
continue;
ll dif;
dif = G[u][i].w;
if (... | replace | 33 | 34 | 33 | 34 | 0 | |
p03044 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
using int_t = int64_t;
struct edge_t {
int_t to, len;
edge_t(int_t t, int_t l) : to(t), len(l) {}
};
void dfs(const vector<vector<edge_t>> &E, vector<int> &color, int s, int c) {
color[s] = c;
for (auto &next : E[s]) {
if (color[next.to] != -1)
... | #include <iostream>
#include <vector>
using namespace std;
using int_t = int64_t;
struct edge_t {
int_t to, len;
edge_t(int_t t, int_t l) : to(t), len(l) {}
};
void dfs(const vector<vector<edge_t>> &E, vector<int> &color, int s, int c) {
color[s] = c;
for (auto &next : E[s]) {
if (color[next.to] != -1)
... | replace | 26 | 27 | 26 | 27 | 0 | |
p03044 | C++ | Runtime Error | // D - Even Relation
#include <bits/stdc++.h>
using namespace std;
void dfs(const vector<vector<pair<int, int>>> &g, int u, int c, vector<int> &a,
vector<int> &vi) {
if (vi[u])
return;
vi[u] = 1;
a[u] = c;
for (int i = 0; i < g[u].size(); i++) {
int v = g[u][i].first;
if (!vi[v])
df... | // D - Even Relation
#include <bits/stdc++.h>
using namespace std;
void dfs(const vector<vector<pair<int, int>>> &g, int u, int c, vector<int> &a,
vector<int> &vi) {
if (vi[u])
return;
vi[u] = 1;
a[u] = c;
for (int i = 0; i < g[u].size(); i++) {
int v = g[u][i].first;
if (!vi[v])
df... | replace | 22 | 23 | 22 | 23 | 0 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define N 10010
#define ll long long
const ll mod = 1e9 + 7;
struct node {
int v, w;
};
vector<node> g[N];
int vis[N];
void dfs(int x) {
int sz = g[x].size();
for (int i = 0; i < sz; i++) {
int v = g[x][i].v, w = g[x][i].w;
if (vis[v] != -1)
continue;
... | #include <bits/stdc++.h>
using namespace std;
#define N 100010
#define ll long long
const ll mod = 1e9 + 7;
struct node {
int v, w;
};
vector<node> g[N];
int vis[N];
void dfs(int x) {
int sz = g[x].size();
for (int i = 0; i < sz; i++) {
int v = g[x][i].v, w = g[x][i].w;
if (vis[v] != -1)
continue;
... | replace | 2 | 3 | 2 | 3 | 0 | |
p03044 | C++ | Runtime Error | #include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
// vector<pair<int, int> > G[10001];
map<int, vector<pair<int, int>>> G;
for (int i = 0; i < N - 1; i++) {
int u, v, w;
cin >> u >> v >> w;
u--;
v--;
w %= 2;
G[u].pu... | #include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
// vector<pair<int, int> > G[10001];
map<int, vector<pair<int, int>>> G;
for (int i = 0; i < N - 1; i++) {
int u, v, w;
cin >> u >> v >> w;
u--;
v--;
w %= 2;
G[u].pu... | replace | 21 | 23 | 21 | 23 | 0 | |
p03044 | Python | Runtime Error | def dfs(u):
for v, w in edge[u]:
if trail[v] is None:
trail[v] = (trail[u] + w) % 2
dfs(v)
N = int(input())
trail = [None] * N
edge = [[] for _ in range(N)]
for i in range(N - 1):
u, v, w = map(int, input().split())
u -= 1
v -= 1
w %= 2
edge[u].append((v, w))
... | import sys
sys.setrecursionlimit(10**6)
def dfs(u):
for v, w in edge[u]:
if trail[v] is None:
trail[v] = (trail[u] + w) % 2
dfs(v)
N = int(input())
trail = [None] * N
edge = [[] for _ in range(N)]
for i in range(N - 1):
u, v, w = map(int, input().split())
u -= 1
v -... | insert | 0 | 0 | 0 | 5 | 0 | |
p03044 | Python | Runtime Error | import sys
from io import StringIO
import unittest
import os
sys.setrecursionlimit(9999999999)
def dfs(now, edge, colors):
# 枝を全て調査
for i in edge[now]:
# 色を設定済みなら何もしない
if not colors[i[0]] == -1:
continue
# 色の設定
# 親子の距離%2(偶数0:奇数:1) + 親(偶数0:奇数:1) の余りを子に設定(偶数なら0 奇数なら... | import sys
from io import StringIO
import unittest
import os
sys.setrecursionlimit(999999999)
def dfs(now, edge, colors):
# 枝を全て調査
for i in edge[now]:
# 色を設定済みなら何もしない
if not colors[i[0]] == -1:
continue
# 色の設定
# 親子の距離%2(偶数0:奇数:1) + 親(偶数0:奇数:1) の余りを子に設定(偶数なら0 奇数なら1... | replace | 5 | 6 | 5 | 6 | OverflowError: Python int too large to convert to C int | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03044/Python/s708960220.py", line 6, in <module>
sys.setrecursionlimit(9999999999)
OverflowError: Python int too large to convert to C int
|
p03044 | Python | Runtime Error | def rec(edges, nodes, cp, cdistance, visited):
if not visited[cp]:
visited[cp] = True
nodes[cp] = cdistance % 2 == 0
if edges[cp]:
for v, w in edges[cp]:
rec(edges, nodes, v, cdistance + w, visited)
def main():
N = int(input())
nodes = [False] * N
vi... | import sys
sys.setrecursionlimit(10**9)
def rec(edges, nodes, cp, cdistance, visited):
if not visited[cp]:
visited[cp] = True
nodes[cp] = cdistance % 2 == 0
if edges[cp]:
for v, w in edges[cp]:
rec(edges, nodes, v, cdistance + w, visited)
def main():
N = ... | insert | 0 | 0 | 0 | 5 | 0 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long lld;
vector<pair<lld, lld>> G[55555];
lld dis[555555];
void dfs(lld u, lld par = -1) {
for (lld i = 0; i < G[u].size(); i++) {
lld to = G[u][i].first;
lld w = G[u][i].second;
if (to != par) {
dis[to] += dis[u] + w;
dfs(to, u);
... | #include <bits/stdc++.h>
using namespace std;
typedef long long lld;
vector<pair<lld, lld>> G[555555];
lld dis[555555];
void dfs(lld u, lld par = -1) {
for (lld i = 0; i < G[u].size(); i++) {
lld to = G[u][i].first;
lld w = G[u][i].second;
if (to != par) {
dis[to] += dis[u] + w;
dfs(to, u);
... | replace | 3 | 4 | 3 | 4 | 0 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
typedef long long ll;
struct edge {
ll v, w;
};
int main() {
ll n;
cin >> n;
vector<vector<edge>> adj(n);
ll a, b, c;
rep(i, n) {
cin >> a >> b >> c;
a--, b--;
... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
typedef long long ll;
struct edge {
ll v, w;
};
int main() {
ll n;
cin >> n;
vector<vector<edge>> adj(n);
ll a, b, c;
rep(i, n - 1) {
cin >> a >> b >> c;
a--, b--;... | replace | 15 | 16 | 15 | 16 | 0 | |
p03044 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <... | replace | 29 | 30 | 29 | 30 | 0 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
const int MOD = 1000000007;
const int INF = 1000000000;
using namespace std;
typedef long long ll;
typedef tuple<ll, int, int> tup;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vp;
bool visited[100005];
vp g[100005];
int colors[10000... | #include <bits/stdc++.h>
const int MOD = 1000000007;
const int INF = 1000000000;
using namespace std;
typedef long long ll;
typedef tuple<ll, int, int> tup;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vp;
bool visited[100005];
vp g[100005];
int colors[10000... | replace | 42 | 43 | 42 | 43 | 0 | |
p03044 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FOR(i, k, n) for (int i = (k); i < (n); i++)
#define FORe(i, k, n) for (int i = (k); i <= (n); i++)
#define FORr(i, k, n) for (int i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for (int i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ... | #include <bits/stdc++.h>
#define FOR(i, k, n) for (int i = (k); i < (n); i++)
#define FORe(i, k, n) for (int i = (k); i <= (n); i++)
#define FORr(i, k, n) for (int i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for (int i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ... | replace | 19 | 20 | 19 | 20 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.