criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <string>
#include <list>
using namespace std;

#define REP(i,n) for(int i = 0; i < (int)n; ++i)

int main()
{
	int n;
	string st;
	int x;
	cin >> n;
	list<int> L;
	list<int>::iterator it, endit;

	while(n--) {
		cin >> st;

		if(st == "insert") {
			cin >> x;
			L.push_front(x);
		}

		else if(st == "delete") {
			cin >> x;
			for(it = L.begin(), endit = L.end(); it != endit;++it) {
				if(*it == x) {
					L.erase(it);
					break;
				}
			}
		}

		else if(st == "deleteFirst") {
			L.pop_front();
		}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:18: error: expected '}' at end of input
   37 |                 }
      |                  ^
a.cc:17:20: note: to match this '{'
   17 |         while(n--) {
      |                    ^
a.cc:37:18: error: expected '}' at end of input
   37 |                 }
      |                  ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include <iostream>
#include <list>
#include <string>

using namespace std;

int main(){
  int n, t;
  string s;
  list<int> l;
  list<int>::iterator it;

  cin >> t;


  while(t--){
    cin >> s;
    if(s.compare("insert")==0){
      cin >> n;
      l.push_front(n);
    }
    else if(s.compare("delete")==0){
      cin >> n;
      for(it=l.begin(); it!=l.end(); ++it){
	if(*it == n){
	  l.erase(it);
	  break;
	}
      }
    }
    else if(s.compare("deleteFirst")==0){
      l.pop_front();
    }
    else if(s.compare("deleteLast")==0){
      l.pop_back();
    }
  }

  int i = 0;
  for(it=l.begin(); it!=l.end(), i!=l.size()-1; ++it, ++i)
    cout << *it << " ";

  cout << *it << endl;

  return 0;
}
#include <iostream>
#include <list>
#include <string>

using namespace std;

int main(){
  int n, t;
  string s;
  list<int> l;
  list<int>::iterator it;

  cin >> t;


  while(t--){
    cin >> s;
    if(s.compare("insert")==0){
      cin >> n;
      l.push_front(n);
    }
    else if(s.compare("delete")==0){
      cin >> n;
      for(it=l.begin(); it!=l.end(); ++it){
	if(*it == n){
	  l.erase(it);
	  break;
	}
      }
    }
    else if(s.compare("deleteFirst")==0){
      l.pop_front();
    }
    else if(s.compare("deleteLast")==0){
      l.pop_back();
    }
  }

  int i = 0;
  for(it=l.begin(); it!=l.end(), i!=l.size()-1; ++it, ++i)
    cout << *it << " ";

  cout << *it << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:23: warning: ignoring return value of 'bool std::operator!=(const _List_iterator<int>::_Self&, const _List_iterator<int>::_Self&)', declared with attribute 'nodiscard' [-Wunused-result]
   40 |   for(it=l.begin(); it!=l.end(), i!=l.size()-1; ++it, ++i)
      |                     ~~^~~~~~~~~
In file included from /usr/include/c++/14/list:65,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_list.h:325:7: note: declared here
  325 |       operator!=(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc: At global scope:
a.cc:53:5: error: redefinition of 'int main()'
   53 | int main(){
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:86:23: warning: ignoring return value of 'bool std::operator!=(const _List_iterator<int>::_Self&, const _List_iterator<int>::_Self&)', declared with attribute 'nodiscard' [-Wunused-result]
   86 |   for(it=l.begin(); it!=l.end(), i!=l.size()-1; ++it, ++i)
      |                     ~~^~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:325:7: note: declared here
  325 |       operator!=(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;

    list<int> li;
    int ignore = 0;

    for (int i=0; i<n; ++i) {
        string op; cin >> op;
        if (op[0] == "insert") {
            int key; cin >> key;
            li.push_front(key);
        } else if (op == "deleteFirst") {
            li.pop_front();
        } else if (op == "deleteLast") {
            ignore ++;
        } else {
            int key; cin >> key;
            list<int>::iterator end_it = li.end();
            advance(end_it, -ignore);
            list<int>::iterator pos = find(li.begin(), end_it, key);
            if (pos != end_it) {
                li.erase(pos);
            }
        }
    }

    list<int>::iterator end_it = li.end();
    advance(end_it, -ignore);
    for (list<int>::iterator it = li.begin(); it != end_it; ++it) {
        cout << ((it == li.begin()) ? "" : " ") << *it;
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |         if (op[0] == "insert") {
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){
	

	int order_num;
	char order[10];
	int val;
	node* p = new node();
	node* origin = p;
	cin >> order_num;

	for(int i = 0; i < order_num; i++){
		cin >> order;	
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = new node(); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = p2->next;
						origin -> prev = NULL;
						delete p2;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						delete p2;
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			origin = origin->next;
			delete origin->prev;
			origin->prev = NULL;
		}else if(strcmp(order,"deleteLast") == 0){
			p->prev = p->prev->prev;
			delete p->prev->next;
			p->prev->next = p;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		delete p->next;
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	delete p;


	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: 'strcmp' was not declared in this scope
   29 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){

	
	int order_num;
	char order[10];
	int val;
	node* p = new node();
	node* origin = p;
	cin >> order_num;
	const int aaa = order_num;

	for(int i = 0; i < aaa; i++){
		cin >> order;	
		//cout << i<< "/" << order_num << ": "<< order << endl;
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = new node(); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						delete origin->prev;
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						delete p2;
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			delete p->prev->next;
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			delete origin->prev;
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		delete p->next;
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	delete p;


	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: 'strcmp' was not declared in this scope
   31 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){

	
	int order_num;
	char order[10];
	int val;
	node* p = new node();
	node* origin = p;
	cin >> order_num;
	const int aaa = order_num;

	for(int i = 0; i < aaa; i++){
		cin >> order;	
		//cout << i<< "/" << order_num << ": "<< order << endl;
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = new node(); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						delete origin->prev;
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						delete p2;
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			delete p->prev->next;
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			delete origin->prev;
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		//delete p->next;
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	//delete p;


	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: 'strcmp' was not declared in this scope
   31 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){

	
	int order_num;
	char order[10];
	int val;
	node* p = new node();
	node* origin = p;
	cin >> order_num;
	int test = order_num;

	for(int i = 0; i < test; i++){
		cin >> order;	
		//cout << i<< "/" << test << ": "<< order << endl;
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = new node(); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						delete origin->prev;
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						delete p2;
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			delete p->prev->next;
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			delete origin->prev;
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		delete p->next;
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	delete p;


	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: 'strcmp' was not declared in this scope
   31 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){
	int order_num;
	char order[10];
	int val;
	node* p = new node();
	node* origin = p;
	cin >> order_num;
	int test = order_num;

	for(int i = 0; i < test; i++){
		cin >> order;	
		//cout << i<< "/" << test << ": "<< order << endl;
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = new node(); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						delete origin->prev;
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						delete p2;
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			delete p->prev->next;
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			delete origin->prev;
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		delete p->next;
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	delete p;


	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: 'strcmp' was not declared in this scope
   29 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){

	
	int order_num;
	char order[10];
	int val;
	//node* p = new node();
	node* p = (node*)malloc(sizeof(node));
	node* origin = p;
	cin >> order_num;
	int test = order_num;

	for(int i = 0; i < test; i++){
		cin >> order;	
		//cout << i<< "/" << test << ": "<< order << endl;
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			//p->next = new node(); 
			p->next = (node*)malloc(sizeof(node)); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						free(origin->prev);
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						free(p2);
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			free(p->prev->next);
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			free(origin->prev);
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		free(p->next);
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	free(p);


	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:26: error: 'strcmp' was not declared in this scope
   33 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){

	
	int order_num;
	char order[10];
	int val;
	node* p = (node*)malloc(sizeof(node));
	node* origin = p;
	cin >> order_num;
	int test = order_num;

	for(int i = 0; i < test; i++){
		cin >> order;	
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = (node*)malloc(sizeof(node)); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						free(origin->prev);
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						free(p2);
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			free(p->prev->next);
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			free(origin->prev);
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		free(p->next);
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	free(p);


	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: 'strcmp' was not declared in this scope
   30 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;

struct node{
	int num;
	node* next;
	node* prev;
};

int main(){

	
	int order_num;
	char order[10];
	int val;
	node* p = (node*)malloc(sizeof(node));
	node* origin = p;
	cin >> order_num;
	int test = order_num;

	for(int i = 0; i < test; i++){
		cin >> order;	
		if(order[0] == 'i'){
			cin >> val;
			p->num = val;
			p->next = (node*)malloc(sizeof(node)); 
			p->next->prev = p;
			p = p->next;
		}else if(strcmp(order,"delete") == 0){
			cin >> val;
			node* p2 = origin;
			while(p2->next != NULL){
				if(p2->num == val){
					if(p2->prev == NULL){
						origin = origin->next;
						free(origin->prev);
						origin -> prev = NULL;
					}else{
						p2->next->prev = p2->prev;
						p2->prev->next = p2->next;
						free(p2);
						break;
					}
				}
				p2 = p2->next;
			}
		}else if(strcmp(order,"deleteFirst") == 0){
			p->prev = p->prev->prev;
			free(p->prev->next);
			p->prev->next = p;
		}else if(strcmp(order,"deleteLast") == 0){
			origin = origin->next;
			free(origin->prev);
			origin->prev = NULL;
		}
	}
	p = p->prev;
	while(p->prev != NULL){
		free(p->next);
		cout << p->num << " ";
		p = p->prev;
	}
	cout << p->num << endl;
	free(p);


	
	return 0;
};

Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: 'strcmp' was not declared in this scope
   30 |                 }else if(strcmp(order,"delete") == 0){
      |                          ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<cstdio>
#include<iostream>
#include<string>
#include<list>
#include<algorithm>

using namespace std;
 
int main(void){
 
    int n;
    string inp;
    int x;
	list<int> data;
	list<int>::iterator iter;

    cin>>n;
 
    while(n--){
        cin>>inp;
 
        if(inp=="deleteFirst") data.pop_front();
        else if(inp=="deleteLast") data.pop_back();
		else cin>>x;
        if(inp=="insert") data.push_front(x);
        else if(inp=="delete") (find(data.begin(),data.end(),x)!=data.end()) data.erase(find(data.begin(),data.end(),x));
    }
 
    iter=data.begin();
	while(iter!=data.end()){
		if(iter!=data.begin()) cout<<" ";
		cout<<*iter;
		iter++;
	}
	cout<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:77: error: expected ';' before 'data'
   26 |         else if(inp=="delete") (find(data.begin(),data.end(),x)!=data.end()) data.erase(find(data.begin(),data.end(),x));
      |                                                                             ^~~~~
      |                                                                             ;
a.cc:26:64: warning: ignoring return value of 'bool std::operator!=(const _List_iterator<int>::_Self&, const _List_iterator<int>::_Self&)', declared with attribute 'nodiscard' [-Wunused-result]
   26 |         else if(inp=="delete") (find(data.begin(),data.end(),x)!=data.end()) data.erase(find(data.begin(),data.end(),x));
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/list:65,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_list.h:325:7: note: declared here
  325 |       operator!=(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <cassert>

#include <iostream>
#include <deque>
#include <string>

using namespace std;

#define DEBUG(x) cerr << #x << " = " << x << endl

int main() {
  int n; scanf("%d", &n);
  deque<int> l;
  while(n--) {
    char s[80];
    scanf("%s", s);
    if(strcmp(s, "insert") == 0) {
      int x;
      scanf("%d", &x);
      l.push_front(x);
    }
    else if(strcmp(s, "delete") == 0) {
      int x;
      scanf("%d", &x);
      auto it = find(l.begin(), l.end(), x);
      if(it != l.end()) {
        l.erase(it);
      }
    }
    else if(strcmp(s, "deleteFirst") == 0) {
      l.pop_front();
    }
    else if(strcmp(s, "deleteLast") == 0) {
      l.pop_back();
    }
    else {
      assert(false);
    }
  }

  int k = 0;
  for(int item : l) {
    printf("%d%c", item, " \n"[k++ == l.size() - 1]);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: no matching function for call to 'find(std::deque<int>::iterator, std::deque<int>::iterator, int&)'
   27 |       auto it = find(l.begin(), l.end(), x);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:5:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:27:21: note:   'std::_Deque_iterator<int, int&, int*>' is not derived from 'std::istreambuf_iterator<_CharT>'
   27 |       auto it = find(l.begin(), l.end(), x);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: Java

public class Main {
	public static void main(String[] args) throws IOException {
		new Main().run();
	}
	private void run() throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String input = reader.readLine();
		reader.close();
		int sum = 0;
		Stack<Integer> st1 = new Stack<Integer>();
		Stack<int[]> st2 = new Stack<int[]>();
		for (int i = 0; i < input.length(); i++) {
			char c = input.charAt(i);
			if (c == '\\') {
				st1.add(i);
			} else if (c == '/' && !st1.isEmpty()) {
				int j = st1.pop();
				int area = i - j;
				sum += area;
				int prev = 0;
				while (!st2.isEmpty() && st2.peek()[0] > j) {
					prev += st2.pop()[1];
				}
				st2.add(new int[]{j, area + prev});
			}
		}
		
		System.out.println(sum);
		System.out.print(st2.size());
		for (int i = 0; i < st2.size(); i++) {
			System.out.print(" " + st2.get(i)[1]);
		}
		System.out.println();
	}
}


Compiler output:
Main.java:2: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:5: error: cannot find symbol
	private void run() throws IOException {
	                          ^
  symbol:   class IOException
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		                            ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		                                               ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:10: error: cannot find symbol
		Stack<Integer> st1 = new Stack<Integer>();
		^
  symbol:   class Stack
  location: class Main
Main.java:10: error: cannot find symbol
		Stack<Integer> st1 = new Stack<Integer>();
		                         ^
  symbol:   class Stack
  location: class Main
Main.java:11: error: cannot find symbol
		Stack<int[]> st2 = new Stack<int[]>();
		^
  symbol:   class Stack
  location: class Main
Main.java:11: error: cannot find symbol
		Stack<int[]> st2 = new Stack<int[]>();
		                       ^
  symbol:   class Stack
  location: class Main
9 errors
Language: Java

import java.util.ArrayDeque;
import java.util.Scanner;

class Area {
    int startIdx;
    int value;

    public Area(int startIdx, int value) {
        this.startIdx = startIdx;
        this.value = value;
    }
}

public class ALDS1_3_D {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayDeque<Integer> stack = new ArrayDeque<>();
        ArrayDeque<Area> areaStack = new ArrayDeque<>();

        int sum = 0;
        char[] input = sc.next().toCharArray();
        for (int i = 0; i < input.length; i++) {
            if (input[i] == '\\') {
                stack.push(i);
            } else if (!stack.isEmpty() && input[i] == '/') {
                int oppositeIdx = stack.pop();
                sum += i - oppositeIdx;

                int a = i - oppositeIdx;
                while (!areaStack.isEmpty() && areaStack.peek().startIdx > oppositeIdx) {
                    a += areaStack.pop().value;
                }
                areaStack.push(new Area(oppositeIdx, a));
            }
        }

        System.out.println(sum);

        StringBuffer sb = new StringBuffer();
        int areaStackSize = areaStack.size();
        sb.append(areaStackSize);

        for (int i = 0; i < areaStackSize; i++) {
            sb.append(" ");
            sb.append(areaStack.removeLast().value);
        }
        System.out.println(sb);
    }
}



Compiler output:
Main.java:14: error: class ALDS1_3_D is public, should be declared in a file named ALDS1_3_D.java
public class ALDS1_3_D {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;

public class AreasOnTheCrossSectionDiagram {
    public static void main(String[] args) throws IOException {
        final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        final char[] line = reader.readLine().toCharArray();
        reader.close();

        final Deque<Integer> stack = new ArrayDeque<Integer>(line.length);
        final StringBuilder answer = new StringBuilder();

        int sum = 0;
        int count = 0;
        int indexLastZero = 0;
        final int[] process = new int[line.length + 1];
        final int[] graph = new int[line.length + 1];
        for (int i = 0; i < line.length; ++i) {
            if (stack.isEmpty()) indexLastZero = i;
            graph[i] = stack.size();
            process[i] = sum;
            switch (line[i]) {
                case '\\':
                    stack.push(i);
                    break;
                case '/':
                    if (!stack.isEmpty()) {
                        sum += i - stack.pop();
                        if (stack.isEmpty()) {
                            ++count;
                            answer.append(" ").append(sum - process[indexLastZero]);
                        }
                    }
                    break;
                default:
            }
        }
        if (stack.isEmpty()) indexLastZero = line.length;
        graph[line.length] = stack.size();
        process[line.length] = sum;


        for (int i = indexLastZero + 1, min; i < graph.length; ++i) {
            min = i;
            for (int j = graph.length - 1; i < j; --j) {
                if (graph[i] == graph[j] && process[i] != process[j]) {
                    min = j;
                }
            }
            if (min != i) {
                ++count;
                answer.append(" ").append(process[min] - process[i]);
                i = min - 1;
            }
        }
        System.out.println(sum);
        System.out.println(count + answer.toString());
    }
}

Compiler output:
Main.java:7: error: class AreasOnTheCrossSectionDiagram is public, should be declared in a file named AreasOnTheCrossSectionDiagram.java
public class AreasOnTheCrossSectionDiagram {
       ^
1 error
Language: Java

import javafx.util.Pair;

import java.io.IOException;
import java.util.*;

class Main {
	public static void main(String args[]) throws IOException {
		Scanner in = new Scanner(System.in);

		Stack<Integer> st = new Stack<>();
		int ch;
		int sum = 0;
		List<Integer> lakes = new ArrayList<>();
		Stack<Pair<Integer, Integer> > lakeStack = new Stack<>(); // first: left's \ pos, right: the lake's size
		for(int i=0; (ch = System.in.read()) != -1; i++) {
			if (ch == '\n' || ch == '\r') {
				break;
			}

			if(ch == '\\') {
				st.push(i);
			} else if(ch == '/') {
				if(st.empty() == true) {
					continue;
				}
				int top = st.pop();
				sum += i - top;

				int lakePoint = i - top;

				while(lakeStack.empty() == false) {
					Pair<Integer, Integer> p = lakeStack.pop();
					if(p.getKey() >= top) {
						lakePoint += p.getValue();
					} else {
						lakeStack.push(p);
						break;
					}
				}
				lakeStack.push(new Pair<>(top, lakePoint));
			}
		}

		while(lakeStack.empty() == false) {
			Pair<Integer, Integer> p = lakeStack.pop();
			lakes.add(p.getValue());
		}
		Collections.reverse(lakes);

		System.out.println(sum);
		System.out.print(lakes.size()+ " ");
		for(int i=0;i<lakes.size();i++) {
			System.out.print(lakes.get(i) + " ");
		}
		System.out.println("");
	}
}

Compiler output:
Main.java:1: error: package javafx.util does not exist
import javafx.util.Pair;
                  ^
Main.java:14: error: cannot find symbol
		Stack<Pair<Integer, Integer> > lakeStack = new Stack<>(); // first: left's \ pos, right: the lake's size
		      ^
  symbol:   class Pair
  location: class Main
Main.java:32: error: cannot find symbol
					Pair<Integer, Integer> p = lakeStack.pop();
					^
  symbol:   class Pair
  location: class Main
Main.java:40: error: cannot find symbol
				lakeStack.push(new Pair<>(top, lakePoint));
				                   ^
  symbol:   class Pair
  location: class Main
Main.java:45: error: cannot find symbol
			Pair<Integer, Integer> p = lakeStack.pop();
			^
  symbol:   class Pair
  location: class Main
5 errors
Language: Java


import com.sun.tools.javac.util.Pair;

import java.io.IOException;
import java.util.*;

class Main {
	public static void main(String args[]) throws IOException {
		Scanner in = new Scanner(System.in);

		Stack<Integer> st = new Stack<>();
		int ch;
		int sum = 0;
		List<Integer> lakes = new ArrayList<>();
		Stack<Pair<Integer, Integer>> lakeStack = new Stack<>(); // first: left's \ pos, right: the lake's size
		for(int i=0; (ch = System.in.read()) != -1; i++) {
			if (ch == '\n' || ch == '\r') {
				break;
			}

			if(ch == '\\') {
				st.push(i);
			} else if(ch == '/') {
				if(st.empty() == true) {
					continue;
				}
				int top = st.pop();
				sum += i - top;

				int lakePoint = i - top;

				while(lakeStack.empty() == false) {
					Pair<Integer, Integer> p = lakeStack.pop();
					if(p.fst >= top) {
						lakePoint += p.snd;
					} else {
						lakeStack.push(p);
						break;
					}
				}
				lakeStack.push(new Pair<>(top, lakePoint));
			}
		}

		while(lakeStack.empty() == false) {
			Pair<Integer, Integer> p = lakeStack.pop();
			lakes.add(p.fst);
		}
		Collections.reverse(lakes);

		System.out.println(sum);
		System.out.print(lakes.size()+ " ");
		for(int i=0;i<lakes.size();i++) {
			System.out.print(lakes.get(i) + " ");
		}
		System.out.println("");
	}
}

Compiler output:
Main.java:2: error: package com.sun.tools.javac.util is not visible
import com.sun.tools.javac.util.Pair;
                          ^
  (package com.sun.tools.javac.util is declared in module jdk.compiler, which does not export it to the unnamed module)
1 error
Language: Java

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.ArrayList;
import java.util.ArrayDeque;
import java.util.Deque;

public class Alds1_3_d {
	public static void main(String[] args) {
		FS r = new FS();
		String str = r.next();
		Deque<Integer> stack = new ArrayDeque<Integer>();
		int tmpsum = 0;
		int sum = 0;
		Deque<int[]> pond = new ArrayDeque<int[]>();
		for(int i=0; i<str.length(); i++) {
			switch(str.charAt(i)) {
				case '\\':
					stack.addLast(i);
					break;
				case '/':
					if(!stack.isEmpty()) {
						int t = stack.pollLast();
						sum += i-t;
						if(pond.isEmpty()) {
							int[] data = {i, t, i-t};
							pond.addLast(data);
						} else {
							int tmppond = i-t;
							while(!pond.isEmpty()) {
								int[] tmp = pond.peekLast();
								if(tmp[0] < t) break;
								tmppond += tmp[2];
								pond.removeLast();
							}
							int[] data = {i, t, tmppond};
							pond.addLast(data);
						}
					}
					break;
				default:
					break;
			}
		}
		System.out.println(sum);
		if(pond.size() == 0) {
			System.out.println(0);
		} else {
			int size = pond.size();
			System.out.print(size + " ");
			for(int i=0; i<size; i++) {
				if(i == size-1) System.out.print(pond.pollFirst()[2]);
				else System.out.print(pond.pollFirst()[2] + " ");
			}
			System.out.println();
		}
	}
	
	// Read Class
	static class FS {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
	
		private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
		private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
		private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
	
		public boolean hasNext() { skipUnprintable(); return hasNextByte();}
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while(isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		public int nextInt() {
			return (int)nextLong();
		}
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while(true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if(b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}

Compiler output:
Main.java:8: error: class Alds1_3_d is public, should be declared in a file named Alds1_3_d.java
public class Alds1_3_d {
       ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main{

	public static void main(String[] args) throws IOException{
		
		/*
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		*/
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<Integer> list = new ArrayList<Integer>();

		int heights = null;
		String str = "";

		String str = br.readLine();
		int[] heights = new int[str.length() + 1];
		heights[0] = 0;

		int height = 0;
		for(int i = 0; i < str.length(); i++){
			char c = str.charAt(i);
			switch(c){
				case '\\' :
					height--;
					break;
				case '/' :
					height++;
					break;
			}
			heights[i+1] = height;
		}
		int no = 0;
		int limit = str.length()+1;
		for(int i = 0; i < limit; i++){
			int tmin = heights[i];
			for(int j = i+1; j < limit; j++){
				if(heights[i] < heights[j]) break;
				if(heights[i] == heights[j]){
					if(tmin == heights[i]) break;
					else{
						list.add(i);
						list.add(j);
						no++;
						i = j-1;
						break;
					}
				}
				if(tmin > heights[j]) tmin = heights[j];
			}
		}

		double[] areas = new double[no];
		for(int i = 0; i < areas.length; i++){
			int start = list.get(i * 2);
			int end = list.get(i * 2 + 1);

			height = 0;
			double area = .0;
			for(int j = start; j < end; j++){
				char c = str.charAt(j);
				
				area = area + height;
				switch(c){
					case '\\' :
						heigth++;
						area += 0.5;
						break;
					case '/' :
						height--;
						area += 0.5;
						break;
				}
			}
			areas[i] = area;
		}

		int sum = 0;
		for(int i = 0; i < areas.length; i++){
			sum += (int) areas[i];
		}
		System.out.printf("%d\n", sum);
		System.out.printf("%d", no);
		for(int i = 0; i < areas.length; i++){
			System.out.printf(" %d", (int) areas[i]);
		}
		System.out.printf("\n");
	}
}

Compiler output:
Main.java:15: error: incompatible types: <null> cannot be converted to int
		int heights = null;
		              ^
Main.java:18: error: variable str is already defined in method main(String[])
		String str = br.readLine();
		       ^
Main.java:19: error: variable heights is already defined in method main(String[])
		int[] heights = new int[str.length() + 1];
		      ^
Main.java:68: error: cannot find symbol
						heigth++;
						^
  symbol:   variable heigth
  location: class Main
4 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main{

	public static void main(String[] args) throws IOException{
		
		/*
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		*/
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<Integer> list = new ArrayList<Integer>();

		int[] heights = null;
		String str = "";

		String str = br.readLine();
		int[] heights = new int[str.length() + 1];
		heights[0] = 0;

		int height = 0;
		for(int i = 0; i < str.length(); i++){
			char c = str.charAt(i);
			switch(c){
				case '\\' :
					height--;
					break;
				case '/' :
					height++;
					break;
			}
			heights[i+1] = height;
		}
		int no = 0;
		int limit = str.length()+1;
		for(int i = 0; i < limit; i++){
			int tmin = heights[i];
			for(int j = i+1; j < limit; j++){
				if(heights[i] < heights[j]) break;
				if(heights[i] == heights[j]){
					if(tmin == heights[i]) break;
					else{
						list.add(i);
						list.add(j);
						no++;
						i = j-1;
						break;
					}
				}
				if(tmin > heights[j]) tmin = heights[j];
			}
		}

		double[] areas = new double[no];
		for(int i = 0; i < areas.length; i++){
			int start = list.get(i * 2);
			int end = list.get(i * 2 + 1);

			height = 0;
			double area = .0;
			for(int j = start; j < end; j++){
				char c = str.charAt(j);
				
				area = area + height;
				switch(c){
					case '\\' :
						heigth++;
						area += 0.5;
						break;
					case '/' :
						height--;
						area += 0.5;
						break;
				}
			}
			areas[i] = area;
		}

		int sum = 0;
		for(int i = 0; i < areas.length; i++){
			sum += (int) areas[i];
		}
		System.out.printf("%d\n", sum);
		System.out.printf("%d", no);
		for(int i = 0; i < areas.length; i++){
			System.out.printf(" %d", (int) areas[i]);
		}
		System.out.printf("\n");
	}
}

Compiler output:
Main.java:18: error: variable str is already defined in method main(String[])
		String str = br.readLine();
		       ^
Main.java:19: error: variable heights is already defined in method main(String[])
		int[] heights = new int[str.length() + 1];
		      ^
Main.java:68: error: cannot find symbol
						heigth++;
						^
  symbol:   variable heigth
  location: class Main
3 errors
Language: C

#include <stdio.h>

int main(void)
{
  gets();
  printf("4\n");
  printf("1 4 ");

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    5 |   gets();
      |   ^~~~
      |   fgets
Language: C

#include <stdio.h>
 
struct stack {
    int data[20000];
    int point;
};

int whereDownHill(struct stack *mountain);

void calculateWater(struct stack *mountain, struct stack *width);

int main(void) {
    char str[30000] = {};
    int i = 0;
    int j = 0;
    struct stack mountain = {};
    struct stack width = {};
    int tmp = 0;
    int tmp1 = 0;
    int sum = 0;
	int location_downhill = 0;
	
    for ( i = 0; i < 20000; i++ ) {
        mountain.data[i] = -3;
    }
     
    fgets(str,30000, stdin);
	
    i = 0;
    while(str[i] != '\0' ) {
        switch(str[i]) {
            case '\\':
                mountain.data[mountain.point] = 0;
                mountain.point++;
                break;
            case '_':
                mountain.data[mountain.point] = -1;
                mountain.point++;
                break;
             
            case '/':
                location_downhill = whereDownHill(&mountain);
                 
                if ( location_downhill >= 0 ) {
                    calculateWater(&mountain, &width);
                }
        		break;
        	
            default:
                break;
        }
        i++;
    }
	
	
    j = 0;
    for ( i = 0; i < mountain.point; i++ ) {
        if ( mountain.data[i] > 0) {
            j++;
            sum += mountain.data[i];
        }
    }
     
    printf("%d\n", sum);
    printf("%d", j);
    for ( i = 0; i < mountain.point; i++ ) {
        if ( mountain.data[i] > 0) {
            printf(" %d", mountain.data[i]);
        }
    }
    printf("\n");
     
    return 0;
}


int whereDownHill(struct stack *mountain)
{
	int location_downhill = 0;
	location_downhill = mountain -> point;
	
	while ( location_downhill >= 0 ) {
		location_downhill--;
		if ( mountain->data[location_downhill] != 0 ) {
			break; 
		}
	}
	return location_downhill;
}


void calculateWater(struct stack *mountain, struct stack *width)
{
	int sum_width = 0;
	int sum_water = 0;

	(mountain->point)--;
	while ( (mountain->data)[mountain->point] != 0 ) {
		if ( (mountain->data)[mountain->point] > 0 ) {
			width.point--;
			sum_width += (width->data)[width->point];
			sum_water += (mountain->data)[mountain->point];
		} else {
			tmp ++;
		}
		(mountain->point)--;
	}
	sum_water += 1 + sum_width;
	sum_width += 2;
	(mountain->data)[mountain->point] = sum_water;
	(width->data)[width->point] = sum_width;
	(width->point)++;
	(mountain->point)++;
}


Compiler output:
main.c: In function 'calculateWater':
main.c:100:30: error: 'width' is a pointer; did you mean to use '->'?
  100 |                         width.point--;
      |                              ^
      |                              ->
main.c:104:25: error: 'tmp' undeclared (first use in this function)
  104 |                         tmp ++;
      |                         ^~~
main.c:104:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>

typedef struct Eq{
     int location ,eq;
     }S;

 int pop1();
 S pop2();
 void push1(int);
 void push2(int,int);

 int S1[20000];
 int S2[20000];

 int top1=0;
 int top2=0;

 int main(){
     int i,j,n,add,sum=0;
     char C[20000];
     scanf("%s",C);
     n=stlen(C);
     for(i=0;i<n;i++){
           if(C[i]=='\\'){
                 push1(i);
                 }
           else if(top1>0&&C[i]=='/'){
                 j=pop1();
                 add=i-j;
                 sum+=add;
                 while(top2>0&&S2[top2-1].location>j){
                       add+=pop2().eq;
                       }
                 push2(j,add);
                 }
           }
     printf("%d\n",sum);
     printf("%d",top2);
     for(i=0;i<top2;i++){
            printf(" %d",S2[i].eq);
            }
     printf("\n");
     return 0;
     }

 void push1(int i){
     S1[top1]=i;
     top1++;
     }

 int pop1(){
     top1--;
     return S1[top1];
     }

 void push2(int j,int add){
     S2[top2].location=j;
     S2[top2].eq=add;
     top2++;
     }
 
 S pop2(){
     top2--;
     return S2[top2];
     }



Compiler output:
main.c: In function 'main':
main.c:23:8: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   23 |      n=stlen(C);
      |        ^~~~~
      |        strlen
main.c:32:42: error: request for member 'location' in something not a structure or union
   32 |                  while(top2>0&&S2[top2-1].location>j){
      |                                          ^
main.c:41:31: error: request for member 'eq' in something not a structure or union
   41 |             printf(" %d",S2[i].eq);
      |                               ^
main.c: In function 'push2':
main.c:58:14: error: request for member 'location' in something not a structure or union
   58 |      S2[top2].location=j;
      |              ^
main.c:59:14: error: request for member 'eq' in something not a structure or union
   59 |      S2[top2].eq=add;
      |              ^
main.c: In function 'pop2':
main.c:65:15: error: incompatible types when returning type 'int' but 'S' {aka 'struct Eq'} was expected
   65 |      return S2[top2];
      |             ~~^~~~~~
Language: C

#include<stdio.h>
#include<string.h>

typedef struct Eq{
     int location ,eq;
     }S;

 int pop1();
 S pop2();
 void push1(int);
 void push2(int,int);

 int S1[20000];
 S S2[20000];

 int top1=0;
 int top2=0;

 int main(){
     int i,j,n,add,sum=0;
     char C[20000];
     scanf("%s",C);
     n=stlen(C);
     for(i=0;i<n;i++){
           if(C[i]=='\\'){
                 push1(i);
                 }
           else if(top1>0&&C[i]=='/'){
                 j=pop1();
                 add=i-j;
                 sum+=add;
                 while(top2>0&&S2[top2-1].location>j){
                       add+=pop2().eq;
                       }
                 push2(j,add);
                 }
           }
     printf("%d\n",sum);
     printf("%d",top2);
     for(i=0;i<top2;i++){
            printf(" %d",S2[i].eq);
            }
     printf("\n");
     return 0;
     }

 void push1(int i){
     S1[top1]=i;
     top1++;
     }

 int pop1(){
     top1--;
     return S1[top1];
     }

 void push2(int j,int add){
     S2[top2].location=j;
     S2[top2].eq=add;
     top2++;
     }
 
 S pop2(){
     top2--;
     return S2[top2];
     }



Compiler output:
main.c: In function 'main':
main.c:23:8: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   23 |      n=stlen(C);
      |        ^~~~~
      |        strlen