This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ivan Carvalho | |
// Problem A - Educational Dynamic Programming Contest - AtCoder | |
// Link : https://atcoder.jp/contests/dp | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 1e5 + 10; | |
const int INF = 2*1e9; | |
int dp[MAXN],N,K,h[MAXN]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stack - Object oriented implementation using arrays | |
#include <iostream> | |
using namespace std; | |
#define MAX_SIZE 101 | |
class Stack | |
{ | |
private: | |
int A[MAX_SIZE]; // array to store the stack | |
int top; // variable to mark the top index of stack. |