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
p00654
C++
Time Limit Exceeded
// 25 #include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { for (int n; cin >> n, n;) { int b[90000]; for (int i = 0; i < n * (n + 1) / 2; i++) { cin >> b[i]; } int a = sqrt(double(b[0]) * b[1] / b[n]) + .5; cout << a << endl; int c[250]; for (...
// 25 #include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { for (int n; cin >> n, n;) { long long b[90000]; for (int i = 0; i < n * (n + 1) / 2; i++) { cin >> b[i]; } int a = sqrt(double(b[0]) * b[1] / b[n]) + .5; cout << a << endl; int c[250]; ...
replace
9
10
9
10
TLE
p00654
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; long long gcd(unsigned long long int x, unsigned long long int y) { return y == 0 ? x : gcd(y, x % y); } void solve() { int n; while (cin >> n, n) { int size = (n + 1) * n / 2; vector<unsigned long long int...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; long long gcd(unsigned long long int x, unsigned long long int y) { return y == 0 ? x : gcd(y, x % y); } void solve() { int n; while (cin >> n, n) { int size = (n + 1) * n / 2; vector<unsigned long long int...
replace
18
19
18
19
0
p00654
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; long long fn(long long p, long long q) { long long s; while (q) { p %= q; s = p; p = q; q = s; } return p; } int main() { int i, j, k; int n; while (cin >>...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; long long fn(long long p, long long q) { long long s; while (q) { p %= q; s = p; p = q; q = s; } return p; } int main() { int i, j, k; int n; while (cin >>...
replace
37
42
37
39
0
p00654
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> using namespace std; long long a[100000]; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } int cmp(const long long &a, const long long &b) { if (a % 2 == 0 && b % 2 == 1) return 1; else if (a % 2 == 1 && b % 2 == 0) return 0; ...
#include <algorithm> #include <cmath> #include <cstdio> using namespace std; long long a[100000]; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } int cmp(const long long &a, const long long &b) { if (a % 2 == 0 && b % 2 == 1) return 1; else if (a % 2 == 1 && b % 2 == 0) return 0; ...
replace
37
38
37
38
-8
p00657
C++
Time Limit Exceeded
#include <iostream> using namespace std; int r, c; int main() { while (true) { cin >> r >> c; if (r % 2 == 1 && c % 2 == 1) { cout << "no" << endl; } else { cout << "yes" << endl; } } return 0; }
#include <iostream> using namespace std; int r, c; int main() { while (true) { cin >> r >> c; if (r == 0 && c == 0) { break; } if (r % 2 == 1 && c % 2 == 1) { cout << "no" << endl; } else { cout << "yes" << endl; } } return 0; }
insert
6
6
6
9
TLE
p00660
C++
Runtime Error
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class t> using table = vector<vector<t>>; const ld eps = 1e-9; //// < "d:\d_download\visual studio ///2015\projects\programing_contest_c++\debug\a.txt" > "d:...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class t> using table = vector<vector<t>>; const ld eps = 1e-9; //// < "d:\d_download\visual studio ///2015\projects\programing_contest_c++\debug\a.txt" > "d:...
insert
119
119
119
121
-6
104b06d8-1ed8-4e5f-9b06-cc097e0c4349.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00660/C++/s127471588.cpp:127: int getnum(std::vector<std::vector<int> >, int): Assertion `false' failed.
p00662
C++
Time Limit Exceeded
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; //// < "d:\d_download\visual studio ///2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual ///studio 2015\projects\programin...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; //// < "d:\d_download\visual studio ///2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual ///studio 2015\projects\programin...
replace
21
22
21
22
TLE
p00662
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f, a || b || c || d || e || f) { a += d; b += e; c += f; int Max = 0; for (int i = 0; i <= min(a, min(b, c)); i++) Max = ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f, a || b || c || d || e || f) { a += d; b += e; c += f; int Max = 0; for (int i = 0; i <= min(2, min(a, min(b, c))); i++) ...
replace
11
12
11
12
TLE
p00662
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, s, e) for (int i = (int)s; i < (int)e; i++) #define rep(i, n) REP(i, 0, n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fi first #define se second #define pb push_back #define mp nake_pair typedef long long ll; ty...
#include <bits/stdc++.h> using namespace std; #define REP(i, s, e) for (int i = (int)s; i < (int)e; i++) #define rep(i, n) REP(i, 0, n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fi first #define se second #define pb push_back #define mp nake_pair typedef long long ll; ty...
replace
34
35
34
35
TLE
p00662
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int A, B, C; int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f && (a || b || c || d || e || f)) { A = a + d; B = b + e; C = c + f; // cout<< A << " "<< B << " " << C << endl; int n = min(A, min(B, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int A, B, C; int main() { int a, b, c, d, e, f; while (cin >> a >> b >> c >> d >> e >> f && (a || b || c || d || e || f)) { A = a + d; B = b + e; C = c + f; // cout<< A << " "<< B << " " << C << endl; int n = min(A, min(B, ...
replace
16
17
16
17
TLE
p00662
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <vector> #define MOD 1000000007 #define INTMAX 0x7fffffff #define INTMIN 0x80000000 #define LLMAX 0x7fffffffffffffffLL #define LLMIN 0x8000000000000000LL #define REP(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) REP(i, 0, n) using namespac...
#include <algorithm> #include <iomanip> #include <iostream> #include <vector> #define MOD 1000000007 #define INTMAX 0x7fffffff #define INTMIN 0x80000000 #define LLMAX 0x7fffffffffffffffLL #define LLMIN 0x8000000000000000LL #define REP(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) REP(i, 0, n) using namespac...
replace
30
31
30
31
TLE
p00662
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #incl...
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #incl...
replace
40
41
40
42
TLE
p00662
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int a, b, c, d, e, f, sum1, sum2, sum3, sum, p; int main() { while (true) { sum = 0; cin >> a >> b >> c >> d >> e >> f; if (a + b + c + d + e + f == 0) { break; } sum1 = a + d; sum2 = b + e; sum3 = c + f; p = 0; p ...
#include <algorithm> #include <iostream> using namespace std; int a, b, c, d, e, f, sum1, sum2, sum3, sum, p; int main() { while (true) { sum = 0; cin >> a >> b >> c >> d >> e >> f; if (a + b + c + d + e + f == 0) { break; } sum1 = a + d; sum2 = b + e; sum3 = c + f; p = 0; p ...
replace
17
18
17
18
TLE
p00663
C++
Runtime Error
// Name: SAT-EN-3 // Level: 3 // Category: 構文解析 // Note: /** * 加法標準形なので、X&~Xの形を含まない項があればその項は真にでき、全体も真になる。 * * オーダーは O(|S|)。 */ #include <cassert> #include <iostream> #include <map> #include <string> using namespace std; pair<char, bool> literal(const string &str, int &pos) { pair<char, bool> res('\0', false); ...
// Name: SAT-EN-3 // Level: 3 // Category: 構文解析 // Note: /** * 加法標準形なので、X&~Xの形を含まない項があればその項は真にでき、全体も真になる。 * * オーダーは O(|S|)。 */ #include <cassert> #include <iostream> #include <map> #include <string> using namespace std; pair<char, bool> literal(const string &str, int &pos) { pair<char, bool> res('\0', false); ...
insert
30
30
30
32
0
p00664
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) ...
replace
41
42
41
42
0
p00664
C++
Runtime Error
#include <bits/stdc++.h> #define N 50001 using namespace std; typedef long long ll; int main() { while (1) { ll r, c, q; cin >> r >> c >> q; if (!r && !c && !q) return 0; ll A[N], B[N], O[N]; for (int i = 0; i < q; i++) cin >> A[i] >> B[i] >> O[i]; ll ans = 0, cnt[2] = {}, rc[] ...
#include <bits/stdc++.h> #define N 50001 using namespace std; typedef long long ll; int main() { while (1) { ll r, c, q; cin >> r >> c >> q; if (!r && !c && !q) return 0; ll A[N], B[N], O[N]; for (int i = 0; i < q; i++) cin >> A[i] >> B[i] >> O[i]; ll ans = 0, cnt[2] = {}, rc[] ...
replace
22
24
22
23
0
p00666
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace ...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace ...
replace
61
62
61
64
TLE
p00667
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <sstream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define fr(i, c) for (__typeof(c.begin()) i = c.begin(); i != c.end(); i...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <sstream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define fr(i, c) for (__typeof(c.begin()) i = c.begin(); i != c.end(); i...
delete
51
54
51
51
TLE
p00668
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define f first #define s second #define mp make...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define f first #define s second #define mp make...
replace
50
51
50
51
0
p00668
C++
Time Limit Exceeded
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = double; const ld eps = 1e-9; // // using Graph = vector<vector<int>>; // // int dfs(const Graph&g, const int now, vector<int>&ch_cnts) { // ch_cnts[now]++; // for (auto&& e : g[no...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = double; const ld eps = 1e-9; // // using Graph = vector<vector<int>>; // // int dfs(const Graph&g, const int now, vector<int>&ch_cnts) { // ch_cnts[now]++; // for (auto&& e : g[no...
insert
149
149
149
151
TLE
p00668
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define reg(i, a, b) for (int i = (a); i <= (b); i++) #define irep(i, n) for (int i = ((i...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define reg(i, a, b) for (int i = (a); i <= (b); i++) #define irep(i, n) for (int i = ((i...
replace
25
26
25
26
0
p00668
C++
Time Limit Exceeded
#include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> using namespace std; int q, lim; // セグ木 int dat[1 << 20 + 2]; // リーフ(一番下の葉)の最小 int low = 1 << 19 + 1; // dat配列はどこまで埋まっているか int size; // 固体番号 int rnum[500000]; // 固体番号を円環するときに利用 map<int, int> num; void add(int x) { // 固体番号(円環)追加...
#include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> using namespace std; int q, lim; // セグ木 int dat[1 << 20 + 2]; // リーフ(一番下の葉)の最小 int low = 1 << 19 + 1; // dat配列はどこまで埋まっているか int size; // 固体番号 int rnum[500000]; // 固体番号を円環するときに利用 map<int, int> num; void add(int x) { // 固体番号(円環)追加...
replace
68
69
68
71
TLE
p00670
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #includ...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #includ...
replace
60
61
60
61
TLE
p00670
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, s; int r[20000]; while (cin >> n >> s, n || s) { for (int i = 0; i < n; i++) { cin >> r[i]; } int cnt = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (r[i] + r[j] > s) { cnt++; ...
#include <iostream> using namespace std; int main() { int n, s; int r[20000]; while (cin >> n >> s, n || s) { for (int i = 0; i < n; i++) { cin >> r[i]; } int cnt = 0; for (int i = 0; i < n; i++) { if (r[i] > s) { cnt += n - i - 1; } else { for (int j = i + 1; ...
replace
14
17
14
21
TLE
p00670
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <ut...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <ut...
replace
42
43
42
43
TLE
p00672
C++
Time Limit Exceeded
#include <algorithm> #include <assert.h> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; static const dou...
#include <algorithm> #include <assert.h> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; static const dou...
replace
117
119
117
119
TLE
p00673
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 28; struct Primal_Dual { typedef pair<int, int> Pi; struct edge { int to, cap, cost, rev; }; vector<vector<edge>> graph; vector<int> potential, min_cost, prevv, preve; Primal_Dual(int V) : graph(V) {} void add_edge(int from, int t...
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 28; struct Primal_Dual { typedef pair<int, int> Pi; struct edge { int to, cap, cost, rev; }; vector<vector<edge>> graph; vector<int> potential, min_cost, prevv, preve; Primal_Dual(int V) : graph(V) {} void add_edge(int from, int t...
replace
138
139
138
139
-11
p00674
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<bool> vb; typedef vector<double> vd; typedef vector<vd> vvd; #define REP(i, n) for (ll i = 0; i < (n); ++i) #define ALL(c) (c).begin(), (c).end() #define FOR(i, s, e...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<bool> vb; typedef vector<double> vd; typedef vector<vd> vvd; #define REP(i, n) for (ll i = 0; i < (n); ++i) #define ALL(c) (c).begin(), (c).end() #define FOR(i, s, e...
replace
152
153
152
153
TLE
p00675
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <algorithm> #include <cassert> #include <deque> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define FOREACH(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end();...
// #define _GLIBCXX_DEBUG #include <algorithm> #include <cassert> #include <deque> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define FOREACH(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end...
replace
0
1
0
1
TLE
p00676
C++
Runtime Error
#include <algorithm> #include <cfloat> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std...
#include <algorithm> #include <cfloat> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std...
replace
32
33
32
33
-11
p00676
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #inc...
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #inc...
replace
41
42
41
42
TLE
p00676
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { double a, l, x; while (~scanf("%lf%lf%lf", &a, &l, &x), a) { double s1 = (a + l + l) / 2, s2 = (l + l + x) / 2; double d = (l + x) / 2; printf("%.10lf\n", sqrt(s1 * (s1 - a) * (s1 - l) * (s1 - l)) +...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { double a, l, x; while (~scanf("%lf%lf%lf", &a, &l, &x)) { double s1 = (a + l + l) / 2, s2 = (l + l + x) / 2; double d = (l + x) / 2; printf("%.10lf\n", sqrt(s1 * (s1 - a) * (s1 - l) * (s1 - l)) + ...
replace
6
7
6
7
TLE
p00676
C++
Runtime Error
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int a, l, x, i = 0; double M[1000], c, d, e, f; while (scanf("%d%d%d", &a, &l, &x) != EOF) { c = (double)((2 * x * l) + (x * x)) / 4; e = l * l - (double)(a * a) / 4; d = sqrt(c); f = sqrt(e); M[i] = ((...
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int a, l, x, i = 0; double M[100000], c, d, e, f; while (scanf("%d%d%d", &a, &l, &x) != EOF) { c = (double)((2 * x * l) + (x * x)) / 4; e = l * l - (double)(a * a) / 4; d = sqrt(c); f = sqrt(e); M[i] = ...
replace
7
8
7
8
0
p00677
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; void knapsack(int yosan, const vector<pair<int, int>> &a) { int n = a.size(); int dp[101] = {}; rep(i, n) { int value = a[i].first, price = a[i].second; for (int j = yosan; j >=...
#include <algorithm> #include <cstdio> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; void knapsack(int yosan, const vector<pair<int, int>> &a) { int n = a.size(); int dp[301] = {}; rep(i, n) { int value = a[i].first, price = a[i].second; for (int j = yosan; j >=...
replace
10
11
10
11
0
p00678
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; double EPS = 1e-10; double add(double a, double b) { if (abs(a + b) < EPS * (abs(a) + abs(b))) return 0; return a + b; } struct point { double x, y; point() {} point(double x, double y) :...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; double EPS = 1e-10; double add(double a, double b) { if (abs(a + b) < EPS * (abs(a) + abs(b))) return 0; return a + b; } struct point { double x, y; point() {} point(double x, double y) :...
replace
45
46
45
46
TLE
p00680
C++
Time Limit Exceeded
#include <algorithm> #include <queue> #include <stdio.h> #include <string.h> #include <vector> using namespace std; namespace MCF { // required <string.h> <vector> <queue> <algorithm> #define MAXN 110 #define MAXM 30000 #define wint int #define cint long double const wint wEPS = 0; const wint wINF = 1001001001; const c...
#include <algorithm> #include <queue> #include <stdio.h> #include <string.h> #include <vector> using namespace std; namespace MCF { // required <string.h> <vector> <queue> <algorithm> #define MAXN 110 #define MAXM 30000 #define wint int #define cint long double const wint wEPS = 0; const wint wINF = 1001001001; const c...
replace
73
74
73
74
TLE
p00680
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define MAX_V 300 #define INF 1e9 const double EPS = 1e-8; typedef vector<double> vec; typedef vector<vec> mat; typedef pair<double, int> P; struct edge { int to, cap, rev; double cost; edge(int to, int cap, int rev, double cost) : to(to), cap(cap), rev(rev),...
#include <bits/stdc++.h> using namespace std; #define MAX_V 300 #define INF 1e9 const double EPS = 1e-8; typedef vector<double> vec; typedef vector<vec> mat; typedef pair<double, int> P; struct edge { int to, cap, rev; double cost; edge(int to, int cap, int rev, double cost) : to(to), cap(cap), rev(rev),...
replace
45
46
45
46
TLE
p00686
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { int w, h; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; while (true) { cin >> w >> h; if (w == 0 && h == 0) break; string a; int s = 0; int x = 1, y = 1, z; while (true) { cin >> a; if (a == "STOP...
#include <iostream> #include <string> using namespace std; int main() { int w, h; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; while (true) { cin >> w >> h; if (w == 0 && h == 0) break; string a; int s = 0; int x = 1, y = 1, z; while (true) { cin >> a; if (a == "STOP...
delete
48
51
48
48
TLE
p00687
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> #define loop(n, i) for (int i = 0; i < n; i++) #define loop_from_to(from, to, i) for (int i = from; i <= to; i++) #define repeat(n) for (int i__ = 0; i__ < n; i__++) #define multi_cin(n, array) \ loop(n, i) ...
#include <algorithm> #include <iostream> #include <vector> #define loop(n, i) for (int i = 0; i < n; i++) #define loop_from_to(from, to, i) for (int i = from; i <= to; i++) #define repeat(n) for (int i__ = 0; i__ < n; i__++) #define multi_cin(n, array) \ loop(n, i) ...
replace
31
33
31
35
0
p00687
C++
Time Limit Exceeded
#include <cstdio> #include <cstring> using namespace std; char c[1000001] = {0}; int main() { for (;;) { int n, a, b; scanf("%d %d %d", &n, &a, &b); if (n == 0 && a == 0 && b == 0) break; memset(c, 0, sizeof(c)); for (int i = 0; a * i <= n; ++i) { for (int j = 0; a * i + b * j <= ...
#include <cstdio> #include <cstring> using namespace std; char c[1000001] = {0}; int main() { for (;;) { int n, a, b; scanf("%d %d %d", &n, &a, &b); if (n == 0 && a == 0 && b == 0) break; memset(c, 0, sizeof(c)); c[0] = 1; for (int i = 0; i <= n; ++i) { if (c[i] == 1) { ...
replace
16
20
16
23
TLE
p00687
C++
Runtime Error
// AOJ 1105 #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef vector<int> Seq; const int NMAX = 1000100; int solve(int a, int b, int n) { bool countable[NMAX]; REP(i, n + 1) { countable[i] = false; } countable[0] = true; int unables = 0; ...
// AOJ 1105 #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef vector<int> Seq; const int NMAX = 2000100; int solve(int a, int b, int n) { bool countable[NMAX]; REP(i, n + 1) { countable[i] = false; } countable[0] = true; int unables = 0; ...
replace
8
9
8
9
0
p00687
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int n, a, b; bool t[1000001]; while (cin >> n >> a >> b && (n + a + b)) { fill(t, t + 1000001, false); t[0] = true; for (int i = 0; i <= n; i++) { if (t[i]) { t[i + a] = t[i + b] = true; } } a = 0;...
#include <algorithm> #include <iostream> using namespace std; int main() { int n, a, b; bool t[1000001]; while (cin >> n >> a >> b && (n + a + b)) { fill(t, t + 1000001, false); t[0] = true; for (int i = 0; i <= n; i++) { if (t[i]) { if (i + a <= n) { t[i + a] = true; ...
replace
13
14
13
19
0
p00687
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define MAX_N 100010 #define mp make_pair #define pb push_back #define fi first #define se second #defin...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define MAX_N 1000010 #define mp make_pair #define pb push_back #define fi first #define se second #defi...
replace
12
13
12
13
0
p00687
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; bool ok(int n, int a, int b) { for (int i = 0; i <= n; i += a) { if ((n - i) % b == 0) return true; } return false; } int main() { int n, a, b; while (cin >> n >> a >> b, n | a | b) { int ans = 0; for (int i = 1; i <= n; i++) ...
#include <algorithm> #include <iostream> using namespace std; bool ok(int n, int a, int b) { if (a < b) swap(a, b); for (int i = 0; i <= n; i += a) { if ((n - i) % b == 0) return true; } return false; } int main() { int n, a, b; while (cin >> n >> a >> b, n | a | b) { int ans = 0; ...
insert
6
6
6
8
TLE
p00687
C++
Time Limit Exceeded
// 05 #include <algorithm> #include <iostream> using namespace std; int main() { for (int n, a, b; cin >> n >> a >> b, n | a | b;) { static bool ap[1000001]; fill(ap, ap + 1000001, false); for (int i = 0; i * a <= n; i++) { for (int j = 0; j * b + i * a <= n; j++) { ap[i * a + j * b] = tru...
// 05 #include <algorithm> #include <iostream> using namespace std; int main() { for (int n, a, b; cin >> n >> a >> b, n | a | b;) { static bool ap[1000001]; fill(ap, ap + 1000001, false); ap[0] = true; for (int i = a; i <= n; i++) { ap[i] = ap[i - a]; } for (int i = b; i <= n; i++) { ...
replace
10
14
10
16
TLE
p00687
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, j) REP((i), 0, (j)) #define REP(i, j, k) for (int i = (j); (i) < (k)...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, j) REP((i), 0, (j)) #define REP(i, j, k) for (int i = (j); (i) < (k)...
replace
25
26
25
26
0
p00688
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string...
#include <algorithm> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string...
replace
29
40
29
44
TLE
p00689
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <iostream> #include <map> #include <vector> using namespace std; #define dump(a) (cerr << #a << " = " << (a) << endl) constexpr double EPS = 1e-9; struct point { double x, y; point(double x_ = 0.0, double y_ = 0....
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <iostream> #include <map> #include <vector> using namespace std; #define dump(a) (cerr << #a << " = " << (a) << endl) constexpr double EPS = 1e-9; struct point { double x, y; point(double x_ = 0.0, double y_ = 0....
replace
59
60
59
60
0
p00691
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int main() { int z; while (cin >> z, z) { int max_xy = 0; int z3 = z * z * z; for (int x = 1; x <= z3; ++x) { for (int y = x; y <= z3; ++y) { if (x * x * x + y * y * y <= z3) max_xy = max(max_xy, x * x * x + y * y ...
#include <algorithm> #include <iostream> using namespace std; int main() { int z; while (cin >> z, z) { int max_xy = 0; int z3 = z * z * z; for (int x = 1; x * x * x <= z3; ++x) { int x3 = x * x * x; for (int y = 1; y * y * y <= z3 - x3; ++y) max_xy = max(max_xy, x3 + y * y * y);...
replace
12
19
12
16
TLE
p00691
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { long long int n; while (cin >> n, n) { long long int ans = 100000; for (long long int i = 1; pow(i, 3) <= pow(n, 3); i++) { for (long long int j = 1; pow(i, 3) + pow(j, 3) <= pow(n, 3); j++) { long lon...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { long long int n; while (cin >> n, n) { long long int ans = 100000; for (long long int i = 1; i * i * i <= n * n * n; i++) { for (long long int j = 1; i * i * i + j * j * j <= n * n * n; j++) { ans = mi...
replace
9
13
9
12
TLE
p00692
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> #include <queue> #include <set> using namespace std; const int H = 5, W = 4; /* inline int countZero(const string &str) { int ret = 0; for(int i=0; i<H*W; i++) { ret += str[i] == '0'; } return ret; } void rearrange(string &str) { int pos = 0; for(int i=0; i<H...
#include <algorithm> #include <iostream> #include <queue> #include <set> using namespace std; const int H = 5, W = 4; /* inline int countZero(const string &str) { int ret = 0; for(int i=0; i<H*W; i++) { ret += str[i] == '0'; } return ret; } void rearrange(string &str) { int pos = 0; for(int i=0; i<H...
replace
86
87
86
87
MLE
p00693
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; bool match(string s, string t) { for (int i = 0; i < 8; i++) { if (s[i] != '?' && s[i] != t[i]) return false; } return true; } int n, m; bool x[1111]; string r1[1111], r2[1111], a, b, c; int main() { while (cin >> n >> m, n |...
#include <iostream> #include <string> #include <vector> using namespace std; bool match(string s, string t) { for (int i = 0; i < 8; i++) { if (s[i] != '?' && s[i] != t[i]) return false; } return true; } int n, m; bool x[1111]; string r1[1111], r2[1111], a, b, c; int main() { while (cin >> n >> m, n |...
replace
28
29
28
29
-11
p00693
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; int n, m; string S0[1000], S1[1000], S2[1000], T0[1000], T1[1000], T2[1000]; bool solve(string p1, string p2) { for (int i = 0; i < p1.size(); i++) { if (p1[i] != '?' && p1[i] != p2[i]) return false; } return true; } int main()...
#include <iostream> #include <string> #include <vector> using namespace std; int n, m; string S0[5000], S1[5000], S2[5000], T0[5000], T1[5000], T2[5000]; bool solve(string p1, string p2) { for (int i = 0; i < p1.size(); i++) { if (p1[i] != '?' && p1[i] != p2[i]) return false; } return true; } int main()...
replace
5
6
5
6
0
p00697
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; char s[9][5], t[3][3][5]; int dx[]{-1, 0, 1, 0}, dy[]{0, 1, 0, -1}; int dfs(int p) { int res = 0; rep(i, 3) rep(j, 3) { if (t[i][j][0]) continue; rep(k, 4) { rep(l, 4) { int nx = i + dx[l], ny ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; char s[9][5], t[3][3][5]; int dx[]{-1, 0, 1, 0}, dy[]{0, 1, 0, -1}; int dfs(int p) { int res = 0; rep(i, 3) rep(j, 3) { if (t[i][j][0]) continue; rep(k, 4) { rep(l, 4) { int nx = i + dx[l], ny ...
replace
35
36
35
36
TLE
p00697
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; string s[9], t[3][3]; int dx[]{-1, 0, 1, 0}, dy[]{0, 1, 0, -1}; int dfs(int p) { int res = 0; rep(i, 3) rep(j, 3) { if (!t[i][j].empty()) continue; rep(k, 4) { rep(l, 4) { int nx = i + dx[l], n...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; string s[9], t[3][3]; int dx[]{-1, 0, 1, 0}, dy[]{0, 1, 0, -1}; int dfs(int p) { int res = 0; rep(i, 3) rep(j, 3) { if (!t[i][j].empty()) continue; rep(k, 4) { rep(l, 4) { int nx = i + dx[l], n...
replace
16
21
16
17
TLE
p00698
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cstdlib> #include <deque> #include <iostream> #include <sstream> #include <vector> #define MAX 1000 #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define inf (1 << 29) using namespace std; typedef pair<int, int> P; int h, w; int G[MAX][...
#include <algorithm> #include <cassert> #include <cstdlib> #include <deque> #include <iostream> #include <sstream> #include <vector> #define MAX 1000 #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define inf (1 << 29) using namespace std; typedef pair<int, int> P; int h, w; int G[MAX][...
replace
56
57
56
57
0
p00699
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; const int IINF = INT_MAX; // vector<string> trim(const vector<string> &vec) { int n, e, s, w; w = IINF, e = -IINF, n = IINF, s = -IINF; for (int y = 0; y < vec.size(); y++) { for...
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; const int IINF = INT_MAX; // vector<string> trim(const vector<string> &vec) { int n, e, s, w; w = IINF, e = -IINF, n = IINF, s = -IINF; for (int y = 0; y < vec.size(); y++) { for...
replace
110
111
110
111
0
p00701
C++
Runtime Error
#include <algorithm> #include <cassert> #include <iostream> #include <vector> using namespace std; const int MAXN = 105; int N; int top[MAXN], bottom[MAXN]; int findTop(int x, vector<int> *v = NULL) { if (v != NULL) v->push_back(x); return top[x] == x ? x : findTop(top[x], v); } int getH(int x) { return bot...
#include <algorithm> #include <cassert> #include <iostream> #include <vector> using namespace std; const int MAXN = 105; int N; int top[MAXN], bottom[MAXN]; int findTop(int x, vector<int> *v = NULL) { if (v != NULL) v->push_back(x); return top[x] == x ? x : findTop(top[x], v); } int getH(int x) { return bot...
replace
39
41
39
40
0
p00702
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main() {...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main() {...
replace
19
20
19
21
0
p00705
C++
Runtime Error
#include <iostream> // #define N 101 #define N 11 using namespace std; int main() { int n, q, m, d; int data[N]; while (cin >> n >> q && (n || q)) { // cout << "n="<<n<<" q="<<q << endl; for (int i = 0; i < N; i++) data[i] = 0; for (int i = 0; i < n; i++) { cin >> m; for (int...
#include <iostream> // #define N 101 #define N 101 using namespace std; int main() { int n, q, m, d; int data[N]; while (cin >> n >> q && (n || q)) { // cout << "n="<<n<<" q="<<q << endl; for (int i = 0; i < N; i++) data[i] = 0; for (int i = 0; i < n; i++) { cin >> m; for (in...
replace
2
3
2
3
0
p00705
Python
Runtime Error
import collections while True: N, Q = map(int, input().split()) if N == 0 and Q == 0: break D = [] for _ in range(N): i = list(map(int, input().split())) del i[0] [D.append(ii) for ii in i] c = collections.Counter(D) cc = c.most_common() if cc[0][1] >= Q: ...
import collections while True: N, Q = map(int, input().split()) if N == 0 and Q == 0: break D = [] for _ in range(N): i = list(map(int, input().split())) del i[0] [D.append(ii) for ii in i] if not len(D) == 0: c = collections.Counter(D) cc = c.most_co...
replace
11
15
11
24
0
p00705
C++
Time Limit Exceeded
#include <stdio.h> #pragma warning(disable : 4996) int N, Q, M, D, R[100]; int main() { while (true) { scanf("%d%d", &N, &Q); if (N == 0 && Q == 0) break; for (int i = 0; i < 100; i++) R[i] = 0; for (int i = 0; i < N; i++) { scanf("%d", &M); for (int j = 0; j < M; j++) { ...
#include <stdio.h> #pragma warning(disable : 4996) int N, Q, M, D, R[100]; int main() { while (true) { scanf("%d%d", &N, &Q); if (N == 0 && Q == 0) break; for (int i = 0; i < 100; i++) R[i] = 0; for (int i = 0; i < N; i++) { scanf("%d", &M); for (int j = 0; j < M; j++) { ...
replace
18
19
18
19
TLE
p00705
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> #define MAX 50 using namespace std; int main() { int n, q, m; int d[MAX], date; while (cin >> n >> q) { if (n == 0 && q == 0) break; memset(d, 0, sizeof(d)); while (n--) { cin >> m; for (int i = 0; i < m; i++) { cin ...
#include <cstdio> #include <cstring> #include <iostream> #define MAX 100 using namespace std; int main() { int n, q, m; int d[MAX], date; while (cin >> n >> q) { if (n == 0 && q == 0) break; memset(d, 0, sizeof(d)); while (n--) { cin >> m; for (int i = 0; i < m; i++) { cin...
replace
4
5
4
5
0
p00706
C++
Runtime Error
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1125 #include <algorithm> #include <iostream> #include <stdio.h> using namespace std; int N, W, H, S, T; bool field[110][110]; void init() { fill(&field[0][0], &field[110][110], false); } int trees(int o_x, int o_y) { int count = 0; for (int i = o_x; i...
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1125 #include <algorithm> #include <iostream> #include <stdio.h> using namespace std; int N, W, H, S, T; bool field[110][110]; void init() { fill(&field[0][0], &field[0][0] + 110 * 110, false); } int trees(int o_x, int o_y) { int count = 0; for (int i ...
replace
10
11
10
11
-11
p00706
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int i, j, n, w, h, s, t, wx, hy, map[101][101]; while (1) { cin >> n; if (n == 0) break; int datax[101]; int datay[101]; cin >> w >> h; for (i = 1; i <= n; i++) { cin >> wx >> hy; map[hy][wx] = 1; datax[i] = wx; ...
#include <iostream> using namespace std; int main() { int i, j, n, w, h, s, t, wx, hy, map[101][101]; while (1) { cin >> n; if (n == 0) break; int datax[501]; int datay[501]; cin >> w >> h; for (i = 1; i <= n; i++) { cin >> wx >> hy; map[hy][wx] = 1; datax[i] = wx; ...
replace
9
11
9
11
TLE
p00706
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define abs(a) max((a), -(a)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repe(i, n) rep(i, (n) + 1) #define per(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define pere(i,...
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define abs(a) max((a), -(a)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repe(i, n) rep(i, (n) + 1) #define per(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define pere(i,...
insert
23
23
23
25
TLE
p00706
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define INF 114514810 #define ll long long #define ALL(a) (a).begin(), (a).end() #define SORT(v) sort(ALL(v)) // #define scanf scanf_s typedef pair<int, int> P; int n; int w, h; int tizu[...
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define INF 114514810 #define ll long long #define ALL(a) (a).begin(), (a).end() #define SORT(v) sort(ALL(v)) // #define scanf scanf_s typedef pair<int, int> P; int n; int w, h; int tizu[...
replace
15
16
15
16
0
p00706
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; int main(void) { int n; while (cin >> n) { if (n == 0) break; cerr << endl; int w, h; cin >> w >> h; ve...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; int main(void) { int n; while (cin >> n) { if (n == 0) break; int w, h; cin >> w >> h; vector<vector<bool>>...
delete
18
19
18
18
0
p00706
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int n; while (cin >> n && n) { int w, h; cin >> w >> h; bool field[w][h]; fill(field[0], field[w], 0); for (int i = 0; i < n; ++i) { int x, y; cin >> x >> y; field[x][y] = 1; } int s, t; cin >> s >> t; in...
#include <iostream> using namespace std; int main(void) { int n; while (cin >> n && n) { int w, h; cin >> w >> h; bool field[w][h]; fill(field[0], field[w], 0); for (int i = 0; i < n; ++i) { int x, y; cin >> x >> y; field[x - 1][y - 1] = 1; } int s, t; cin >> s >> t...
replace
12
13
12
13
0
p00706
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, N) for (ll i = 0; i < N; ++i) #define FOR(i, a, b) for (ll i = a; i < b; ++i) #define ALL(a) (a).begin(), (a).end() #define pb ...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, N) for (ll i = 0; i < N; ++i) #define FOR(i, a, b) for (ll i = a; i < b; ++i) #define ALL(a) (a).begin(), (a).end() #define pb ...
replace
30
31
30
31
-6
munmap_chunk(): invalid pointer
p00706
C++
Runtime Error
#include <cstdio> #include <iomanip> #include <iostream> #include <bitset> #include <map> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #include <algorithm> #include <functional> #include <numeric> #include <cctype> #include <complex> #include <sstream> #include <string> usi...
#include <cstdio> #include <iomanip> #include <iostream> #include <bitset> #include <map> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #include <algorithm> #include <functional> #include <numeric> #include <cctype> #include <complex> #include <sstream> #include <string> usi...
replace
59
63
59
60
0
.......*.. .*.*...... ..*......* .....*.*.. .*.*..*... ........*. .*...*.... ..**..*... .*...* *..*.* ....*. .**...
p00706
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int H, W, S, T; bool fld[100][100]; int Count(int x, int y) { int res = 0; for (int i = y; i < y + T; i++) { for (int j = x; j < x + S; j++) { res += fld[i][j]; } } return res; } signed main() { int N; while (cin >> N, N)...
#include <bits/stdc++.h> using namespace std; #define int long long int H, W, S, T; bool fld[100][100]; int Count(int x, int y) { int res = 0; for (int i = y; i < y + T; i++) { for (int j = x; j < x + S; j++) { res += fld[i][j]; } } return res; } signed main() { int N; while (cin >> N, N)...
replace
22
23
22
23
-11
p00707
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; int W, H; char field[100][100]; string dp[100][100]; bool compare(const string &s1, const string &s2) { if (s1.size() != s2.size()) return !(s1.size() > s2.size()); else r...
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; int W, H; char field[100][100]; string dp[100][100]; bool compare(const string &s1, const string &s2) { if (s1.size() != s2.size()) return !(s1.size() > s2.size()); else r...
insert
39
39
39
46
0
p00707
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; const int WH = 72; char board[WH]; string dp[WH]; bool comp(const string &a, const string &b) { if (a.length() == b.length()) { return a < b; } return a.length() < b.length(); } int main() { int w, h, m; string r; while ...
#include <algorithm> #include <iostream> #include <string> using namespace std; const int WH = 4900; char board[WH]; string dp[WH]; bool comp(const string &a, const string &b) { if (a.length() == b.length()) { return a < b; } return a.length() < b.length(); } int main() { int w, h, m; string r; whil...
replace
5
6
5
6
0
p00709
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; const int IINF = INT_MAX; int H, W, mincost; int P[10][10], bin[10], bc[(1 << 10)]; int put[10][10], counter[10][10]; bool can_put(int len, int x, int y) { REP(i, y, y + len) REP(j, x, x +...
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; const int IINF = INT_MAX; int H, W, mincost; int P[10][10], bin[10], bc[(1 << 10)]; int put[10][10], counter[10][10]; bool can_put(int len, int x, int y) { REP(i, y, y + len) REP(j, x, x +...
replace
21
22
21
23
TLE
p00709
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) using namespace std; int w, h, n, A[11][11], ans, cnt; bitset<100> B[11][11]; void dfs(int d, bitset<100> s, int sco) { if (d == n) { ans = min(ans, sco); return; } cnt++; if (cnt >= 100000000) return; if (ans <= sco) retur...
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) using namespace std; int w, h, n, A[11][11], ans, cnt; bitset<100> B[11][11]; void dfs(int d, bitset<100> s, int sco) { if (d == n) { ans = min(ans, sco); return; } cnt++; if (cnt >= 30000000) return; if (ans <= sco) return...
replace
13
14
13
14
TLE
p00709
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int w, h; int p[11][11]; int cnt[11][11]; int res; struct square { int x, y, si; square() {} square(int xx, int yy, int ss) { x = xx; y = yy; si = ss; } bool operator<(const sq...
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int w, h; int p[11][11]; int cnt[11][11]; int res; struct square { int x, y, si; square() {} square(int xx, int yy, int ss) { x = xx; y = yy; si = ss; } bool operator<(const sq...
insert
167
167
167
168
TLE
p00709
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = int(a)...
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = int(a)...
replace
116
118
116
121
TLE
p00709
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define range(x, l, r) (l <= x && x < r) #define fs first #define sc second using namespace std; typedef pair<int, int> pii; typedef pair<pii, int> tri; int w, h; int g[20][20]; int rem[20][20]; vector<tri> carpet[20][20]; int depth; void s...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define range(x, l, r) (l <= x && x < r) #define fs first #define sc second using namespace std; typedef pair<int, int> pii; typedef pair<pii, int> tri; int w, h; int g[20][20]; int rem[20][20]; vector<tri> carpet[20][20]; int depth; void s...
insert
118
118
118
135
TLE
p00709
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef vector<int> vec; int H, W; vec t; map<vec, int> dp[10][10]; int mem[10][10][10][10]; bool check(int ay, int ax, int by, int bx) { if (mem[ay][ax][by][bx] != -1) return mem[ay][ax][by][bx]; mem[ay][ax][by][bx] = false; for (int y = ay; y <= by; y++) ...
#include <bits/stdc++.h> using namespace std; typedef vector<int> vec; int H, W; vec t; map<vec, int> dp[10][10]; int mem[10][10][10][10]; bool check(int ay, int ax, int by, int bx) { if (mem[ay][ax][by][bx] != -1) return mem[ay][ax][by][bx]; mem[ay][ax][by][bx] = false; for (int y = ay; y <= by; y++) ...
insert
49
49
49
51
TLE
p00710
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <deque> #include <exception> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0;...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <deque> #include <exception> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0;...
replace
43
44
43
44
0
p00710
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { vector<int> cards; vector<int>::iterator cardsIterator; vector<int>::iterator shuffuleIterator; int n, r, p, c; while (cin >> n >> r, n && r) { cards.clear(); // 初期化 // カードの山生成 for (int i = 0; i < n; ++i) { cards.push...
#include <iostream> #include <vector> using namespace std; int main() { vector<int> cards; vector<int>::iterator cardsIterator; vector<int>::iterator shuffuleIterator; int n, r, p, c; while (cin >> n >> r, n && r) { cards.clear(); // 初期化 // カードの山生成 for (int i = 0; i < n; ++i) { cards.push...
replace
18
19
18
19
TLE
p00710
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < ((int)(n)); i++) #define reg(i, a, b) for (in...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < ((int)(n)); i++) #define reg(i, a, b) for (in...
replace
21
22
21
22
0
p00710
C++
Runtime Error
#include <iostream> #define N 10 using namespace std; /* Hanafuda Shuffle http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1129&lang=jp */ int array[N]; void makearray(int n) { for (int i = 0; i < N; i++) { array[i] = n; if (n > 0) n -= 1; } } void shuffle(int p, int c) { int sarray[N]; /...
#include <iostream> #define N 50 using namespace std; /* Hanafuda Shuffle http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1129&lang=jp */ int array[N]; void makearray(int n) { for (int i = 0; i < N; i++) { array[i] = n; if (n > 0) n -= 1; } } void shuffle(int p, int c) { int sarray[N]; /...
replace
1
2
1
2
0
p00711
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int dx[] = {1, -1, 0, 0}; const int dy[] = {0, 0, 1, -1}; int W, H; char board[30][30]; int dfs(int y, int x) { board[y][x] = '#'; int ret = 1; for (int i = 0; i < 4; i++) { int ny = y + dy[i], nx = x + dx[i]; if (ny >= 0 && ny < H && nx >= 0 && nx < W...
#include <bits/stdc++.h> using namespace std; const int dx[] = {1, -1, 0, 0}; const int dy[] = {0, 0, 1, -1}; int W, H; char board[30][30]; int dfs(int y, int x) { board[y][x] = '#'; int ret = 1; for (int i = 0; i < 4; i++) { int ny = y + dy[i], nx = x + dx[i]; if (ny >= 0 && ny < H && nx >= 0 && nx < W...
replace
14
15
14
15
-11
p00711
C++
Runtime Error
#include <cassert> #include <iostream> #define REP(i, l, n) for (int i = l; i < n; ++i) #define rep(i, n) REP(i, 0, n) #define MAX 20 int ans, baseX, baseY; int w, h; char tile[MAX][MAX]; void seek(int x, int y); using namespace std; int main() { while (1) { cin >> w; cin >> h; if (w == 0 && h == 0) ...
#include <cassert> #include <iostream> #define REP(i, l, n) for (int i = l; i < n; ++i) #define rep(i, n) REP(i, 0, n) #define MAX 21 int ans, baseX, baseY; int w, h; char tile[MAX][MAX]; void seek(int x, int y); using namespace std; int main() { while (1) { cin >> w; cin >> h; if (w == 0 && h == 0) ...
replace
4
5
4
5
0
p00711
C++
Time Limit Exceeded
#include <iostream> using namespace std; const int NUM = 7; void grooping(int y, int x, int w, int h, char **room, unsigned long ***group, unsigned long *next) { if (room[y][x] != '#') { for (int i = y - 1; i <= y + 1; i++) { for (int j = x - 1; j <= x + 1; j++) { if (i < 0 || j < 0 ...
#include <iostream> using namespace std; const int NUM = 7; void grooping(int y, int x, int w, int h, char **room, unsigned long ***group, unsigned long *next) { if (room[y][x] != '#') { for (int i = y - 1; i <= y + 1; i++) { for (int j = x - 1; j <= x + 1; j++) { if (i < 0 || j < 0 ...
replace
58
59
58
59
TLE
p00711
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; vector<string> f; void init() { f.clear(); } int input() { int w, h; cin >> w >> h; if (w == 0 && h == 0) return false; string s; for (int i = 0; i < h; i++) { cin >> s; f.push_back(s); } return true; } int vx[] = ...
#include <iostream> #include <string> #include <vector> using namespace std; vector<string> f; void init() { f.clear(); } int input() { int w, h; cin >> w >> h; if (w == 0 && h == 0) return false; string s; for (int i = 0; i < h; i++) { cin >> s; f.push_back(s); } return true; } int vx[] = ...
insert
25
25
25
29
-11
p00711
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < (int)(N); i++) #define REP(i, N, k) for (int i = k; i < (int)(N); i++) #define vi vector<int> #define pb push_back #define pii pair<int, int> #define fi first #define se second int main() { ifstream in("b_in.txt"); cin.rdbuf(in....
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < (int)(N); i++) #define REP(i, N, k) for (int i = k; i < (int)(N); i++) #define vi vector<int> #define pb push_back #define pii pair<int, int> #define fi first #define se second int main() { // ifstream in("b_in.txt"); // c...
replace
14
16
14
16
0
p00711
C++
Runtime Error
#include <iostream> #include <queue> using namespace std; const int MAX_SIZE = 20; typedef pair<int, int> P; int calc(char f[][MAX_SIZE], queue<P> q, int W, int H) { int n = 0; while (q.size()) { n++; P p = q.front(); q.pop(); int di[] = {-1, 1, 0, 0}; int dj[] = {0, 0, -1, 1}; for (int k ...
#include <iostream> #include <queue> using namespace std; const int MAX_SIZE = 21; typedef pair<int, int> P; int calc(char f[][MAX_SIZE], queue<P> q, int W, int H) { int n = 0; while (q.size()) { n++; P p = q.front(); q.pop(); int di[] = {-1, 1, 0, 0}; int dj[] = {0, 0, -1, 1}; for (int k ...
replace
4
5
4
5
0
p00711
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; vector<int> x; vector<int> y; vector<int> nextx; vector<int> nexty; int w, h; int count; bool check(int a, int b) { for (int i = 0; i < nextx.size(); i++) { if (nextx[i] == a && nexty[i] == b) return false; } return true; } int...
#include <iostream> #include <string> #include <vector> using namespace std; vector<int> x; vector<int> y; vector<int> nextx; vector<int> nexty; int w, h; int count; bool check(int a, int b) { for (int i = 0; i < nextx.size(); i++) { if (nextx[i] == a && nexty[i] == b) return false; } return true; } int...
replace
35
36
35
36
-11
p00711
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; int paint(vector<string> &field, int x, int y) { int cnt = 0; for (int i = 0; i < 4; ++i) { int xx = x + dx[i]; int yy = y + dy[i]; if (xx < 0 || fie...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; int paint(vector<string> &field, int x, int y) { int cnt = 0; for (int i = 0; i < 4; ++i) { int xx = x + dx[i]; int yy = y + dy[i]; if (xx < 0 || fie...
replace
17
18
17
18
0
p00711
C++
Time Limit Exceeded
#include <cctype> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <deque> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define repi(i, l, n) for (int(i) = (int)(l); (i) < (int)(n); (i)++...
#include <cctype> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <deque> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define repi(i, l, n) for (int(i) = (int)(l); (i) < (int)(n); (i)++...
insert
56
56
56
59
TLE
p00711
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define pb push_back #define pf push_front #define fi first #define se second #define BIT(x, n) bitset<n>(x) #def...
#include <bits/stdc++.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define pb push_back #define pf push_front #define fi first #define se second #define BIT(x, n) bitset<n>(x) #def...
insert
54
54
54
56
TLE
p00711
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int check(int j) { if (j == 2 || j == 4 || j == 3) return j; else return 3; } int main() { int board[22][22]; int w, h; char t; while (1) { cin >> w >> h; for (int i = 0; i <= 21; i++) { for (int j = 0; j <= 21...
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int check(int j) { if (j == 2 || j == 4 || j == 3) return j; else return 3; } int main() { int board[22][22]; int w, h; char t; while (1) { cin >> w >> h; if (w == 0 && h == 0) break; for (int i = 0; i <= 2...
insert
16
16
16
18
TLE
p00711
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; typedef vector<vector<int>> vector2d; int main() { int H, W, count = 0, kaisuu = 0, kosuu, sum, judge; char map[20][20]; vector2d nextx, nexty; // nextx[回数][個数] nextx.reserve(1000); nexty.reserve(1000); while (1) { cin >> W...
#include <iostream> #include <string> #include <vector> using namespace std; typedef vector<vector<int>> vector2d; int main() { int H, W, count = 0, kaisuu = 0, kosuu, sum, judge; char map[20][20]; vector2d nextx, nexty; // nextx[回数][個数] nextx.reserve(10000); nexty.reserve(10000); while (1) { cin >>...
replace
12
14
12
14
0
p00711
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; vector<int> ans; typedef pair<int, int> P; int main() { int W, H; cin >> W >> H; int tate[4] = {0, 1, 0, -1}; int yoko[4] = {1, 0, -1, 0}; while (W) { int count = 0; queue<P> zahyou; vector<vector<int>> room(H, vector<in...
#include <iostream> #include <queue> #include <vector> using namespace std; vector<int> ans; typedef pair<int, int> P; int main() { int W, H; cin >> W >> H; int tate[4] = {0, 1, 0, -1}; int yoko[4] = {1, 0, -1, 0}; while (W) { int count = 0; queue<P> zahyou; vector<vector<int>> room(H, vector<in...
replace
37
38
37
41
-11
p00712
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <set> #include <string> #include <tuple> #include <vector> using namespace std; typedef long double ld; const ld EPS = 1e-9; ld p, q; int a, n; ld t; int dfs(int m, ld s, int w, int c) { if (abs(s - t) < EPS) { return 1; } if (m == n) return 0; in...
#include <algorithm> #include <iostream> #include <set> #include <string> #include <tuple> #include <vector> using namespace std; typedef long double ld; const ld EPS = 1e-9; ld p, q; int a, n; ld t; int dfs(int m, ld s, int w, int c) { if (abs(s - t) < EPS) { return 1; } if (m == n) return 0; in...
replace
26
27
26
27
TLE
p00712
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int calc(int p, int q, int mind, int ca, int a, int cn, int n) { int s = 0; if (cn <= n) { mind = max(mind, q / p); int maxd = floor((double)(n - cn + 1) * q / p); for (int i = mind; i <= maxd && pow(i, floor((double)i * p ...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int calc(int p, int q, int mind, int ca, int a, int cn, int n) { int s = 0; if (cn <= n) { mind = max(mind, q / p); int maxd = floor((double)(n - cn + 1) * q / p); for (int i = mind; i <= maxd && pow(i, floor((double)i * p ...
delete
18
24
18
18
TLE
p00712
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class T> inline T sqr(T x) { return x * x; } typedef vector<int> v...
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class T> inline T sqr(T x) { return x * x; } typedef vector<int> v...
insert
50
50
50
52
TLE