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
p00222
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
delete
24
25
24
24
-11
p00223
C++
Runtime Error
#include <queue> #include <stdio.h> #include <string.h> using namespace std; struct AO { int tx; int ty; int kx; int ky; int cnt; }; queue<AO> Q; AO TK, f; int d[51][51]; int sa[51][51][51][51]; int main() { int X, Y, F; // tx ty kx ky int mv[4][4] = {{0, -1, 0, 1}, //??? ...
#include <queue> #include <stdio.h> #include <string.h> using namespace std; struct AO { int tx; int ty; int kx; int ky; int cnt; }; queue<AO> Q; AO TK, f; int d[52][52]; int sa[51][51][51][51]; int main() { int X, Y, F; // tx ty kx ky int mv[4][4] = {{0, -1, 0, 1}, //??? ...
replace
15
16
15
16
0
p00223
C++
Runtime Error
#include <iostream> #include <queue> #include <set> #include <utility> #include <vector> using namespace std; const int needleX[4] = {-1, 0, 1, 0}; const int needleY[4] = {0, -1, 0, 1}; pair<int, int> newPoint(pair<int, int> &nowPoint, int i, vector<vector<bool>> &depart, bool takayuki) { pa...
#include <iostream> #include <queue> #include <set> #include <utility> #include <vector> using namespace std; const int needleX[4] = {-1, 0, 1, 0}; const int needleY[4] = {0, -1, 0, 1}; pair<int, int> newPoint(pair<int, int> &nowPoint, int i, vector<vector<bool>> &depart, bool takayuki) { pa...
replace
29
31
29
31
0
p00223
C++
Memory Limit Exceeded
#include <cstring> #include <iostream> #include <queue> using namespace std; int H, W; bool F[52][52]; // 障害物 bool D[52][52][52][52]; // 探索済みかの判定用 int inc_tx[4] = {1, -1, 0, 0}; int inc_ty[4] = {0, 0, 1, -1}; int inc_kx[4] = {-1, 1, 0, 0}; int inc_ky[4] = {0, 0, -1, 1}; class Point { public: int tx; // タカユキ...
#include <cstring> #include <iostream> #include <queue> using namespace std; int H, W; bool F[52][52]; // 障害物 bool D[52][52][52][52]; // 探索済みかの判定用 int inc_tx[4] = {1, -1, 0, 0}; int inc_ty[4] = {0, 0, 1, -1}; int inc_kx[4] = {-1, 1, 0, 0}; int inc_ky[4] = {0, 0, -1, 1}; class Point { public: int tx; // タカユキ...
replace
75
86
75
87
MLE
p00223
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cstdio> #include <cstdlib> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #include <time.h> #include <vector> using namespace std; #define FOR(I, F, N) for (int I = F; I < (int...
#include <algorithm> #include <bitset> #include <cstdio> #include <cstdlib> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #include <time.h> #include <vector> using namespace std; #define FOR(I, F, N) for (int I = F; I < (int...
replace
62
63
62
63
0
p00223
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int h, w; int map[100][100]; int qtx[600000], qty[600000], qkx[600000], qky[600000]; int ql[600000]; int tail, head; int ans; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; bool vis[60][60][60][60]; bool bend; void BFS(int tx, int ty, int kx, int ky, int ...
#include <algorithm> #include <iostream> using namespace std; int h, w; int map[100][100]; int qtx[800000], qty[800000], qkx[800000], qky[800000]; int ql[800000]; int tail, head; int ans; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; bool vis[60][60][60][60]; bool bend; void BFS(int tx, int ty, int kx, int ky, int ...
replace
5
7
5
7
0
p00223
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define MP make_pair #define F first #define S second using namespace std; typedef pair<int, int> PII; typedef pair<PII, PII> PPP; int x, y; bool visited[51][51][51][51]; bool flr[52][52]; int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; int main() { while (true) { cin >> x >> y; if (...
#include <bits/stdc++.h> #define MP make_pair #define F first #define S second using namespace std; typedef pair<int, int> PII; typedef pair<PII, PII> PPP; int x, y; bool visited[51][51][51][51]; bool flr[52][52]; int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; int main() { while (true) { cin >> x >> y; if (...
delete
62
67
62
62
TLE
p00223
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <memory.h> #include <memory> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; int x, y; int tm[51][51][51][51]; char fi...
#include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <memory.h> #include <memory> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; int x, y; int tm[51][51][51][51]; char fi...
replace
59
61
59
60
TLE
p00223
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = n - 1; i >= 0; i--) #define PB push_back #define INF INT_MAX / 3 #define ALL(a) (a).begin(), (a).end() #...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = n - 1; i >= 0; i--) #define PB push_back #define INF INT_MAX / 3 #define ALL(a) (a).begin(), (a).end() #...
insert
101
101
101
103
MLE
p00223
C++
Runtime Error
#include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; struct State { pair<int, int> t, k; int turn; }; int dy[] = {0, 1, 0, -1}; int dx[] = {1, 0, -1, 0}; int w, h; int field[52][52]; bool visited[52][52][52][52]; int main() { while (cin >> w >> h, w | h) { memse...
#include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; struct State { pair<int, int> t, k; int turn; }; int dy[] = {0, 1, 0, -1}; int dx[] = {1, 0, -1, 0}; int w, h; int field[52][52]; bool visited[52][52][52][52]; int main() { while (cin >> w >> h, w | h) { memse...
replace
29
31
29
31
-11
p00224
C++
Time Limit Exceeded
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
replace
52
55
52
53
TLE
p00225
C++
Runtime Error
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0225 // ユニオンファインド木 #include <iostream> #include <string> #include <vector> using namespace std; // int n;//単語の数 int par[26]; int r[26]; // rank void init(int n) { for (int i = 0; i < n; i++) { r[i] = 0; par[i] = i; } } int root(int x) { if (p...
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0225 // ユニオンファインド木 #include <iostream> #include <string> #include <vector> using namespace std; // int n;//単語の数 int par[26]; int r[26]; // rank void init(int n) { for (int i = 0; i < n; i++) { r[i] = 0; par[i] = i; } } int root(int x) { if (p...
replace
49
50
49
50
0
p00225
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; struct UnionFind { int n; vector<int> parent; vector<int> rank; vector<int> num; int find(int x) { if (parent[x] == x) return x; return parent[x] = find(parent[x]); } UnionFin...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; struct UnionFind { int n; vector<int> parent; vector<int> rank; vector<int> num; int find(int x) { if (parent[x] == x) return x; return parent[x] = find(parent[x]); } UnionFin...
delete
62
63
62
62
0
7 7
p00227
C++
Runtime Error
#include <stdio.h> int main() { int N, M; int n[1001] = {}; while (1) { int s = 0; scanf("%d %d", &N, M); if (N == 0 && M == 0) break; for (int i = 1; i <= N; i++) scanf("%d", &n[i]); for (int i = 1; i <= N; i++) for (int j = N; j > i; j--) if (n[j] > n[j - 1]) { ...
#include <stdio.h> int main() { int N, M; int n[1001] = {}; while (1) { int s = 0; scanf("%d %d", &N, &M); if (N == 0 && M == 0) break; for (int i = 1; i <= N; i++) scanf("%d", &n[i]); for (int i = 1; i <= N; i++) for (int j = N; j > i; j--) if (n[j] > n[j - 1]) {...
replace
8
9
8
9
-11
p00227
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> using namespace std; int main() { int n, m, fig[1001]; while (cin >> n >> m) { int ans = 0; for (int i = 0; i < n; i++) cin >> fig[i]; sort(fig, fig + n, greater<int>()); for (int i = 0; i < (n / m) * m; i++) { if ((i + 1) %...
#include <algorithm> #include <functional> #include <iostream> using namespace std; int main() { int n, m, fig[1001]; while (cin >> n >> m, n || m) { int ans = 0; for (int i = 0; i < n; i++) cin >> fig[i]; sort(fig, fig + n, greater<int>()); for (int i = 0; i < (n / m) * m; i++) { if ((...
replace
7
8
7
8
-8
p00227
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b, i, sum = 0; int c[a]; while (1) { cin >> a >> b; if (a == 0 && b == 0) break; for (i = 0; i < a; i++) { cin >> c[i]; sum += c[i]; } sort(c, c + a); reverse(c, c + a); for (i = b - 1;...
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b, i, sum = 0; int c[10000]; while (1) { cin >> a >> b; if (a == 0 && b == 0) break; for (i = 0; i < a; i++) { cin >> c[i]; sum += c[i]; } sort(c, c + a); reverse(c, c + a); for (i = b ...
replace
6
7
6
7
-11
p00227
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <ss...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <ss...
delete
55
56
55
55
0
p 40 50 80 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
p00227
C++
Runtime Error
#include <algorithm> #include <iostream> #include <numeric> #include <vector> int main() { int n, m; // 問題文のn,m while (std::cin >> n >> m) { if (n == 0 && m == 0) break; std::vector<int> p(n); // 野菜価格一覧 for (int i = 0; i < n; ++i) { std::cin >> p[i]; } sort(p.begin(), p.end()); ...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> int main() { int n, m; // 問題文のn,m while (std::cin >> n >> m) { if (n == 0 && m == 0) break; std::vector<int> p(n); // 野菜価格一覧 for (int i = 0; i < n; ++i) { std::cin >> p[i]; } sort(p.begin(), p.end()); ...
replace
20
22
20
22
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p00227
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; int n, m; vector<int> vege; const int INF = 1 << 29; int main(void) { while (cin >> n >> ...
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; int n, m; vector<int> vege; const int INF = 1 << 29; int main(void) { while (cin >> n >> ...
replace
19
20
19
20
-8
p00228
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { string table[] = {"0111111", "0000110", "1011011", "1001111", "1100110", "1101101", "1111101", "1111111", "1101111"}; int n; while (cin >> n, ~n) { st...
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { string table[] = {"0111111", "0000110", "1011011", "1001111", "1100110", "1101101", "1111101", "0100111", "1111111", "1101111"}; int n; while (cin >> n, ~...
replace
8
9
8
9
0
p00230
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
66
67
66
67
0
p00231
C++
Time Limit Exceeded
#include <iostream> #include <map> using namespace std; #define START 0 #define END 1 int main() { while (true) { int n; scanf("%d", &n); if (n == 0) break; multimap<int, pair<int, int>> M; for (int i = 0; i < n; ++i) { int m, a, b; scanf("%d%d%d", &m, &a, &b); M.insert(ma...
#include <iostream> #include <map> using namespace std; #define START 0 #define END 1 int main() { while (true) { int n; scanf("%d", &n); if (n == 0) break; multimap<int, pair<int, int>> M; for (int i = 0; i < n; ++i) { int m, a, b; scanf("%d%d%d", &m, &a, &b); M.insert(ma...
insert
32
32
32
34
TLE
p00231
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> using namespace std; typedef pair<int, int> p; typedef pair<int, p> P; // time,which,weight int main() { P t[101]; int n, a, b, c; while (cin >> n, n) { for (int i = 0; i < n; i++) { cin >> a >> b >> c; t[i].second.second = a; t[i].firs...
#include <algorithm> #include <iostream> #include <map> using namespace std; typedef pair<int, int> p; typedef pair<int, p> P; // time,which,weight int main() { P t[300]; int n, a, b, c; while (cin >> n, n) { for (int i = 0; i < n; i++) { cin >> a >> b >> c; t[i].second.second = a; t[i].firs...
replace
7
8
7
8
0
p00231
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...
insert
16
16
16
18
TLE
p00231
C++
Runtime Error
#include <stdio.h> #define W_LIM 150 int main(void) { int n; int curW; int ev[127]; int evTime[127]; int evCnt; int broken; while (scanf("%d", &n), n) { evCnt = 0; // read events for (int i = 0; i < n; i++) { int m, a, b; scanf("%d %d %d", &m, &a, &b); ev[evCnt] = m; ...
#include <stdio.h> #define W_LIM 150 int main(void) { int n; int curW; int ev[256]; int evTime[256]; int evCnt; int broken; while (scanf("%d", &n), n) { evCnt = 0; // read events for (int i = 0; i < n; i++) { int m, a, b; scanf("%d %d %d", &m, &a, &b); ev[evCnt] = m; ...
replace
7
9
7
9
0
p00232
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repl(i, 0, n) #define mp(a, b) make_pair((a), (b)) #define pb(a) push_back((a)) #define all(x) (x).begin(), (x).end() #define uniq(x) sort(all(x)), (x).erase(unique(all(x)), end(x)) #define fi...
#include <bits/stdc++.h> using namespace std; #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repl(i, 0, n) #define mp(a, b) make_pair((a), (b)) #define pb(a) push_back((a)) #define all(x) (x).begin(), (x).end() #define uniq(x) sort(all(x)), (x).erase(unique(all(x)), end(x)) #define fi...
replace
45
46
45
46
0
p00232
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int ...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int ...
replace
59
60
59
61
0
p00232
C++
Runtime Error
// AOJ 0232 #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <utility> #define rep(i, a) for (int i = 0; i < (a); ++i) typedef std::pair<int, int> P; int X, Y, Z; int V[4]; std::map<int, P> evnts; double dp[50][5001][2]; double rec(int pos, int sum, bool eof) { dou...
// AOJ 0232 #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <utility> #define rep(i, a) for (int i = 0; i < (a); ++i) typedef std::pair<int, int> P; int X, Y, Z; int V[4]; std::map<int, P> evnts; double dp[51][5001][2]; double rec(int pos, int sum, bool eof) { dou...
replace
14
15
14
15
0
p00232
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <utility> #include <vector> using namespace std; struct Cell { int e; int a; }; double solve(vector<Cell> &cel, int pos, vector<int> &vs, int money, vector<map<int, double>> &mem) { double retval = 0; int vl = vs.size(); int cl =...
#include <algorithm> #include <iostream> #include <map> #include <utility> #include <vector> using namespace std; struct Cell { int e; int a; }; double solve(vector<Cell> &cel, int pos, vector<int> &vs, int money, vector<map<int, double>> &mem) { double retval = 0; int vl = vs.size(); int cl =...
replace
54
55
54
55
0
p00232
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int X, Y, Z; vector<int> V; vector<int> pl, gt; vector<vector<double>> dp; double calc(int v, int m) { if (v == Y) return (double)m; if (dp[v][m] > -1.) return dp[v][m]; double sum = 0; for (int i = 0; i < V.size(); i++) { int tv = min(Y, v + V[i]); ...
#include <bits/stdc++.h> using namespace std; int X, Y, Z; vector<int> V; vector<int> pl, gt; vector<vector<double>> dp; double calc(int v, int m) { if (v == Y) return (double)m; if (dp[v][m] > -1.) return dp[v][m]; double sum = 0; for (int i = 0; i < V.size(); i++) { int tv = min(Y, v + V[i]); ...
replace
17
19
17
19
0
p00232
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...
insert
62
62
62
64
TLE
p00232
C++
Memory 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
58
59
58
59
MLE
p00232
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, f, n) for (int i = (f); i < (n); i++) #define all(v) (v).begin(), (v).end() #define each(it, v) ...
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, f, n) for (int i = (f); i < (n); i++) #define all(v) (v).begin(), (v).end() #define each(it, v) ...
replace
48
49
48
49
TLE
p00232
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> using namespace std; double ans, dp[51][3000]; int X, Y, Z; int dice[4], t[51], u[51], N; void init(); double dfs(int, int); int main() { while (cin >> X >> Y >> Z && X) { init(); for (int i = 0; i < X; i++) cin >> dice[i]; for (int i = 0; ...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; double ans, dp[51][3000]; int X, Y, Z; int dice[4], t[51], u[51], N; void init(); double dfs(int, int); int main() { while (cin >> X >> Y >> Z && X) { init(); for (int i = 0; i < X; i++) cin >> dice[i]; for (int i = 0; ...
replace
48
49
48
49
TLE
p00232
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <utility> using namespace std; #define MONEY_MAX 4901 typedef pair<int, int> pii; int main() { while (1) { int X, Y, Z; cin >> X >> Y >> Z; if (X == 0 && Y == 0 && Z == 0) { break; } else { int V[X]; for (int i = 0; i < X; i++) ...
#include <algorithm> #include <iostream> #include <utility> using namespace std; #define MONEY_MAX 4901 typedef pair<int, int> pii; int main() { while (1) { int X, Y, Z; cin >> X >> Y >> Z; if (X == 0 && Y == 0 && Z == 0) { break; } else { int V[X]; for (int i = 0; i < X; i++) ...
delete
35
36
35
35
TLE
p00234
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
insert
96
96
96
100
0
p00234
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int g[12][12][60][12][12]; // y, x, air, l, r int event[12][12]; int w, h, f, m, o; int dx[] = {1, 0, -1}, dy[] = {0, 1, 0}; typedef struct state { int cost, air, x, y, l, r; bool operator<(const state &a) const { return cost < a.cost; } bool operator>(const state &a...
#include <bits/stdc++.h> using namespace std; int g[12][12][60][12][12]; // y, x, air, l, r int event[12][12]; int w, h, f, m, o; int dx[] = {1, 0, -1}, dy[] = {0, 1, 0}; typedef struct state { int cost, air, x, y, l, r; bool operator<(const state &a) const { return cost < a.cost; } bool operator>(const state &a...
replace
18
19
18
21
0
p00234
C++
Memory Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; int INF = 10000000; int w, h; int ans; // 予算、容量、初期酸素 int f, m, o; int fie[11][11]; // x,bit,y,air int cost[11][1 << 11][11][51]; vo...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; int INF = 10000000; int w, h; int ans; // 予算、容量、初期酸素 int f, m, o; int fie[11][11]; // x,bit,y,air int cost[11][1 << 10][11][51]; vo...
replace
17
18
17
18
MLE
p00235
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; vector<vector<int>> graph(20); int bridges[20][20]; bool used[20][20]; int calc_sum(int from) { int sum = 0; for (int i = 0; i < graph[from].size(); ++i) { int to = graph[from][i]; if (graph[to].size() == 1) continue; if (used[from][to]) cont...
#include <bits/stdc++.h> using namespace std; vector<vector<int>> graph(20); int bridges[20][20]; bool used[20][20]; int calc_sum(int from) { int sum = 0; for (int i = 0; i < graph[from].size(); ++i) { int to = graph[from][i]; if (graph[to].size() == 1) continue; if (used[from][to]) cont...
replace
44
45
44
46
0
p00235
C++
Runtime Error
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define reps(i, f, n) f...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define reps(i, f, n) f...
insert
51
51
51
52
0
p00235
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define P pair<int, int> // cost to using namespace std; bool X[20]; vector<P> rinsetu[20]; bool S[20]; int MAX...
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #define P pair<int, int> // cost to using namespace std; bool X[20]; vector<P> rinsetu[20]; bool S[20]; int MAX...
replace
26
27
26
27
0
p00235
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include <vector> #ifdef _MSC_VER #include <agents...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include <vector> #ifdef _MSC_VER #include <agents...
insert
76
76
76
77
0
p00236
C++
Memory Limit Exceeded
#include <algorithm> #include <bitset> #include <iostream> #include <set> #include <vector> using namespace std; const int N = 49; int w, h; vector<vector<int>> field; int size; vector<vector<int>> vertex; vector<vector<int>> edge; bitset<N> visited; set<unsigned long long> memo; void make_graph() { enum { Y, X };...
#include <algorithm> #include <bitset> #include <iostream> #include <set> #include <vector> using namespace std; const int N = 49; int w, h; vector<vector<int>> field; int size; vector<vector<int>> vertex; vector<vector<int>> edge; bitset<N> visited; set<unsigned long long> memo; void make_graph() { enum { Y, X };...
replace
70
75
70
72
MLE
p00236
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int T_MAX = 11; int tb[][3][3] = { {{9, 1, 9}, {1, 0, 1}, {9, 9, 9}}, {{9, 1, 9}, {9, 0, 1}, {9, 1, 9}}, {{9, 0, 9}, {1, 0, 1}, {9, 1, 9}}, {{9, 1, 9}, {1, 0, 9}, {9, 1, 9}}, // + {{9, 1,...
#include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int T_MAX = 11; int tb[][3][3] = { {{9, 1, 9}, {1, 0, 1}, {9, 9, 9}}, {{9, 1, 9}, {9, 0, 1}, {9, 1, 9}}, {{9, 0, 9}, {1, 0, 1}, {9, 1, 9}}, {{9, 1, 9}, {1, 0, 9}, {9, 1, 9}}, // + {{9, 1,...
replace
51
52
51
52
TLE
p00236
C++
Memory Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <valarray> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <valarray> #include <...
replace
46
49
46
51
MLE
p00236
C++
Time Limit Exceeded
#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
81
82
81
83
TLE
p00236
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int W, H; int board[10][10][3]; int R_end, C_end; bool solve(int row, int column) { // cout << "@" << row << "," << column << endl; int nex_row, nex_column; nex_row = row + 1; nex_column = column + nex_row / H; nex_row = nex_row % H; if (row >...
#include <algorithm> #include <iostream> using namespace std; int W, H; int board[10][10][3]; int R_end, C_end; bool solve(int row, int column) { // cout << "@" << row << "," << column << endl; int nex_row, nex_column; nex_row = row + 1; nex_column = column + nex_row / H; nex_row = nex_row % H; if (row >...
insert
103
103
103
104
0
p00238
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, i, c, a, b; while (cin >> n, n) { cin >> c; int y = 0; for (i = 0; i < c; c++) { cin >> a >> b; y += b - a; } if (y >= n) cout << "OK" << endl; else cout << n - y << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, c, a, b; while (cin >> n, n) { cin >> c; int y = 0; for (i = 0; i < c; i++) { cin >> a >> b; y += b - a; } if (y >= n) cout << "OK" << endl; else cout << n - y << endl; } }
replace
7
8
7
8
TLE
p00239
C++
Runtime Error
#include <stdio.h> int main(void) { int n, k, j, P, Q, R, C, flg; int i[1001], p1[101], q1[101], r1[101], c[1701], p[101], q[101], r[101]; flg = 0; scanf("%d", &n); while (n != 0) { for (j = 1; j <= n; j++) { scanf("%d %d %d %d", &i[j], &p[j], &q[j], &r[j]); p1[j] = p[j] * 4; q1[j] = q[j...
#include <stdio.h> int main(void) { int n, k, j, P, Q, R, C, flg; int i[1001], p1[101], q1[101], r1[101], c[1701], p[1001], q[1001], r[1001]; flg = 0; scanf("%d", &n); while (n != 0) { for (j = 1; j <= n; j++) { scanf("%d %d %d %d", &i[j], &p[j], &q[j], &r[j]); p1[j] = p[j] * 4; q1[j] = ...
replace
3
4
3
4
0
p00239
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N; int s[100], h[100], L[100], C[100]; while (cin >> N) { if (N == 0) break; for (int i = 0; i < N; i++) { cin >> s[i] >> h[i] >> L[i] >> C[i]; } int P, Q, R, c; int a = 0; cin >> P >> Q >> R >> c; for (int i = 0; i...
#include <iostream> using namespace std; int main() { int N; int s[1000], h[1000], L[1000], C[1000]; while (cin >> N) { if (N == 0) break; for (int i = 0; i < N; i++) { cin >> s[i] >> h[i] >> L[i] >> C[i]; } int P, Q, R, c; int a = 0; cin >> P >> Q >> R >> c; for (int i = ...
replace
5
6
5
6
0
p00240
C++
Runtime Error
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; int main() { int n; while (cin >> n, n) { double y; cin >> y; p...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; int main() { int n; while (cin >> n, n) { double y; cin >> y; p...
delete
20
21
20
20
0
t == 1 ? f1(y,r) : f2(y,r) = 1.47746 t == 1 ? f1(y,r) : f2(y,r) = 1.48 t == 1 ? f1(y,r) : f2(y,r) = 1.55133 t == 1 ? f1(y,r) : f2(y,r) = 1.54
p00240
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <vector> using namespace std; class Bank { public: int id, r, t; Bank(int id, int r, int t) : id(id), r(r), t(t) {} }; int main() { while (true) { int n; cin >> n; int y; cin >> y; vector<Bank> vb; for (int i = 0; i < n; ++i) { int b,...
#include <cmath> #include <iostream> #include <vector> using namespace std; class Bank { public: int id, r, t; Bank(int id, int r, int t) : id(id), r(r), t(t) {} }; int main() { while (true) { int n; cin >> n; if (n == 0) break; int y; cin >> y; vector<Bank> vb; for (int i ...
insert
16
16
16
20
TLE
p00241
C++
Runtime Error
#ifdef __GNU_C__ #include <bits/stdc++.h> #else #include <cstdio> #include <deque> #include <iostream> #include <map> #include <memory.h> #include <sstream> #include <string> #include <vector> #endif // __GNU_C__ using namespace std; #define REP(i, max) for (int i = 0, iMax = max; i < iMax; i++) #define RREP(i, min, ...
#ifdef __GNU_C__ #include <bits/stdc++.h> #else #include <cstdio> #include <deque> #include <iostream> #include <map> #include <memory.h> #include <sstream> #include <string> #include <vector> #endif // __GNU_C__ using namespace std; #define REP(i, max) for (int i = 0, iMax = max; i < iMax; i++) #define RREP(i, min, ...
replace
27
28
27
28
-11
p00243
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> #define F first #define S second using namespace std; typedef pair<int, int> P; int h, w, n, ans, colc; char cmap[110][110]; bool used[110][110]; static const int dx[4] = {0, 1, 0, -1}; static const int dy[4] = {1, 0, -1, 0}; void display() {...
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> #define F first #define S second using namespace std; typedef pair<int, int> P; int h, w, n, ans, colc; char cmap[110][110]; bool used[110][110]; static const int dx[4] = {0, 1, 0, -1}; static const int dy[4] = {1, 0, -1, 0}; void display() {...
insert
57
57
57
59
TLE
p00243
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, -1, 0, 1}; int H, W; int fld[10][10]; int lim; bool change(int y, int x, int c, int f) { fld[y][x] = c; int cnt = 1; for (int d = 0; d < 4; d++) { int ny = y + dy[d], nx = x + dx[d]; if (ny < 0 || ny >= H ...
#include <bits/stdc++.h> using namespace std; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, -1, 0, 1}; int H, W; int fld[10][10]; int lim; bool change(int y, int x, int c, int f) { fld[y][x] = c; int cnt = 1; for (int d = 0; d < 4; d++) { int ny = y + dy[d], nx = x + dx[d]; if (ny < 0 || ny >= H ...
replace
39
40
39
40
TLE
p00243
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using nam...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using nam...
replace
125
126
125
126
TLE
p00243
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <vector> using namespace std; int W, H; int field[20][20]; int field2[21][21]; int res; const int dy[] = {-1, 0, 0, 1}; const int dx[] = {0, -1, 1, 0}; bool used[101][101]; int lim; void fillField(int cy, int cx, int oldc, int newc, bool &ok, bool ...
#include <algorithm> #include <cstring> #include <iostream> #include <vector> using namespace std; int W, H; int field[20][20]; int field2[21][21]; int res; const int dy[] = {-1, 0, 0, 1}; const int dx[] = {0, -1, 1, 0}; bool used[101][101]; int lim; void fillField(int cy, int cx, int oldc, int newc, bool &ok, bool ...
replace
41
42
41
42
TLE
p00243
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; typedef long long ll; const int INF = 1 << 25; int ans; int b[10][10]; int W, H; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; bool in(int x, int y) { return 0 <= x && x < W && 0 <= y && y < H; } void copy_board(int ...
#include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; typedef long long ll; const int INF = 1 << 25; int ans; int b[10][10]; int W, H; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; bool in(int x, int y) { return 0 <= x && x < W && 0 <= y && y < H; } void copy_board(int ...
replace
46
47
46
47
TLE
p00243
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
replace
90
91
90
91
TLE
p00243
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; const int MAX_W = 10; int w, h, ans; bool memo[MAX_W][MAX_W]; int dx[4] = {0, 0, -1, 1}; int dy[4] = {-1, 1, 0, 0}; char C[3] = {'R', 'G', 'B'}; int c_to_n[256] = {0}; void debug...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; const int MAX_W = 10; int w, h, ans; bool memo[MAX_W][MAX_W]; int dx[4] = {0, 0, -1, 1}; int dy[4] = {-1, 1, 0, 0}; char C[3] = {'R', 'G', 'B'}; int c_to_n[256] = {0}; void debug...
replace
41
42
41
42
TLE
p00244
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P;...
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P;...
insert
92
92
92
93
TLE
p00246
C++
Time Limit Exceeded
#include <iostream> using namespace std; int a[11], da[43][11], dn[43], h, v, n, f, an, z; int list(int n, int k, int g) { int i; if (k == 10 && n == h) { for (i = 0; i < h; i++) da[v][a[i]]++; dn[v] = h; v++; } if (n == h || k >= 10) return 1; for (i = g; i < 10; i++) { a[n] = i; ...
#include <iostream> using namespace std; int a[11], da[43][11], dn[43], h, v, n, f, an, z; int list(int n, int k, int g) { int i; if (k == 10 && n == h) { for (i = 0; i < h; i++) da[v][a[i]]++; dn[v] = h; v++; } if (n == h || k >= 10) return 1; for (i = g; i < 10; i++) { a[n] = i; ...
replace
66
67
66
84
TLE
p00246
C++
Memory 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 <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #incl...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #incl...
replace
162
163
162
163
MLE
p00246
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; // int N; // int MS[101]; // vector<map<char,char> > howToGet; // map<map<char,char>,char> dp[43]; // void dfs(const int kind,int wgt,map<char,char> v){ // if(kind==0){ // map<char,...
#include <algorithm> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; // int N; // int MS[101]; // vector<map<char,char> > howToGet; // map<map<char,char>,char> dp[43]; // void dfs(const int kind,int wgt,map<char,char> v){ // if(kind==0){ // map<char,...
replace
159
169
159
174
TLE
p00247
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; const int MAXH = 13; const int MAXW = 13; const int di[] = {0, 1, 0, -1}; const int dj[] = {1, 0, -1, 0}; const int INF = 1 << 28; int W, H; char G[MAXH][MAXW]; int si, sj, ti, tj; int N; int ice[MAXH][MAXW]; int ans; boo...
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; const int MAXH = 13; const int MAXW = 13; const int di[] = {1, 0, -1, 0}; const int dj[] = {0, 1, 0, -1}; const int INF = 1 << 28; int W, H; char G[MAXH][MAXW]; int si, sj, ti, tj; int N; int ice[MAXH][MAXW]; int ans; boo...
replace
8
10
8
10
TLE
p00247
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXI...
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXI...
replace
55
57
55
58
TLE
p00247
C++
Time Limit Exceeded
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; const int INF = 1 << 29; const double EPS = ...
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; const int INF = 1 << 29; const double EPS = ...
insert
76
76
76
78
TLE
p00247
C++
Memory Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; typedef pair<int, int> pii; int H, W; int sy, sx, gy, gx; char field[101][101]; int ice; int iceNumber[101][101]; // iceごとのタイル数 int tileNum[101]; bool used[101][101]; const int dy[] = {-1,...
#include <algorithm> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; typedef pair<int, int> pii; int H, W; int sy, sx, gy, gx; char field[101][101]; int ice; int iceNumber[101][101]; // iceごとのタイル数 int tileNum[101]; bool used[101][101]; const int dy[] = {-1,...
insert
69
69
69
71
MLE
p00247
C++
Time Limit Exceeded
#include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; int W, H, SX, SY, GX, GY, ice_N; int field[14][14], ice[14][14], icelife[1000]; bool flag[14][14]; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; void dfs(int x, int y); bool iddfs(int x, int y, int c); int main() { ...
#include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; int W, H, SX, SY, GX, GY, ice_N; int field[14][14], ice[14][14], icelife[1000]; bool flag[14][14]; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; void dfs(int x, int y); bool iddfs(int x, int y, int c); int main() { ...
insert
87
87
87
99
TLE
p00247
C++
Time Limit Exceeded
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; const int INF = 1 << 29; const double EPS = ...
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; const int INF = 1 << 29; const double EPS = ...
replace
76
82
76
85
TLE
p00248
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> G[10000]; bool used[100000]; bool dfs(int v, int p) { used[v] = true; bool ret = true; for (int i = 0; i < G[v].size(); i++) { int to = G[v][i]; if (to == p) continue; if (used[to]) return false; ret &= dfs(to, v); ...
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> G[100000]; bool used[100000]; bool dfs(int v, int p) { used[v] = true; bool ret = true; for (int i = 0; i < G[v].size(); i++) { int to = G[v][i]; if (to == p) continue; if (used[to]) return false; ret &= dfs(to, v);...
replace
4
5
4
5
0
p00249
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) #define EPS (1e-8) #define equals(a, b) (fabs((a) - (b)) < EPS) #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK 2 #define ONLINE_FRONT -2 #define ON_SEGMENT 0 using namespace std; class Point...
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define EPS (1e-8) #define equals(a, b) (fabs((a) - (b)) < EPS) #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK 2 #define ONLINE_FRONT -2 #define ON_SEGMENT 0 using namespace std; class Point...
replace
354
355
354
355
0
p00249
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <iomanip> #include <iostream> #include <utility> #include <vector> using namespace std; typedef double D; typedef complex<D> P; const D EPS = 1e-8; D calc(const vector<P> &plg, D v) { int n = plg.size(); int lt...
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <iomanip> #include <iostream> #include <utility> #include <vector> using namespace std; typedef double D; typedef complex<D> P; const D EPS = 1e-8; D calc(const vector<P> &plg, D v) { int n = plg.size(); int lt...
replace
39
40
39
40
0
p00249
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) #define EPS (1e-8) #define equals(a, b) (fabs((a) - (b)) < EPS) #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK 2 #define ONLINE_FRONT -2 #define ON_SEGMENT 0 using namespace std; class Point...
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define EPS (1e-8) #define equals(a, b) (fabs((a) - (b)) < EPS) #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK 2 #define ONLINE_FRONT -2 #define ON_SEGMENT 0 using namespace std; class Point...
replace
254
256
254
255
0
p00250
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, m; while (cin >> n >> m, n | m) { vector<int> scone(n); for (auto &i : scone) cin >> i; vector<int> sum = {0}; for (auto i : scone) sum.push_back((sum.back() + (i % m)) % m); int answer = 0; set<int> used = {m}; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; while (cin >> n >> m, n | m) { vector<int> scone(n); for (auto &i : scone) cin >> i; vector<int> sum = {0}; for (auto i : scone) sum.push_back((sum.back() + (i % m)) % m); int answer = 0; set<int> used = {m}; ...
replace
16
19
16
17
TLE
p00252
C++
Runtime Error
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", b1, b2, b3); if (b1 == 0 && b2 == 0 && b3 == 1) printf("Open\n"); else printf("Close\n"); return 0; }
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1 && b2 == 1 || b3 == 1) printf("Open\n"); else printf("Close\n"); return 0; }
replace
3
5
3
5
-11
p00253
C++
Runtime Error
#include <stdio.h> int main(void) { int x, n, h[101], r[10], s[99], i, j, flg; while (1) { flg = 0; scanf("%d", &n); if (n == 0) break; for (i = 0; i < n + 1; i++) { scanf("%d", &h[i]); } for (i = 0; i < n + 1; i++) { for (j = 0; j < n; j++) { if (j >= i) { ...
#include <stdio.h> int main(void) { int x, n, h[101], r[100], s[99], i, j, flg; while (1) { flg = 0; scanf("%d", &n); if (n == 0) break; for (i = 0; i < n + 1; i++) { scanf("%d", &h[i]); } for (i = 0; i < n + 1; i++) { for (j = 0; j < n; j++) { if (j >= i) { ...
replace
2
3
2
3
0
p00253
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, a, c, j; int b[105]; int s[105]; int i = 0; while (cin >> n && n) { n++; for (j = 0; j < n; j++) { cin >> b[j]; } c = b[1] - b[0]; for (j = 1; j < n - 1; j++) { if (c != b[j + 1] - b[j]) { if (j == 1) { ...
#include <iostream> using namespace std; int main() { int n, a, c, j; int b[105]; int s[505]; int i = 0; while (cin >> n && n) { n++; for (j = 0; j < n; j++) { cin >> b[j]; } c = b[1] - b[0]; for (j = 1; j < n - 1; j++) { if (c != b[j + 1] - b[j]) { if (j == 1) { ...
replace
5
6
5
6
0
p00253
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; typedef pair<int, int> pii; #define rep(i, j) for (int i = 0; i < (j); i++) #define reps(i,...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; typedef pair<int, int> pii; #define rep(i, j) for (int i = 0; i < (j); i++) #define reps(i,...
insert
25
25
25
27
TLE
p00253
C++
Runtime Error
#include <iostream> using namespace std; int n, h[100]; int ans[500], cor = 0; int main() { int i, j; while (cin >> n) { if (n == 0) break; n++; for (i = 0; i < n; i++) cin >> h[i]; // 雑草を抜いたら等差数列になるかも… int before, now, d; bool flag; for (i = 0; i < n; i++) { flag = fa...
#include <iostream> using namespace std; int n, h[101]; int ans[500], cor = 0; int main() { int i, j; while (cin >> n) { if (n == 0) break; n++; for (i = 0; i < n; i++) cin >> h[i]; // 雑草を抜いたら等差数列になるかも… int before, now, d; bool flag; for (i = 0; i < n; i++) { flag = fa...
replace
3
4
3
4
0
p00253
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < ...
replace
26
27
26
27
0
p00253
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { for (int n; cin >> n && n;) { vector<int> l(n); for (int i = 0; i <= n; i++) cin >> l[i]; for (int s = 0; s <= n; s++) { int diff = INT_MAX; for (int i = s ? 1 : 2; i <= n; i++) { if (i == s) continue; ...
#include <bits/stdc++.h> using namespace std; int main() { for (int n; cin >> n && n;) { vector<int> l(n + 1); for (int i = 0; i <= n; i++) cin >> l[i]; for (int s = 0; s <= n; s++) { int diff = INT_MAX; for (int i = s ? 1 : 2; i <= n; i++) { if (i == s) continue; ...
replace
5
6
5
6
0
p00253
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
replace
53
54
53
54
0
p00254
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; 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" stri...
#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" stri...
replace
15
16
15
16
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int func2(int *temp) { int n = 0; n += (temp[0] * 1000); n += (temp[1] * 100); n += (temp[2] * 10); n += temp[3]; return n; } int main() { while (true) { int N = 0, Nm[4] = {0}; unsigned int ...
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int func2(int *temp) { int n = 0; n += (temp[0] * 1000); n += (temp[1] * 100); n += (temp[2] * 10); n += temp[3]; return n; } int main() { while (true) { int N = 0, Nm[4] = {0}; unsigned int ...
replace
39
40
39
40
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <sstream> #include <string> using namespace std; template <class F, class T> void convert(const F &f, T &t) { stringstream ss; ss << f; ss >> t; } int main() { int x, a, b; string s; while (scanf("%d", &x), x) { if (x % 1111 == 0) { puts("NA"); ...
#include <algorithm> #include <cstdio> #include <sstream> #include <string> using namespace std; template <class F, class T> void convert(const F &f, T &t) { stringstream ss; ss << f; ss >> t; } int main() { int x, a, b; string s; while (scanf("%d", &x), x) { if (x % 1111 == 0) { puts("NA"); ...
insert
22
22
22
23
TLE
p00254
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(a) (a).begin(), (a).end() #define pb push_back vector<int> solve(vector<int> a, vector<int> b) { string x, y; rep(i, a.size()) { x += '0' + a[i]; } rep(i, b.size()) { y += '0' + b[i]...
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(a) (a).begin(), (a).end() #define pb push_back vector<int> solve(vector<int> a, vector<int> b) { string x, y; rep(i, a.size()) { x += '0' + a[i]; } rep(i, b.size()) { y += '0' + b[i]...
insert
16
16
16
19
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; int main() { int cnt, a, b; char num[5]; while (1) { cin >> num; cnt = 0; if (strcmp(num, "0000") == 0) break; if (num[0] == num[1] && num[1] == num[2] && num[2] == num[3]) ...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; int main() { int cnt, a, b; char num[5]; while (1) { cin >> num; cnt = 0; if (strcmp(num, "0000") == 0) break; if (num[0] == num[1] && num[1] == num[2] && num[2] == num[3]) ...
replace
28
29
28
29
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <sstream> #include <stdlib.h> #include <string> using namespace std; void solve() { string str; while (cin >> str) { if (str == "0000") { break; } else if (atoi(str.c_str()) % 1111 == 0) { cout << "NA" << endl; continue; } int cou...
#include <algorithm> #include <iostream> #include <sstream> #include <stdlib.h> #include <string> using namespace std; void solve() { string str; while (cin >> str) { if (str == "0000") { break; } else if (atoi(str.c_str()) % 1111 == 0) { cout << "NA" << endl; continue; } int cou...
insert
29
29
29
37
TLE
p00254
C++
Time Limit Exceeded
#include <cassert> #include <ccomplex> #include <cctype> #include <cerrno> #include <cfenv> #include <cfloat> #include <cinttypes> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstdbool> #include <cstddef> #include <cstdint>...
#include <cassert> #include <ccomplex> #include <cctype> #include <cerrno> #include <cfenv> #include <cfloat> #include <cinttypes> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstdbool> #include <cstddef> #include <cstdint>...
insert
177
177
177
181
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <sstream> #include <string> const std::string answer = "6174"; int main() { std::string in_str; std::cin >> in_str; int L, S; int i; while (in_str[0] != '0' || in_str[1] != '0' || in_str[2] != '0' || in_str[3] != '0') { if (in_str[0] != in_str[1...
#include <algorithm> #include <iostream> #include <sstream> #include <string> const std::string answer = "6174"; int main() { std::string in_str; std::cin >> in_str; int L, S; int i; while (in_str[0] != '0' || in_str[1] != '0' || in_str[2] != '0' || in_str[3] != '0') { if (in_str[0] != in_str[1...
insert
34
34
34
37
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cstring> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int toInt(string s) { stringstream ss(s); int ret; ss >> ret; return ret; } string toStr(int n) { stringstream ss; ss << n; return ss....
#include <algorithm> #include <climits> #include <cstring> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int toInt(string s) { stringstream ss(s); int ret; ss >> ret; return ret; } string toStr(int n) { stringstream ss; ss << n; return ss....
replace
28
29
28
30
TLE
p00254
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define FOR(v, a, b) for (int v = (a); v < (b); ++v) #define REP(v, n) FOR(v, 0, n) #define UNWORDS(vec, str) \ for (int i = 0; i < (vec).size(); ++i) \ cout << (i ? str : "") << (vec)[i] #define UNLI...
#include <bits/stdc++.h> #define FOR(v, a, b) for (int v = (a); v < (b); ++v) #define REP(v, n) FOR(v, 0, n) #define UNWORDS(vec, str) \ for (int i = 0; i < (vec).size(); ++i) \ cout << (i ? str : "") << (vec)[i] #define UNLI...
replace
31
32
31
32
TLE
p00254
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { bool f = false; for (auto i : str) if (i != '0') f = true; if (!f) break; f = false; for (auto i : str) if (i != str[0]) f = true; if (!f) { cout << "NA" <<...
#include <bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { bool f = false; for (auto i : str) if (i != '0') f = true; if (!f) break; f = false; for (auto i : str) if (i != str[0]) f = true; if (!f) { cout << "NA" <<...
insert
47
47
47
49
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <cstdlib> #include <iostream> #include <sstream> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { string s; while (cin >> s) { if (s == "0000") break; b...
#include <algorithm> #include <cstdlib> #include <iostream> #include <sstream> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { string s; while (cin >> s) { if (s == "0000") break; b...
replace
41
42
41
45
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, j) FOR(i, 0, j) #define mp std::make_pair const int INF = 1 << 24; const ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, j) FOR(i, 0, j) #define mp std::make_pair const int INF = 1 << 24; const ...
insert
37
37
37
40
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <functional> #include <iostream> #include <string> using namespace std; int main() { string S; while (true) { cin >> S; if (S == "0000") { break; } if (S[0] == S[1] == S[2] == S[3]) { cout << "NA" << endl; } else { int count_ = 0; while...
#include <algorithm> #include <functional> #include <iostream> #include <string> using namespace std; int main() { string S; while (true) { cin >> S; if (S == "0000") { break; } if (S[0] == S[1] && S[1] == S[2] && S[2] == S[3]) { cout << "NA" << endl; } else { int count_ =...
replace
17
18
17
18
TLE
p00254
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; string S; int a[4], b, cnt; int main() { while (true) { cin >> S; if (S == "0000") { break; } if (S[0] == S[1] && S[2] == S[3] && S[1] == S[2]) { cout << "NA" << endl; } else { b = st...
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; string S; int a[4], b, cnt; int main() { while (true) { cin >> S; if (S == "0000") { break; } if (S[0] == S[1] && S[2] == S[3] && S[1] == S[2]) { cout << "NA" << endl; } else { b = st...
replace
25
26
25
26
TLE
p00254
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; // #define int long long #define DBG 1 #define dump(o) \ if (DBG) { \ cerr << #o << " " << o << endl; ...
#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; // #define int long long #define DBG 1 #define dump(o) \ if (DBG) { \ cerr << #o << " " << o << endl; ...
insert
44
44
44
46
TLE
p00254
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; string toString(int n) { string ret = ""; while (n) { ret += (n % 10) + '0'; n /= 10; } reverse(ret.begin(), ret.end()); return ret; } int main() { string s; while (cin >> s) { if (s == "0000") break; if (s[0] == s[1] && s[1] == s[2] ...
#include <bits/stdc++.h> using namespace std; string toString(int n) { string ret = ""; while (n) { ret += (n % 10) + '0'; n /= 10; } while (ret.size() < 4) ret += "0"; reverse(ret.begin(), ret.end()); return ret; } int main() { string s; while (cin >> s) { if (s == "0000") brea...
insert
9
9
9
11
TLE