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
p02289
C++
Time Limit Exceeded
#include <iostream> #include <set> int main() { std::multiset<int> S; while (1) { std::string Command; std::cin >> Command; if (Command[0] == 'i') { int Value; std::cin >> Value; S.insert(Value); } else if (Command[1] == 'x') { std::set<int>::reverse_iterator It = S.rbegin()...
#include <iostream> #include <set> int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); std::multiset<int> S; while (1) { std::string Command; std::cin >> Command; if (Command[0] == 'i') { int Value; std::cin >> Value; S.insert(Value); } else if (Command[1] == 'x') ...
insert
4
4
4
6
TLE
p02289
C++
Runtime Error
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; #define INFTY (1 << 30) #define MAX 500000 int N = 0; int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int parent(int i) { return i / 2; } int maxOf3Node(int data[], int base) { int l = left(base); int r = rig...
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; #define INFTY (1 << 30) #define MAX 2000000 int N = 0; int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int parent(int i) { return i / 2; } int maxOf3Node(int data[], int base) { int l = left(base); int r = ri...
replace
5
6
5
6
0
p02289
C++
Time Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS #include <cassert> #include <cstddef> #include <functional> #include <memory> #include <type_traits> #include <utility> template <class TotallyOrderedSet> class pairing_heap { public: using set_type = TotallyOrderedSet; using value_type = typename set_type::value_type; using cons...
#define _CRT_SECURE_NO_WARNINGS #include <cassert> #include <cstddef> #include <functional> #include <memory> #include <type_traits> #include <utility> template <class TotallyOrderedSet> class pairing_heap { public: using set_type = TotallyOrderedSet; using value_type = typename set_type::value_type; using cons...
replace
45
46
45
47
TLE
p02289
C++
Runtime Error
#include <cstdio> #include <queue> #include <string> using namespace std; int main() { priority_queue<int> PQ; char com[10]; int key; while (1) { if (com[0] == 'e' && com[1] == 'n') break; else if (com[0] == 'i') { scanf("%d", &key); PQ.push(key); } else { printf("%d\n", PQ...
#include <cstdio> #include <queue> #include <string> using namespace std; int main() { priority_queue<int> PQ; char com[10]; int key; while (1) { scanf("%s", com); if (com[0] == 'e' && com[1] == 'n') break; else if (com[0] == 'i') { scanf("%d", &key); PQ.push(key); } else { ...
insert
11
11
11
12
-11
p02289
C++
Time Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int num = 2000000; int a[num]; int h; inline int pa(int i) { return i / 2; } void maxHeapify(int i) { int l = i * 2; int r = i * 2 + 1; int lg; if (l <= h && a[i] < a[l])...
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int num = 2000000; int a[num]; int h; inline int pa(int i) { return i / 2; } void maxHeapify(int i) { int l = i * 2; int r = i * 2 + 1; int lg; if (l <= h && a[i] < a[l])...
replace
29
33
29
32
TLE
p02289
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; void maxHeap(vector<ll> &h, int i) { int left = i * 2 + 1; int right = i * 2 + 2; int largest = i; if (left < h.size() && h[left] > h[largest]) largest = left; if (right < h.size() && h[right] > h[largest]) largest = right; if (l...
#include <bits/stdc++.h> using namespace std; typedef long long ll; void maxHeap(vector<ll> &h, int i) { int left = i * 2 + 1; int right = i * 2 + 2; int largest = i; if (left < h.size() && h[left] > h[largest]) largest = left; if (right < h.size() && h[right] > h[largest]) largest = right; if (l...
replace
64
65
64
65
TLE
p02289
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstdlib> int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } void maxHeapify(int *A, int i, int n) { int l_idx, r_idx, temp; l_idx = left(i + 1) - 1; r_idx = right(i + 1) - 1; temp = i; if (r_idx < n...
#include <algorithm> #include <cstdio> #include <cstdlib> int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } void maxHeapify(int *A, int i, int n) { int l_idx, r_idx, temp; l_idx = left(i + 1) - 1; r_idx = right(i + 1) - 1; temp = i; if (r_idx < n...
replace
45
46
45
46
0
p02289
C++
Runtime Error
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define mp...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define mp...
replace
38
39
38
39
0
p02289
C++
Time Limit Exceeded
#include <deque> #include <iostream> #include <utility> using namespace std; #define F first #define S second #define PB push_back template <class T> struct chain { deque<pair<T, chain *>> v; chain(void) {} void push(T n) { if (v.empty() || n <= v.back().F) v.PB({n, nullptr}); else if (n > v.front()...
#include <deque> #include <iostream> #include <utility> using namespace std; #define F first #define S second #define PB push_back template <class T> struct chain { deque<pair<T, chain *>> v; chain(void) {} void push(T n) { if (v.empty() || n <= v.back().F) v.PB({n, nullptr}); else if (n > v.front()...
replace
63
64
63
64
TLE
p02289
C++
Runtime Error
#include <iostream> using namespace std; void Insert(int); void Increase(int, int); int Extract(void); void maxHeapify(int i); int H[1000]; int n = 0; int main() { int key, n = 0; char ch[10]; while (1) { cin >> ch; if (ch[0] == 'i') { cin >> key; Insert(key); } else if (ch[0] == 'e' && c...
#include <iostream> using namespace std; void Insert(int); void Increase(int, int); int Extract(void); void maxHeapify(int i); int H[1000000]; int n = 0; int main() { int key, n = 0; char ch[10]; while (1) { cin >> ch; if (ch[0] == 'i') { cin >> key; Insert(key); } else if (ch[0] == 'e' &...
replace
6
7
6
7
0
p02289
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; int N; int H[2000001]; int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int parent(int i) { return i / 2; } void Maximize(int i) { int l = left(i); int r = right(i); int largest = i; if ...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; int N; int H[2000001]; int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } int parent(int i) { return i / 2; } void Maximize(int i) { int l = left(i); int r = right(i); int largest = i; if ...
replace
60
61
60
61
TLE
p02289
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int MAX = 2000000; int S[MAX + 1]; int H = 0; void maxHeapify(int A[], int n, int i) { int largest = i; int l = i * 2; int r = i * 2 + 1; if (l <= n && A[l] > A[i]) largest = l; if (r <= n && A[r]...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int MAX = 2000000; int S[MAX + 1]; int H = 0; void maxHeapify(int A[], int n, int i) { int largest = i; int l = i * 2; int r = i * 2 + 1; if (l <= n && A[l] > A[i]) largest = l; if (r <= n && A[r]...
replace
46
47
46
47
TLE
p02289
C++
Runtime Error
#include <cstdio> #include <iostream> constexpr int MAXN = 250; int Heap[MAXN + 1]; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } #define FOR(i, a, b) for (int i = (a); i < (b); i++) int n; int heapsize; void ShowHeap(int *Heap) { FOR(i, 1, heapsize +...
#include <cstdio> #include <iostream> constexpr int MAXN = 2000000; int Heap[MAXN + 1]; int parent(int i) { return i / 2; } int left(int i) { return i * 2; } int right(int i) { return i * 2 + 1; } #define FOR(i, a, b) for (int i = (a); i < (b); i++) int n; int heapsize; void ShowHeap(int *Heap) { FOR(i, 1, heapsi...
replace
3
4
3
4
0
p02289
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct node { node *p, *l, *r; int cnt; void Init(node *p_) { p = p_; l = r = nullptr; cnt = 0; } }; int it; node pool[1000000]; node *new_node(node *p) { pool[it].Init(p); return &pool[it++]; } class uint_Trie { node *root; int siz; public:...
#include <bits/stdc++.h> using namespace std; struct node { node *p, *l, *r; int cnt; void Init(node *p_) { p = p_; l = r = nullptr; cnt = 0; } }; int it; node pool[2000000]; node *new_node(node *p) { pool[it].Init(p); return &pool[it++]; } class uint_Trie { node *root; int siz; public:...
replace
14
15
14
15
0
p02289
C++
Runtime Error
#include <iostream> #include <stdio.h> #define MAX_NODES 2000000 #define INFTY 2000000010 using namespace std; // think easy make easy // think stupid int n = 0; // num of nodes // iを根とするMaxヒープをつくる関数.初期状態はiを根とする二分木 void maxHeapify(int A[], int i) { // i is index of root int l, r; int largest; int tmp; l = 2...
#include <iostream> #include <stdio.h> #define MAX_NODES 2000000 #define INFTY 2000000010 using namespace std; // think easy make easy // think stupid int n = 0; // num of nodes // iを根とするMaxヒープをつくる関数.初期状態はiを根とする二分木 void maxHeapify(int A[], int i) { // i is index of root int l, r; int largest; int tmp; l = 2...
delete
64
65
64
64
0
p02289
C++
Runtime Error
#include <algorithm> #include <iostream> #define MAX 1000000 using namespace std; int n; int parent(int i); int left(int i); int right(int i); void maxHeap(int node[], int i); void buildMaxHeap(int node[]); void insert(int node[], int k); int extractMax(int node[]); int main() { int k, node[MAX]; char com[10]; ...
#include <algorithm> #include <iostream> #define MAX 2000000 using namespace std; int n; int parent(int i); int left(int i); int right(int i); void maxHeap(int node[], int i); void buildMaxHeap(int node[]); void insert(int node[], int k); int extractMax(int node[]); int main() { int k, node[MAX]; char com[10]; ...
replace
2
3
2
3
0
p02289
C++
Runtime Error
#include <iostream> #include <limits.h> #include <string> using namespace std; long int A[500000]; int n; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } void heapIncreaseKey(int i, int key) { if (key < A[i]) return; A[i] = key; while (i > 1 && A...
#include <iostream> #include <limits.h> #include <string> using namespace std; long int A[2000000]; int n; int parent(int i) { return i / 2; } int left(int i) { return 2 * i; } int right(int i) { return 2 * i + 1; } void heapIncreaseKey(int i, int key) { if (key < A[i]) return; A[i] = key; while (i > 1 && ...
replace
4
5
4
5
0
p02289
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vec...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vec...
replace
27
28
27
28
TLE
p02289
C++
Runtime Error
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define NUM 100000 #define NIL -1 int A[NUM]; int heap_n = 0; void init() { for (int i = 0; i < NUM; i++) { A[i] = NIL; } } void upHeapify(int num) { if (num == 1) { return; } if (A[num] > A[num / 2...
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define NUM 4000000 #define NIL -1 int A[NUM]; int heap_n = 0; void init() { for (int i = 0; i < NUM; i++) { A[i] = NIL; } } void upHeapify(int num) { if (num == 1) { return; } if (A[num] > A[num / ...
replace
6
7
6
7
-11
p02289
C++
Time Limit Exceeded
#include <climits> #include <iostream> #include <vector> using namespace std; class Heap { private: public: Heap() { node.push_back(0); }; void print() { long n = node.size(); for (long i = 1; i < n; ++i) cout << " " << node[i]; cout << endl; }; void insert(long num) { node.push_back(num);...
#include <climits> #include <iostream> #include <vector> using namespace std; class Heap { private: public: Heap() { node.push_back(0); }; void print() { long n = node.size(); for (long i = 1; i < n; ++i) cout << " " << node[i]; cout << endl; }; void insert(long num) { node.push_back(num);...
insert
95
95
95
98
TLE
p02289
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct H { vector<int> dat; void insert(int x) { int i = (int)dat.size(); dat.push_back(x); while (i > 0) { auto p = (i - 1) / 2; if (dat[p] < dat[i]) { swap(dat[p], dat[i]); i = p; } else...
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct H { vector<int> dat; void insert(int x) { int i = (int)dat.size(); dat.push_back(x); while (i > 0) { auto p = (i - 1) / 2; if (dat[p] < dat[i]) { swap(dat[p], dat[i]); i = p; } else...
insert
40
40
40
42
TLE
p02289
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
replace
23
24
23
24
0
p02289
C++
Runtime Error
#include <iostream> #include <queue> #include <string> using namespace std; int main() { priority_queue<int> pq; string ope; int num; cin >> ope; while (ope != "end") { if (ope == "extract") { cout << pq.top() << endl; pq.pop(); } else if (ope == "insert") { cin >> num; pq.pu...
#include <iostream> #include <queue> #include <string> using namespace std; int main() { priority_queue<int> pq; string ope; int num; cin >> ope; while (ope != "end") { if (ope == "extract") { cout << pq.top() << endl; pq.pop(); } else if (ope == "insert") { cin >> num; pq.pu...
replace
19
20
19
20
TLE
p02289
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> struct Node { int index, val; bool operator<(Node n) { return this->val > n.val; } bool operator>(Node n) { return this->val < n.val; } Node() { this->index = 0; } }; class Min_heap { private: Node **n; //????????????????????? int N; //????°???...
#include <algorithm> #include <cstdio> #include <iostream> struct Node { int index, val; bool operator<(Node n) { return this->val > n.val; } bool operator>(Node n) { return this->val < n.val; } Node() { this->index = 0; } }; class Min_heap { private: Node **n; //????????????????????? int N; //????°???...
delete
34
38
34
34
0
p02289
C++
Time Limit Exceeded
//////////////////////////////////////// // ALDS1_9_A: Complete Binary Tree // ALDS1_9_B: Maximum Heap // ALDS1_9_C: Priority Queue //////////////////////////////////////// #include <algorithm> // next_permutation #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include ...
//////////////////////////////////////// // ALDS1_9_A: Complete Binary Tree // ALDS1_9_B: Maximum Heap // ALDS1_9_C: Priority Queue //////////////////////////////////////// #include <algorithm> // next_permutation #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include ...
replace
199
200
199
200
TLE
p02289
C++
Runtime Error
// AOJ Algorithms and Data Structures I - Heaps - Priority Queue // s 2013 0913 1556 // /* [ヒープを表す配列A、ヒープのサイズ(要素数)をheap_sizeとすれば、A[1...heap_size]にヒープの要素が格納される。木の根はA[1]であり、節点の添え字iが与えられたとき、その親parent(i)、左の子left(i)、右の子right(i)は以下の式で算出される: ] と、問題文に書いてあるので、添え字0は使わず、獲得する領域も1大きくする。 add 2013 0913 1714  要素数が決まってないので、動的配列で作りたいが...
// AOJ Algorithms and Data Structures I - Heaps - Priority Queue // s 2013 0913 1556 // /* [ヒープを表す配列A、ヒープのサイズ(要素数)をheap_sizeとすれば、A[1...heap_size]にヒープの要素が格納される。木の根はA[1]であり、節点の添え字iが与えられたとき、その親parent(i)、左の子left(i)、右の子right(i)は以下の式で算出される: ] と、問題文に書いてあるので、添え字0は使わず、獲得する領域も1大きくする。 add 2013 0913 1714  要素数が決まってないので、動的配列で作りたいが...
replace
126
127
126
127
-11
p02292
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long LL; typedef unsigned long...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long LL; typedef unsigned long...
replace
320
321
320
321
TLE
p02294
C++
Time Limit Exceeded
/** * @brief 線分を扱います * @date 2016/03/20 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <algorithm> #include <complex> #include <iostream> #include <vector> //**************************************** // オブジェクト形式マクロの定義 //**********************...
/** * @brief 線分を扱います * @date 2016/03/20 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <algorithm> #include <complex> #include <iostream> #include <vector> //**************************************** // オブジェクト形式マクロの定義 //**********************...
insert
257
257
257
258
TLE
p02295
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define each(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define chmin(a, b) a = min(a, b) #define chmax(a, b) a = max(a, b) #def...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define each(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define chmin(a, b) a = min(a, b) #define chmax(a, b) a = max(a, b) #def...
delete
159
160
159
159
0
p02299
C++
Time Limit Exceeded
// be naame khodaa #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef complex<ld> PT; typedef vector<PT> Poly; typedef pair<PT, PT> LS; #define F first #define S second #define X real() #define Y imag() #define pb push_back inline int in() ...
// be naame khodaa #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef complex<ld> PT; typedef vector<PT> Poly; typedef pair<PT, PT> LS; #define F first #define S second #define X real() #define Y imag() #define pb push_back inline int in() ...
replace
168
171
168
172
TLE
p02299
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <vector> using namespace std; enum POSITION { ONLINE_BACK = -2, CCW = -1, ON_SEGMENT = 0, CW = 1, ONLINE_FRONT = 2 }; struct Point { long x; long y; Point(long x, long y) : x(x), y(y) {} Point() {} Point operator-(Point p) { return Point(x - p.x, y - p...
#include <cmath> #include <iostream> #include <vector> using namespace std; enum POSITION { ONLINE_BACK = -2, CCW = -1, ON_SEGMENT = 0, CW = 1, ONLINE_FRONT = 2 }; struct Point { long x; long y; Point(long x, long y) : x(x), y(y) {} Point() {} Point operator-(Point p) { return Point(x - p.x, y - p...
replace
77
78
77
78
TLE
p02300
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <vector> using namespace std; class Point { public: int x, y; Point(int a = 0, int b = 0) { int x = a; int y = b; }; bool operator<(const Point &p) const { return y < p.y || (y == p.y && x < p.x); } }; inline bool direct(Point &base, Point &a, Poin...
#include <algorithm> #include <cstdio> #include <vector> using namespace std; class Point { public: int x, y; Point(int a = 0, int b = 0) { int x = a; int y = b; }; bool operator<(const Point &p) const { return y < p.y || (y == p.y && x < p.x); } }; inline bool direct(Point &base, Point &a, Poin...
replace
25
26
25
26
0
p02300
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // 节点从0到n-1 #define maxn 50006 struct node { double x, y; }; int n; // 有多少个点 int tot; // 凸包上的点 node p[maxn]; // 所有点数组从0开始 node P[maxn]; // 凸包上的点 const double pi = acos(-1.0); // 三点差积 double X(node A, node B, node C) { return (B.x - A.x) * (C.y - A.y) - (C.x ...
#include <bits/stdc++.h> using namespace std; // 节点从0到n-1 #define maxn 100006 struct node { double x, y; }; int n; // 有多少个点 int tot; // 凸包上的点 node p[maxn]; // 所有点数组从0开始 node P[maxn]; // 凸包上的点 const double pi = acos(-1.0); // 三点差积 double X(node A, node B, node C) { return (B.x - A.x) * (C.y - A.y) - (C.x...
replace
3
4
3
4
0
p02300
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define sz(a) (int)a.size() #define de(c) cout << #c << " = " << c << endl #define dd(c)...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define sz(a) (int)a.size() #define de(c) cout << #c << " = " << c << endl #define dd(c)...
replace
84
85
84
85
0
p02300
C++
Runtime Error
// 凸包 #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <stack> #include <vector> #include <cassert> #include <queue> using namespace std; // 浮動小数点のゼロ判定 #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) // 点を表すクラス class Point { ...
// 凸包 #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <stack> #include <vector> #include <cassert> #include <queue> using namespace std; // 浮動小数点のゼロ判定 #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) // 点を表すクラス class Point { ...
insert
112
112
112
113
0
p02300
C++
Runtime Error
#include <algorithm> #include <complex> #include <iostream> #include <vector> #define push push_back #define sz stack.size() #define m make_pair #define N_MAX 10001 #define x second #define y first using namespace std; typedef complex<int> point; typedef pair<int, int> P; bool ccw(point p0, point p1, point p2) { poi...
#include <algorithm> #include <complex> #include <iostream> #include <vector> #define push push_back #define sz stack.size() #define m make_pair #define N_MAX 100001 #define x second #define y first using namespace std; typedef complex<int> point; typedef pair<int, int> P; bool ccw(point p0, point p1, point p2) { po...
replace
7
8
7
8
0
p02301
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #define EPS 1e-10 using namespace std; typedef long long ll; struct Point { double x, y; Point(int x = 0, int y = 0) : x(x), y(y) {} Point operator+(Point p) { return Point(x + p.x, y + p.y); } Point...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #define EPS 1e-10 using namespace std; typedef long long ll; struct Point { double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} Point operator+(Point p) { return Point(x + p.x, y + p.y); } ...
replace
11
12
11
12
TLE
p02301
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef vector<P> vec; namespace std { bool operator<(const P &a, const P &b) { return (a.imag() == b.imag() ? a.real() < b.real() : a.imag() < b.imag()); } }; // namespace std double eps = 1e-8; double PI = acos(-1); bool eq(double a, double...
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef vector<P> vec; namespace std { bool operator<(const P &a, const P &b) { return (a.imag() == b.imag() ? a.real() < b.real() : a.imag() < b.imag()); } }; // namespace std double eps = 1e-8; double PI = acos(-1); bool eq(double a, double...
replace
159
160
159
160
TLE
p02302
C++
Runtime Error
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <stack> #include <vector> using Number = double; const Number EPS = 1e-10; const Number INF = 1e10; const Number PI = acos(-1.0); inline int sign(Number x) { return (x < -EPS) ? -1 : (x > EPS) ? ...
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <stack> #include <vector> using Number = double; const Number EPS = 1e-10; const Number INF = 1e10; const Number PI = acos(-1.0); inline int sign(Number x) { return (x < -EPS) ? -1 : (x > EPS) ? ...
replace
516
517
516
521
0
p02302
C++
Runtime Error
//{{{ #include <bits/stdc++.h> using namespace std; // types typedef long long ll; typedef pair<int, int> pii; // input bool SR(int &_x) { return scanf("%d", &_x) == 1; } bool SR(ll &_x) { return scanf("%lld", &_x) == 1; } bool SR(double &_x) { return scanf("%lf", &_x) == 1; } bool SR(char *_s) { return scanf("%s", _s)...
//{{{ #include <bits/stdc++.h> using namespace std; // types typedef long long ll; typedef pair<int, int> pii; // input bool SR(int &_x) { return scanf("%d", &_x) == 1; } bool SR(ll &_x) { return scanf("%lld", &_x) == 1; } bool SR(double &_x) { return scanf("%lf", &_x) == 1; } bool SR(char *_s) { return scanf("%s", _s)...
insert
183
183
183
187
0
p02302
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define trav(a, x) for (auto &a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; template <class T> struct Point { typedef Po...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define trav(a, x) for (auto &a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; template <class T> struct Point { typedef Po...
insert
64
64
64
66
0
p02303
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <random> #include <unordered_map> #include <utility> using namespace std; struct Point { double x, y; Point *next; }; uint64_t toKey(int x, int y) { union Key { uint64_t key; int x[2]; }; Key K; K.x[0] = x, K.x[1] = y; return K....
#include <algorithm> #include <cmath> #include <iostream> #include <random> #include <unordered_map> #include <utility> using namespace std; struct Point { double x, y; Point *next; }; uint64_t toKey(int x, int y) { union Key { uint64_t key; int x[2]; }; Key K; K.x[0] = x, K.x[1] = y; return K....
replace
92
93
92
93
TLE
p02303
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define MAX_N 100000 const double INF = 1e50; typedef pair<double, double> P; int N; P A[MAX_N]; bool compare_y(const P &a, const P &b) { return a.second < b.second; } double closest_pair(P *a, int n) { if (n <= 1) return INF; int m = n / 2; double x = a[m]....
#include <bits/stdc++.h> using namespace std; #define MAX_N 100000 const double INF = 1e50; typedef pair<double, double> P; int N; P A[MAX_N]; bool compare_y(const P &a, const P &b) { return a.second < b.second; } double closest_pair(P *a, int n) { if (n <= 1) return INF; int m = n / 2; double x = a[m]....
replace
24
25
24
25
TLE
p02303
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <vector> using namespace std; typedef pair<double, double> pp; vector<pp> a; #define sqr(x) ((x) * (x)) double Plus(double x) { return x < 0 ? -x : x; } double dist(pp x, pp y) { return sqr(x.first - y.first) + sqr(x.second - y.seco...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <vector> using namespace std; typedef pair<double, double> pp; vector<pp> a; #define sqr(x) ((x) * (x)) double Plus(double x) { return x < 0 ? -x : x; } double dist(pp x, pp y) { return sqr(x.first - y.first) + sqr(x.second - y.seco...
insert
33
33
33
35
TLE
p02304
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 10; struct point { int x, y; point() {} point(int x, int y) : x(x), y(y) {} }; struct segment { point a, b; int c; // 用于排序,bottom>(left||right)>top segment(point a, point b, int c) : a(a), b(b), c(c) {} bool op...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 10; struct point { int x, y; point() {} point(int x, int y) : x(x), y(y) {} }; struct segment { point a, b; int c; // 用于排序,bottom>(left||right)>top segment(point a, point b, int c) : a(a), b(b), c(c) {} bool op...
replace
27
28
27
28
0
p02304
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> #include <set> #include <vector> using namespace std; struct Point { double x, y; }; struct Segment { Point p1, p2; }; #define BOTTOM 0 #define LEFT 1 #define RIGHT 2 #define TOP 3 class EndPoint { public: Point p; int seg, st; EndPoint() {} En...
#include <algorithm> #include <cstdio> #include <iostream> #include <set> #include <vector> using namespace std; struct Point { double x, y; }; struct Segment { Point p1, p2; }; #define BOTTOM 0 #define LEFT 1 #define RIGHT 2 #define TOP 3 class EndPoint { public: Point p; int seg, st; EndPoint() {} En...
replace
43
44
43
44
TLE
p02304
C++
Runtime Error
// 線分の交差問題 #include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <stack> #include <queue> #include <set> #include <vector> using namespace std; // 浮動小数点のゼロ判定 #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) // 点を...
// 線分の交差問題 #include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <stack> #include <queue> #include <set> #include <vector> using namespace std; // 浮動小数点のゼロ判定 #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) // 点を...
replace
90
92
90
92
0
p02305
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include ...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include ...
replace
183
188
183
186
TLE
p02308
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; #define eps (1e-10) struct Point { double x, y; Point() {} Point(double x, double y) : x(x), y(y) {} Point...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; #define eps (1e-10) struct Point { double x, y; Point() {} Point(double x, double y) : x(x), y(y) {} Point...
replace
63
67
63
68
0
p02308
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef complex<double> V; typedef vector<P> vecP; typedef pair<P, P> L; typedef pair<P, P> S; typedef pair<P, double> C; const double eps = 1e-8; const double PI = acos(-1); const double PI2 = PI * 2.0; namespace std { bool operator<(const P &a,...
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef complex<double> V; typedef vector<P> vecP; typedef pair<P, P> L; typedef pair<P, P> S; typedef pair<P, double> C; const double eps = 1e-8; const double PI = acos(-1); const double PI2 = PI * 2.0; namespace std { bool operator<(const P &a,...
replace
430
431
430
431
0
p02312
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const double EPS = 1e-8, PI = acos(-1); inline bool eq(double a, double b) { return fabs(b - a) < EPS; } using Point = complex<double>; Point operator*(const Point &p, const double &d) { return Point(real(p) * d, imag(p) * d); } istream &operator>>(istream &is, Poin...
#include <bits/stdc++.h> using namespace std; const double EPS = 1e-8, PI = acos(-1); inline bool eq(double a, double b) { return fabs(b - a) < EPS; } using Point = complex<double>; Point operator*(const Point &p, const double &d) { return Point(real(p) * d, imag(p) * d); } istream &operator>>(istream &is, Poin...
replace
260
261
260
261
0
p02312
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef complex<double> V; typedef vector<P> vecP; typedef pair<P, P> L; typedef pair<P, P> S; typedef pair<P, double> C; const double eps = 1e-8; const double PI = acos(-1); const double PI2 = PI * 2.0; namespace std { bool operator<(const P &a,...
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef complex<double> V; typedef vector<P> vecP; typedef pair<P, P> L; typedef pair<P, P> S; typedef pair<P, double> C; const double eps = 1e-8; const double PI = acos(-1); const double PI2 = PI * 2.0; namespace std { bool operator<(const P &a,...
replace
370
371
370
372
-6
9360ca0c-b548-4ded-a6b1-a6b7f2e3d558.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02312/C++/s412921055.cpp:380: double getArea(C, P, P): Assertion `!u.empty()' failed.
p02312
C++
Runtime Error
#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; typedef ld Weight; struct Edge { int src, dest; int cap, rev; Weight weight; bool operator<(const Edge &rhs) const { return weight > rhs.w...
#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; typedef ld Weight; struct Edge { int src, dest; int cap, rev; Weight weight; bool operator<(const Edge &rhs) const { return weight > rhs.w...
replace
643
645
643
645
0
p02314
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i =...
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i =...
replace
25
27
25
27
0
p02314
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef long long ll; #define mod 1000000 #define INF 10000000 int main() { int n, m; cin >> n >> m; vi C(m); for (int ...
#include <algorithm> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef long long ll; #define mod 1000000 #define INF 10000000 int main() { int n, m; cin >> n >> m; vi C(m); for (int ...
replace
25
29
25
27
TLE
p02314
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int n, m; const int MAX_N = 50000, MAX_M = 20, INF = 1000000; int c[MAX_M + 1]; int dp[MAX_M + 1][MAX_N + 2]; void solve() { for (int j = 0; j <= n; j++) { dp[0][j] = INF; } for (int i = 0; i <= m; i++) { for (int j = 1; j <= n; j++) { ...
#include <algorithm> #include <iostream> using namespace std; int n, m; const int MAX_N = 50000, MAX_M = 20, INF = 1000000; int c[MAX_M + 2]; int dp[MAX_M + 2][MAX_N + 2]; void solve() { for (int j = 0; j <= n; j++) { dp[0][j] = INF; } for (int i = 0; i <= m; i++) { for (int j = 1; j <= n; j++) { ...
replace
7
9
7
9
0
p02314
C++
Runtime Error
#include <algorithm> #include <array> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <string> #include <thread...
#include <algorithm> #include <array> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <string> #include <thread...
replace
40
41
40
41
0
p02314
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int i, j, n, m, t[10001], c[21]; cin >> n >> m; for (i = 0; i < m; i++) cin >> c[i]; for (j = 0; j <= n; j++) t[j] = 10001; t[0] = 0; for (i = 0; i < m; i++) { for (j = c[i]; j <= n; j++) { t[j] = min(t[j], t[j - ...
#include <algorithm> #include <iostream> using namespace std; int main() { int i, j, n, m, t[50001], c[21]; cin >> n >> m; for (i = 0; i < m; i++) cin >> c[i]; for (j = 0; j <= n; j++) t[j] = 10001; t[0] = 0; for (i = 0; i < m; i++) { for (j = c[i]; j <= n; j++) { t[j] = min(t[j], t[j - ...
replace
5
6
5
6
0
p02314
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { int totalValueOfShares; // target sum int size; // number of coin types cin >> totalValueOfShares >> size; vector<int> numOfShares(size); vector<int> values(totalValueOfShares); for (int i = 0; i < size; i++) { c...
#include <iostream> #include <vector> using namespace std; int main() { int totalValueOfShares; // target sum int size; // number of coin types cin >> totalValueOfShares >> size; vector<int> numOfShares(size); vector<int> values(totalValueOfShares + 1); for (int i = 0; i < size; i++) { ...
replace
13
14
13
14
0
p02314
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define vvi vector<vector<int>> #define vec vector #define pq priority_queue #define all(v) (v).begin(), (v).end() #define uniqueV(x) \ sort(x.begin(), x.end()); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define vvi vector<vector<int>> #define vec vector #define pq priority_queue #define all(v) (v).begin(), (v).end() #define uniqueV(x) \ sort(x.begin(), x.end()); ...
replace
43
44
43
44
0
p02314
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; typedef long long LL; ostream &debug = cout; /* AOJ DPL_1_A */ const int N = 25; const int M = 50005; const int INF = 0x3f3f3f3f; int n, m, a[N], dp[M]; signed main(void) { /* in...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; typedef long long LL; ostream &debug = cout; /* AOJ DPL_1_A */ const int N = 25; const int M = 60005; const int INF = 0x3f3f3f3f; int n, m, a[N], dp[M]; signed main(void) { /* in...
replace
14
15
14
15
0
p02314
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, m; int c[21]; int dp[21][50001]; int main() { cin >> n >> m; for (int i = 0; i < 21; i++) { dp[i][0] = 0; } for (int i = 0; i < 21; i++) { for (int k = 1; k < 50001; k++) { dp[i][k] = 20000; } } for (int i = 1; i <= m; i++) { cin >>...
#include <bits/stdc++.h> using namespace std; int n, m; int c[21]; int dp[21][50001]; int main() { cin >> n >> m; for (int i = 0; i < 21; i++) { dp[i][0] = 0; } for (int i = 0; i < 21; i++) { for (int k = 1; k < 50001; k++) { dp[i][k] = 20000; } } for (int i = 1; i <= m; i++) { cin >>...
replace
20
21
20
21
0
p02314
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; #define MAX_NUM_COINS 20 #define MAX_PRICE 50000 #define CALC_MIN(a, b) (a < b ? a : b) int coin[MAX_NUM_COINS]; int memo[MAX_NUM_COINS][MAX_PRICE + 1]; int is_less_than(const void *a, const void *b)...
#include <algorithm> #include <climits> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; #define MAX_NUM_COINS 20 #define MAX_PRICE 50000 #define CALC_MIN(a, b) (a < b ? a : b) int coin[MAX_NUM_COINS]; int memo[MAX_NUM_COINS][MAX_PRICE + 1]; int is_less_than(const void *a, const void *b)...
insert
24
24
24
28
TLE
p02314
C++
Runtime Error
#include <iostream> // #define int long long #define SIZE 21 #define VALUE 10001 const int infty = 999; // #define _DEBUG using namespace std; int N, M, Cs[SIZE], T[SIZE][VALUE]; int solve() { for (int i = 0; i <= M; i++) { for (int n = 0; n <= N; n++) { if (n == 0) { T[i][n] = 0; } else if (i...
#include <iostream> // #define int long long #define SIZE 21 #define VALUE 50001 const int infty = 99999; // #define _DEBUG using namespace std; int N, M, Cs[SIZE], T[SIZE][VALUE]; int solve() { for (int i = 0; i <= M; i++) { for (int n = 0; n <= N; n++) { if (n == 0) { T[i][n] = 0; } else if ...
replace
3
5
3
5
0
p02314
C++
Runtime Error
#include <algorithm> #include <cstdlib> #include <stdio.h> using namespace std; const int N_MAX = 10001, INF = 100000; int dp[N_MAX], n, m, i, j, d[20]; int main() { scanf("%d%d", &n, &m); for (i = 0; i < m; i++) { scanf("%d", &d[i]); } fill(dp, dp + n + 1, INF); dp[0] = 0; for (i = 0; i <= n; i++...
#include <algorithm> #include <cstdlib> #include <stdio.h> using namespace std; const int N_MAX = 50001, INF = 100000; int dp[N_MAX], n, m, i, j, d[20]; int main() { scanf("%d%d", &n, &m); for (i = 0; i < m; i++) { scanf("%d", &d[i]); } fill(dp, dp + n + 1, INF); dp[0] = 0; for (i = 0; i <= n; i++...
replace
6
7
6
7
0
p02314
C++
Time Limit Exceeded
// Coin Changing Problem #include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1000000 int main() { ll n, m; cin >> n >> m; vector<ll> c; for (ll i = 0; i < m; i++) { ll tmp; cin >> tmp; c.push_back(tmp); } ll dp[n + 1]; // dp[i]:=i????????????????????????????????????...
// Coin Changing Problem #include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1000000 int main() { ll n, m; cin >> n >> m; vector<ll> c; for (ll i = 0; i < m; i++) { ll tmp; cin >> tmp; c.push_back(tmp); } ll dp[n + 1]; // dp[i]:=i????????????????????????????????????...
replace
22
28
22
24
TLE
p02314
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> #include <string> using namespace std; #define N_MAX 50000 #define M_MAX 20 #define NIL 1000000000 int DP[N_MAX + 1][M_MAX + 1]; int C[M_MAX + 1]; int main(void) { int n, m; scanf("%d %d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &C[i]); } for (int i =...
#include <iostream> #include <stdio.h> #include <string> using namespace std; #define N_MAX 50000 #define M_MAX 20 #define NIL 1000000000 int DP[N_MAX + 1][M_MAX + 1]; int C[M_MAX + 1]; int main(void) { int n, m; scanf("%d %d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &C[i]); } for (int i =...
replace
30
37
30
34
TLE
p02314
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <string> using namespace std; const long long int MOD = 1000000007; const long long int INF = 100000000; long long int N, M; long long int C[30]; long long int dp[21][100000]; int...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <string> using namespace std; const long long int MOD = 1000000007; const long long int INF = 100000000; long long int N, M; long long int C[30]; long long int dp[21][100000]; int...
replace
23
24
23
24
TLE
p02314
C++
Runtime Error
#include <stdio.h> #include <algorithm> using namespace std; int ans[50000 + 1]; int coin[20]; int main() { int n, m; scanf("%d %d", &n, &m); int i, j; for (i = 0; i < m; ++i) { scanf("%d", &coin[i]); ++ans[coin[i]]; } for (i = 1; i < n; ++i) { for (j = 0; j < m; ++j) { if (ans[i] ...
#include <stdio.h> #include <algorithm> using namespace std; int ans[50000 + 1]; int coin[20]; int main() { int n, m; scanf("%d %d", &n, &m); int i, j; for (i = 0; i < m; ++i) { scanf("%d", &coin[i]); ++ans[coin[i]]; } for (i = 1; i < n; ++i) { for (j = 0; j < m; ++j) { if (i + coi...
replace
23
24
23
24
0
p02314
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, e) for ((i) = (s); (i) < (int)(e); (i)++) #define REP(i, e) FOR(i, 0, e) #define all(o) (o).begin(), (o).end() #define psb(x) push_back(x) #define mp(x, y) make_pair((x), (y)) typedef long long ll; typedef pair<int, int> PII; const double EPS = 1e-10;...
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, e) for ((i) = (s); (i) < (int)(e); (i)++) #define REP(i, e) FOR(i, 0, e) #define all(o) (o).begin(), (o).end() #define psb(x) push_back(x) #define mp(x, y) make_pair((x), (y)) typedef long long ll; typedef pair<int, int> PII; const double EPS = 1e-10;...
replace
38
41
38
46
TLE
p02314
C++
Runtime Error
#include <iostream> #include <string.h> using namespace std; #define MAX_N 70 int main() { int dp[MAX_N]; int n, m, c[100]; memset(dp, -1, sizeof(dp)); cin >> n >> m; for (int i = 1; i <= m; i++) { cin >> c[i]; } for (int i = 1; i <= m; i++) { dp[c[i]] = 1; } for (int i = 1; i <= 20; i+...
#include <iostream> #include <string.h> using namespace std; #define MAX_N 1000000 int main() { int dp[MAX_N]; int n, m, c[100]; memset(dp, -1, sizeof(dp)); cin >> n >> m; for (int i = 1; i <= m; i++) { cin >> c[i]; } for (int i = 1; i <= m; i++) { dp[c[i]] = 1; } for (int i = 1; i <= 2...
replace
4
5
4
5
0
p02314
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { constexpr int INF = 1e9; int n, m; cin >> n >> m; vector<int> dp(n + 1, INF), d(m); for (auto i = 0; i < m; i++) { cin >> d[i]; dp[d[i]] = 1; } for (auto i = 0; i < n + 1; i++) { for (auto &j : d) { ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { constexpr int INF = 1e9; int n, m; cin >> n >> m; vector<int> dp(n + 1, INF), d(m); for (auto i = 0; i < m; i++) { cin >> d[i]; dp[d[i]] = 1; } for (auto i = 0; i < n + 1; i++) { for (auto &j : d) { ...
replace
15
16
15
16
0
p02314
C++
Runtime Error
/// // File: dpl_1_a.cpp // Author: ymiyamoto // // Created on Wed Nov 1 01:41:22 2017 // #include <cstdint> #include <iostream> #include <vector> using namespace std; #define MAX_N 10001 static vector<int32_t> coins; static uint32_t dp[MAX_N]; int32_t main() { int32_t n, m; cin >> n >> m; for (int32_t i = 0...
/// // File: dpl_1_a.cpp // Author: ymiyamoto // // Created on Wed Nov 1 01:41:22 2017 // #include <cstdint> #include <iostream> #include <vector> using namespace std; #define MAX_N 50001 static vector<int32_t> coins; static uint32_t dp[MAX_N]; int32_t main() { int32_t n, m; cin >> n >> m; for (int32_t i = 0...
replace
12
13
12
13
0
p02314
C++
Runtime Error
#include <bits/stdc++.h> #define M 21 #define N 50010 using namespace std; int dp[N]; int Min(int &a, int b) { return a = min(a, b); } int main() { int n, m; cin >> n >> m; int coin[M]; for (int i = 0; i < m; i++) cin >> coin[i]; for (int i = 0; i < N; i++) dp[i] = 1e9; dp[0] = 0; for (int i =...
#include <bits/stdc++.h> #define M 21 #define N 100010 using namespace std; int dp[N]; int Min(int &a, int b) { return a = min(a, b); } int main() { int n, m; cin >> n >> m; int coin[M]; for (int i = 0; i < m; i++) cin >> coin[i]; for (int i = 0; i < N; i++) dp[i] = 1e9; dp[0] = 0; for (int i ...
replace
2
3
2
3
0
p02314
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, m, t; int c[21]; int T[21][10001]; cin >> n >> m; int counter = 0; for (int k = 0; k < m; ++k) { cin >> t; c[k] = t; if (c[k] > n) { c[k] = c[k + 1]; counter++; } for (int j = 1; j <= n; ++j) { T[k][0] = 0; ...
#include <iostream> using namespace std; int main() { int n, m, t; int c[21]; int T[21][100001]; cin >> n >> m; int counter = 0; for (int k = 0; k < m; ++k) { cin >> t; c[k] = t; if (c[k] > n) { c[k] = c[k + 1]; counter++; } for (int j = 1; j <= n; ++j) { T[k][0] = 0; ...
replace
6
7
6
7
0
p02314
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; unsigned short dp[20][50010]; int main(void) { int N, M; cin >> N >> M; vector<int> c(M); for (auto &i : c) cin >> i; sort(c.begin(), c.end()); for (int j = 0; j <= N; j++) dp[0][j] = j; int m; for (int i = 1; i <...
#include <algorithm> #include <iostream> #include <vector> using namespace std; unsigned short dp[20][50010]; int main(void) { int N, M; cin >> N >> M; vector<int> c(M); for (auto &i : c) cin >> i; sort(c.begin(), c.end()); for (int j = 0; j <= N; j++) dp[0][j] = j; int m; for (int i = 1; i <...
replace
21
22
21
22
TLE
p02314
C++
Runtime Error
#include <iostream> #include <limits> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> dp(n); vector<int> coins(m); for (int i = 0; i < m; ++i) { int coin; cin >> coin; coins[i] = coin; } dp[0] = 0; for (int val = 1; val <= n; ++val) { int min...
#include <iostream> #include <limits> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> dp(n + 1); vector<int> coins(m); for (int i = 0; i < m; ++i) { int coin; cin >> coin; coins[i] = coin; } dp[0] = 0; for (int val = 1; val <= n; ++val) { int...
replace
10
11
10
11
0
p02314
C++
Runtime Error
#include <stdio.h> int i, j, a, b, c[20], d[50001], min = 2000000000; int main(void) { scanf("%d %d", &a, &b); for (i = 0; i < b; i++) { scanf("%d", &c[i]); } for (j = 0; j <= a; j++) { d[j] = min; } d[0] = 0; for (i = 0; i < b; i++) { for (j = 0; j <= a; j++) { if (d[j] != min) { ...
#include <stdio.h> int i, j, a, b, c[20], d[50001], min = 2000000000; int main(void) { scanf("%d %d", &a, &b); for (i = 0; i < b; i++) { scanf("%d", &c[i]); } for (j = 0; j <= a; j++) { d[j] = min; } d[0] = 0; for (i = 0; i < b; i++) { for (j = 0; j <= a; j++) { if (d[j] != min && j + c...
replace
14
16
14
16
0
p02314
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define INF INT_MAX / 2 int main() { int n, m; int c[20...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define INF INT_MAX / 2 int main() { int n, m; int c[20...
replace
27
28
27
28
0
p02314
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int coins[m]; for (int i = 0; i < m; ++i) { cin >> coins[i]; } sort(coins, coins + m, greater<>()); int dp[m + 1][50001]; for (int i = 0; i <= 50000; ++i) { if (i == 0) dp[m][i] = 0; ...
#include <algorithm> #include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int coins[m]; for (int i = 0; i < m; ++i) { cin >> coins[i]; } sort(coins, coins + m, greater<>()); int dp[m + 1][50001]; for (int i = 0; i <= 50000; ++i) { if (i == 0) dp[m][i] = 0; ...
replace
28
33
28
29
TLE
p02314
C++
Runtime Error
// DPL_1_A.cpp // #include <bits/stdc++.h> using namespace std; const int INF = INT_MAX; int n, m; int dp[10001], coin[20]; int solve() { fill(dp, dp + n + 1, INF); dp[0] = 0; for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) if (i + coin[j] <= n) dp[i + coin[j]] = min(dp[i + coin[j]], dp[...
// DPL_1_A.cpp // #include <bits/stdc++.h> using namespace std; const int INF = INT_MAX; int n, m; int dp[50001], coin[20]; int solve() { fill(dp, dp + n + 1, INF); dp[0] = 0; for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) if (i + coin[j] <= n) dp[i + coin[j]] = min(dp[i + coin[j]], dp[...
replace
6
7
6
7
0
p02314
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, N) for (int i = 0; i < (int)N; i++) #define M 20 #define N 50001 int d[M]; int DP[M][N]; int solve(int i, int x) { int res = N; if (DP[i][x] != N) return DP[i][x]; for (int k = 0, kMax = x / d[i]; k <= kMax; k++) res =...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, N) for (int i = 0; i < (int)N; i++) #define M 20 #define N 50001 int d[M]; int DP[M][N]; int solve(int i, int x) { int res = N; if (DP[i][x] != N) return DP[i][x]; res = solve(i - 1, x); if (x - d[i] >= 0) res = min(...
replace
17
19
17
20
TLE
p02314
C++
Runtime Error
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include ...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include ...
replace
48
49
48
49
0
p02314
C++
Runtime Error
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include ...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include ...
replace
45
46
45
46
0
p02314
C++
Runtime Error
#include <iostream> static const int INF = int(1e8); using namespace std; int dp[10001] = {}; int denom[10001] = {}; int main() { int n; int m; cin >> n; cin >> m; for (int i = 0; i < m; i++) { cin >> denom[i]; } dp[0] = 0; for (int i = 1; i <= n; i++) { dp[i] = INF; for (int j = 0; j <= m;...
#include <iostream> static const int INF = int(1e8); using namespace std; int dp[55555] = {}; int denom[55555] = {}; int main() { int n; int m; cin >> n; cin >> m; for (int i = 0; i < m; i++) { cin >> denom[i]; } dp[0] = 0; for (int i = 1; i <= n; i++) { dp[i] = INF; for (int j = 0; j <= m;...
replace
4
6
4
6
0
p02314
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <sst...
#include <algorithm> #include <array> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <sst...
replace
48
50
48
51
TLE
p02314
C++
Runtime Error
#include <algorithm> #include <iostream> #define N 10001 #define INFINITY 2000000000 using namespace std; const int M = 21; void getTheNumberOfCoin(); int n, m, T[M][N], C[M], i, j, minv; int main() { cin >> n >> m; for (i = 1; i <= m; i++) cin >> C[i]; getTheNumberOfCoin(); return 0; } void getTheNumberOfC...
#include <algorithm> #include <iostream> #define N 50001 #define INFINITY 2000000000 using namespace std; const int M = 21; void getTheNumberOfCoin(); int n, m, T[M][N], C[M], i, j, minv; int main() { cin >> n >> m; for (i = 1; i <= m; i++) cin >> C[i]; getTheNumberOfCoin(); return 0; } void getTheNumberOfC...
replace
2
3
2
3
0
p02314
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
37
39
37
39
0
p02314
C++
Runtime Error
#include <iostream> using namespace std; int main() { int ws[23], sum, num, dp[10003]; cin >> sum >> num; for (int i = 0; i < num; i++) cin >> ws[i]; for (int i = 0; i <= sum; i++) dp[i] = i; for (int i = 1; i < num; i++) { for (int j = ws[i]; j <= sum; j++) dp[j] = min(dp[j], dp[j - ws[i]] ...
#include <iostream> using namespace std; int main() { int ws[23], sum, num, dp[50003]; cin >> sum >> num; for (int i = 0; i < num; i++) cin >> ws[i]; for (int i = 0; i <= sum; i++) dp[i] = i; for (int i = 1; i < num; i++) { for (int j = ws[i]; j <= sum; j++) dp[j] = min(dp[j], dp[j - ws[i]] ...
replace
3
4
3
4
0
p02314
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int n, m; int c[20]; int lp[50005] = {}; int solve(int x) { if (lp[x] != 0) return lp[x]; int t = INT_MAX; for (int i = 1; i <= x / 2; i++) t = min(t, solve(i) + solve(x - i)); lp[x] = t; return t; } int main() { cin >> n >> m; for (int i = 0; i < m...
#include <bits/stdc++.h> using namespace std; int n, m; int c[20]; int lp[50005] = {}; int solve(int x) { if (lp[x] != 0) return lp[x]; int t = INT_MAX; for (int i = 0; i < m; i++) if (x > c[i]) t = min(t, solve(x - c[i]) + 1); lp[x] = t; return t; } int main() { cin >> n >> m; for (int i...
replace
11
13
11
14
TLE
p02314
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int MAXN = 50000; const int INF = 114514; int main() { int N, M; int coin[21]; int dp[MAXN + 1]; memset(dp, INF, sizeof(dp)); dp[0] = 0; scanf("%d%d", &N, &M); for (int i = 0; i < M; i++) scanf...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int MAXN = 50000; const int INF = 114514; int main() { int N, M; int coin[21]; int dp[MAXN + 1]; memset(dp, INF, sizeof(dp)); dp[0] = 0; scanf("%d%d", &N, &M); for (int i = 0; i < M; i++) scanf...
replace
21
22
21
22
0
p02314
C++
Runtime Error
#include <bits/stdc++.h> #define F first #define S second #define mp make_pair // everything go according to my plan #define pb push_back #define sz(a) (int)(a.size()) #define vec vector // shimkenttin kyzdary, dzyn, dzyn, dzyn... #define y1 Y_U_NO_y1 #define left Y_U_NO_left #define right Y_U_NO_right using namespac...
#include <bits/stdc++.h> #define F first #define S second #define mp make_pair // everything go according to my plan #define pb push_back #define sz(a) (int)(a.size()) #define vec vector // shimkenttin kyzdary, dzyn, dzyn, dzyn... #define y1 Y_U_NO_y1 #define left Y_U_NO_left #define right Y_U_NO_right using namespac...
delete
54
56
54
54
0
Input file not found
p02314
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define...
replace
32
34
32
34
0
p02314
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define P pair<ll, ll> #define FOR(I, A, B) for (ll I = (A); I < (B); ++I) #define FORR(I, A, B) for (ll I = (B - 1); I >= (A); --I) const ll INF = 1e18 + 7; const ll MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, m; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define P pair<ll, ll> #define FOR(I, A, B) for (ll I = (A); I < (B); ++I) #define FORR(I, A, B) for (ll I = (B - 1); I >= (A); --I) const ll INF = 1e18 + 7; const ll MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, m; ...
replace
19
21
19
21
0
p02314
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stdlib.h> #include <string> #include <time.h> #include <unordered_map> #include <vector> #def...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stdlib.h> #include <string> #include <time.h> #include <unordered_map> #include <vector> #def...
replace
33
38
33
34
TLE
p02314
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define rep(i, a, b) for (int(i) = (a); i < (b); i++) #define INF 1000000000 #define MAX_N 100005 using namespace std; int main() { int n, m; int c[21], dp[2...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define rep(i, a, b) for (int(i) = (a); i < (b); i++) #define INF 1000000000 #define MAX_N 100005 using namespace std; int main() { int n, m; int c[21], dp[2...
replace
24
25
24
25
0
p02314
C++
Runtime Error
#include <algorithm> #include <iostream> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int INF = 100000000; int n, m; cin >> n >> m; int dp[10010]; rep(i, 10010) dp[i] = INF; dp[0] = 0; int c[m]; rep(i, m) cin >> c[i]; rep(i, n + 1) { rep(j, m) { int tmp = ...
#include <algorithm> #include <iostream> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int INF = 100000000; int n, m; cin >> n >> m; int dp[50010]; rep(i, 50010) dp[i] = INF; dp[0] = 0; int c[m]; rep(i, m) cin >> c[i]; rep(i, n + 1) { rep(j, m) { int tmp = ...
replace
9
11
9
11
0
p02314
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> #define INF (1 << 30) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector<long long> dp(n, INF); vector<int> c(m, 0); for (int i = 0; i < m; i++) { cin >> c[i]; } dp[0] = 0; for (int...
#include <algorithm> #include <iostream> #include <vector> #define INF (1 << 30) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector<long long> dp(n + 1, INF); vector<int> c(m, 0); for (int i = 0; i < m; i++) { cin >> c[i]; } dp[0] = 0; for ...
replace
10
11
10
11
-6
munmap_chunk(): invalid pointer
p02314
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, m; int dp[21][50001]; vector<int> c; //??\??? cin >> n >> m; for (int i = 0; i < m; i++) { int tmp; cin >> tmp; c.push_back(tmp); } sort(c.begin(), c.end()); // dp????????? memset(dp, 0, sizeof(dp)); for (int i = 0; i...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; int dp[21][50001]; vector<int> c; //??\??? cin >> n >> m; for (int i = 0; i < m; i++) { int tmp; cin >> tmp; c.push_back(tmp); } sort(c.begin(), c.end()); // dp????????? memset(dp, 0, sizeof(dp)); for (int i = 0; i...
replace
25
34
25
29
TLE
p02314
C++
Time Limit Exceeded
#include <iostream> #define INF 1e+9 using namespace std; int main() { int n, m; int gaku[20]; int dp[21][50001]; cin >> n >> m; for (int i = m - 1; i >= 0; i--) cin >> gaku[i]; for (int i = 0; i <= 50000; i++) { for (int j = 0; j <= 20; j++) dp[j][i] = INF; } dp[0][0] = 0; for (int i =...
#include <iostream> #define INF 1e+9 using namespace std; int main() { int n, m; int gaku[20]; int dp[21][50001]; cin >> n >> m; for (int i = m - 1; i >= 0; i--) cin >> gaku[i]; for (int i = 0; i <= 50000; i++) { for (int j = 0; j <= 20; j++) dp[j][i] = INF; } dp[0][0] = 0; for (int i =...
replace
18
21
18
22
TLE