Come_Fall_In_Luv_Wit_HIM's blog

By Come_Fall_In_Luv_Wit_HIM, history, 6 years ago, In English

Hi all,I am a beginner coder,I was solving this problem 734 A Division 2 Anton and danik,Everytime,I am trying To execute this problem ,I am getting "Memory Limit Exceeded",What does that mean,Is that like compilation Error ,Here is My solution http://codeforces.com/contest/734/submission/34217320 ,Please help

| Write comment?
»
6 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Your programm used too much memory. Your code:

int n;   
 char ch[n];
 scanf("%d",&n);

You have initialized array ch before you had scanned n. Try to do this:

int n;   
 scanf("%d",&n);
 char ch[n];

Better, do this:

#define maxN 100007;
char ch[maxN];
int main(){
  
}