where is the problems: that's WA! but it's all right on my machine.

```
class MinStack{
public:
stack<long> s;
long min;
void push(int x){
if (s.empty()) {
s.push(0);
min = x;
}else{
s.push(x-min);
if (x < min) {
min = x;
}
}
}
void pop(){
if (s.empty()) {
return;
}else{
if (s.top() < 0) {
min = min - s.top();
}
s.pop();
}
}
int top(){
if (s.empty()) {
return NULL;
}else{
if (s.top() > 0) {
return (int)(min+s.top());
}else{
return (int)min;
}
}
}
int getMin(){
if (s.empty()) {
return NULL;
}else{
return (int)min;
}
}
```

};