# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41328 | IvanC | K blocks (IZhO14_blocks) | C++14 | 249 ms | 12936 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
const int INF = 1e9;
const int MAXN = 1e5 + 10;
int vetor[MAXN],dp[MAXN],novadp[MAXN],menor[MAXN],napilha[MAXN],N,K;
struct minStack{
stack<ii> pilha;
int menor;
minStack(){menor = INF;}
void push(int val){
ii novo = ii(val,menor);
menor = min(menor,val);
pilha.push(novo);
}
void pop(){
menor = pilha.top().second;
pilha.pop();
}
bool empty(){return pilha.empty();}
int getMin(){return menor;}
};
void solve(int k){
for(int i = 0;i<=N;i++){
novadp[i] = INF;
napilha[i] = 0;
}
stack<int> pilha;
minStack pq;
for(int i = k;i<=N;i++){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |