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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N, M;
  cin >> N >> M;
  vector<int> a(M*2);
  vector<int> b(N);
  for (int i = 0; i < M*2; i++) {
    cin >> a.at(i);
      
    for (int j = 0; j < N; j++) {
      
      if (a.at(i) = j + 1) {
        b.at(j)++;
      }
    }
  }
  for (int k = 0); k < N; k++) {
    cout << b.at(k) << endl;
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: expected ';' before ')' token
   20 |   for (int k = 0); k < N; k++) {
      |                 ^
      |                 ;
a.cc:20:17: error: expected primary-expression before ')' token
a.cc:20:17: error: expected ';' before ')' token
   20 |   for (int k = 0); k < N; k++) {
      |                 ^
      |                 ;
a.cc:20:20: error: 'k' was not declared in this scope
   20 |   for (int k = 0); k < N; k++) {
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N, M;
  cin >> N >> M;
  vector<int> a(M*2);
  vector<int> b(N);
  for (int i = 0; i < M*2; i++) {
    cin >> a.at(i);
      
    for (int j = 0; j < N; j++) {
      
      if (a.at(i) = j + 1) {
        b.at(j)++
      }
    }
  }
  for (int k = 0); k < N; k++) {
    cout << b.at(k) << endl;
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: expected ';' before '}' token
   16 |         b.at(j)++
      |                  ^
      |                  ;
   17 |       }
      |       ~           
a.cc:20:17: error: expected ';' before ')' token
   20 |   for (int k = 0); k < N; k++) {
      |                 ^
      |                 ;
a.cc:20:17: error: expected primary-expression before ')' token
a.cc:20:17: error: expected ';' before ')' token
   20 |   for (int k = 0); k < N; k++) {
      |                 ^
      |                 ;
a.cc:20:20: error: 'k' was not declared in this scope
   20 |   for (int k = 0); k < N; k++) {
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N, M;
  cin >> N >> M;
  vector(int) a(M*2);
  vector(int) b(N);
  for (int i = 0; i < M*2; i++) {
    cin >> a.at(i);
      
    for (int j = 0; j < N; j++) {
      
      if (a.at(i) = j + 1) {
        b.at(j)++
      }
    }
  }
  for (int k = 0); k < N; k++) {
    cout << b.at(k) << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: missing template arguments before '(' token
    8 |   vector(int) a(M*2);
      |         ^
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector(int) a(M*2);
      |          ^~~
a.cc:9:9: error: missing template arguments before '(' token
    9 |   vector(int) b(N);
      |         ^
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector(int) b(N);
      |          ^~~
a.cc:11:12: error: 'a' was not declared in this scope
   11 |     cin >> a.at(i);
      |            ^
a.cc:16:9: error: 'b' was not declared in this scope
   16 |         b.at(j)++
      |         ^
a.cc:20:17: error: expected ';' before ')' token
   20 |   for (int k = 0); k < N; k++) {
      |                 ^
      |                 ;
a.cc:20:17: error: expected primary-expression before ')' token
a.cc:20:17: error: expected ';' before ')' token
   20 |   for (int k = 0); k < N; k++) {
      |                 ^
      |                 ;
a.cc:20:20: error: 'k' was not declared in this scope
   20 |   for (int k = 0); k < N; k++) {
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> u(m*2);
  int s =0;
  
  for(int i =0; i <m*2 ;i++){
    cin >> u.at(i);
  }
    for(int j =0; j <n; j++) {
      if(j == u.at(i) ) {
        s++;
      cout << s << endl;
      }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: 'i' was not declared in this scope
   14 |       if(j == u.at(i) ) {
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> u(m*2);
  int s =0;
  
  for(int i =0; i <m*2 ;i++){
    cin >> u.at(i);
    for(int j =0; j <n; j++) {
      if(j == u.at(i) ) {
        s++
      }
      cout << s << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: expected ';' before '}' token
   14 |         s++
      |            ^
      |            ;
   15 |       }
      |       ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> u(n);
  for(int i = 0; i<n; i++) {
    u.at(i) = 0;
  }
    
  for(int i =0; i < m; i++) {
    vector<int> v(2);
    cin >> v.at(0) >> v.at(2);
    for(int j =0; j < n; j++) {
      if ( j == v.at(0) ) {
        u.at(j)++
      }
      else if ( j == v.at(1) ) {
        u.at(j)++
      }
    }
  }
  for(int i = 0; i < n; i++) {
    cout << u.at(i) << endl;
  }
}   


Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected ';' before '}' token
   17 |         u.at(j)++
      |                  ^
      |                  ;
   18 |       }
      |       ~           
a.cc:20:18: error: expected ';' before '}' token
   20 |         u.at(j)++
      |                  ^
      |                  ;
   21 |       }
      |       ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  vecort<int> u(n);
  for(int i = 0; i<n; i++) {
    u.at(i) = 0;
  }
    
  for(int i =0; i < m; i++) {
    vector<int> v(2);
    cin >> v.at(0) >> v.at(2);
    for(int j =0; j < n; j++) {
      if ( j == v.at(0) ) {
        u.at(j)++
      }
      else if ( j == v.at(1) ) {
        u.at(j)++
      }
    }
  }
  for(int i = 0; i < n; i++) {
    cout << u.at(i) << endl;
  }
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vecort' was not declared in this scope
    7 |   vecort<int> u(n);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vecort<int> u(n);
      |          ^~~
a.cc:9:5: error: 'u' was not declared in this scope
    9 |     u.at(i) = 0;
      |     ^
a.cc:17:9: error: 'u' was not declared in this scope
   17 |         u.at(j)++
      |         ^
a.cc:20:9: error: 'u' was not declared in this scope
   20 |         u.at(j)++
      |         ^
a.cc:25:13: error: 'u' was not declared in this scope
   25 |     cout << u.at(i) << endl;
      |             ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>



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

using namespace std;
int n;
int a[200000];

int main(){
  cin >> n >> m;
  REP(i,m){
    int m1,m2;
    cin >> m1 >> m2;
    a[m1-1]++;
    a[m2-1]++;
  }
  REP(i,n){
    cout << a[i] << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: 'm' was not declared in this scope; did you mean 'tm'?
   21 |   cin >> n >> m;
      |               ^
      |               tm
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  int N, M, a, b;
  cin >> N >> M;
  int counter[55] = {0};//バケット
  for (int i = 0; i < M; i++){
    cin >> a >> b;
    counter[a]++;
    counter[b]++;
    //cout << endl;
  }
  for (int i = 1; i < N + 1; i++){
    cout << counter[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  int N, M, a, b;
  cin >> N >> M;
  int counter[55] = {0];//バケット
  for (int i = 0; i < M; i++){
    cin >> a >> b;
    counter[a]++;
    counter[b]++;
    //cout << endl;
  }
  for (int i = 1; i < N + 1; i++){
    cout << counter[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected '}' before ']' token
    7 |   int counter[55] = {0];//バケット
      |                     ~ ^
a.cc:7:23: error: expected ',' or ';' before ']' token
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    //入力部
    int N,M;
    cin>>N>>M;
    vector<int>a(M);
    vector<int>b(M);
    vector<int>c(N);
    for(int i = 0;i < M; i++){
        cin>>a.at(i)>>b.at(i);
    }
    //上下の文字列
    for(int i = 0;i < N; i++){
      for(int j=0;j < M; j++){
        if (i + 1== a[j]|| i+1==b[j])
          c[i]++;
      }
    }
    for(int i =0;i<N;i++)
      cout<<c.at[i]<<endl;

    }


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   22 |       cout<<c.at[i]<<endl;
      |                 ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;
int main()
{
	int n, m;
	
	cin >> n >> m;
	
	vector<int> st(m*2);
	for (int i = 0; i < m*2; i++) {
		cin >> st.at(i);
	}

	for (int i = 1; i <= n; i++) {
		cout << std::count(st.begin(),st.end(),i) << endl;
	}
		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: 'count' is not a member of 'std'; did you mean 'cout'?
   17 |                 cout << std::count(st.begin(),st.end(),i) << endl;
      |                              ^~~~~
      |                              cout
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int N,M;
  cin>>N>>M;
  vector<int> vec(N;0);
  for (int i=0;i<M;i++){
    int a,b;
    cin>>a>>b;
    vec.at(a+1)++;
    vec.at(b+1)++;
  }
  for (int i=0;i<M;i++){
    cout<<vec.at(i)<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected ')' before ';' token
    7 |   vector<int> vec(N;0);
      |                  ~ ^
      |                    )
a.cc:7:22: error: expected ';' before ')' token
    7 |   vector<int> vec(N;0);
      |                      ^
      |                      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N,M;
  cin >>N >>M;
  vector<int> a(M);
  vector<int> b(M);
  for(int i=0; i<M; i++)
    cin >>a.at(i) >>b.at(i);
  for(int i=0; i<N; i++){
    int x=0;
    for(int j=0; j<M; j++){
      if(a.at(j)==(i+1)||b.at(j)==(i+1))
        x++;
    }
    cout <<x <<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: expected primary-expression before '<' token
   17 |     cout <<x <<<endl;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N,M;
  cin >>N >>M;
  vecter<int> a(M);
  vector<int> b(M);
  for(int i=0; i<M; i++)
    cin >>a.at(i) >>b.at(i);
  for(int i=0; i<N; i++){
    int x=0;
    for(int j=0; j<M; j++){
      if(a.at(j)=='i')
        x++;
    }
    cout <<x <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vecter' was not declared in this scope
    7 |   vecter<int> a(M);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vecter<int> a(M);
      |          ^~~
a.cc:10:11: error: 'a' was not declared in this scope
   10 |     cin >>a.at(i) >>b.at(i);
      |           ^
a.cc:14:10: error: 'a' was not declared in this scope
   14 |       if(a.at(j)=='i')
      |          ^
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;

int main(){
	int a,b;
	int n,m;
	cin>>n>>m;
  vector<int> c(55)
	for(int i=0;i<m;i++){
		cin>>a>>b;
		c.at(a)++;
		c.at(b)++;
	}
	for(int i=0;i<n;i++){
		cout<<c.at(i)<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'vector' was not declared in this scope
   13 |   vector<int> c(55)
      |   ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include<algorithm>
  +++ |+#include <vector>
    6 | 
a.cc:13:10: error: expected primary-expression before 'int'
   13 |   vector<int> c(55)
      |          ^~~
a.cc:14:21: error: 'i' was not declared in this scope
   14 |         for(int i=0;i<m;i++){
      |                     ^
a.cc:20:23: error: 'c' was not declared in this scope
   20 |                 cout<<c.at(i)<<endl;
      |                       ^
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;

vector<int> c;

int main(){
	int a,b;
	int n,m;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>a>>b;
		c.at(a)++;
		c.at(b)++;
	}
	for(int i=0;i<n;i++){
		cout<<c.at(i)<<endl;
    }
}


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<int> c;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:17:17: error: 'c' was not declared in this scope
   17 |                 c.at(a)++;
      |                 ^
a.cc:21:23: error: 'c' was not declared in this scope
   21 |                 cout<<c.at(i)<<endl;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  vector<int> r(m)
  for(int i=0;i<2*m;i++){
    cin >> r.at(i);
  }
  for(int i=0;i<n;i++){
    int x=0;
    for(int j=0;j<2*m;j++){
      if(r.at(j)==i){
        x++;
      }
    }
    cout << x << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'for'
   11 |   for(int i=0;i<2*m;i++){
      |   ^~~
a.cc:11:15: error: 'i' was not declared in this scope
   11 |   for(int i=0;i<2*m;i++){
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N,M;
  cin >> N >> M;
  vetor<int> r(2*M);
  for(int i=0; i<2*M; i++){
    cin >> r.at(i);
  }
  for(int j=1; j<=N; j++){
    int a=0;
    for(int i=0; i<2*M; i++){
      if(r.at(i)==j){
        a++;
      }
    }
    cout << a << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vetor' was not declared in this scope
    7 |   vetor<int> r(2*M);
      |   ^~~~~
a.cc:7:9: error: expected primary-expression before 'int'
    7 |   vetor<int> r(2*M);
      |         ^~~
a.cc:9:12: error: 'r' was not declared in this scope
    9 |     cin >> r.at(i);
      |            ^
a.cc:14:10: error: 'r' was not declared in this scope
   14 |       if(r.at(i)==j){
      |          ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;


int main(){
    int a[]={};
    int b[]={};
    int c[]={};
    int d[]={};
    int N,M;
    cin >> N >> M;
    a[M] = {};
    for(int i = 0;i<M;i++){
        cin >> a[i] >> b[i];
        c[a[i]]++;
        c[b[i]]++
    }   
    for(int i = 0;i<N;i++){
        cout << c[i]<<endl;

    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: expected ';' before '}' token
   16 |         c[b[i]]++
      |                  ^
      |                  ;
   17 |     }
      |     ~
Language: Java

import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int a[] = new int[M];
        int b[] = new int[M];
        
        for(int i=0; i<M; i++){
            a = sc.nextInt();
            b = sc.nextInt();
        }
        
        HashMap<String, Integer> cnt = new HashMap<String, Integer>();
        for(int i=0; i<M; i++){
        cnt.put(a[i], 0);
        cnt.put(b[i], 0);
        }
        
        for(int i=0; i<M; i++){
        cnt.put(a[i], cnt.get(a[i])+1);
        cnt.put(b[i], cnt.get(b[i])+1);
        }
        
        for(int i=0; i<M; i++){
            System.out.println(cnt.get[i]);
        }
        
    }
}

Compiler output:
Main.java:11: error: incompatible types: int cannot be converted to int[]
            a = sc.nextInt();
                          ^
Main.java:12: error: incompatible types: int cannot be converted to int[]
            b = sc.nextInt();
                          ^
Main.java:17: error: incompatible types: int cannot be converted to String
        cnt.put(a[i], 0);
                 ^
Main.java:18: error: incompatible types: int cannot be converted to String
        cnt.put(b[i], 0);
                 ^
Main.java:22: error: incompatible types: int cannot be converted to String
        cnt.put(a[i], cnt.get(a[i])+1);
                 ^
Main.java:23: error: incompatible types: int cannot be converted to String
        cnt.put(b[i], cnt.get(b[i])+1);
                 ^
Main.java:27: error: cannot find symbol
            System.out.println(cnt.get[i]);
                                  ^
  symbol:   variable get
  location: variable cnt of type HashMap<String,Integer>
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
7 errors
Language: Java

import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int a[] = new int[M];
        int b[] = new int[M];
        
        for(int i=0; i<M; i++){
            a = sc.nextInt();
            b = sc.nextInt();
        }
        
        HashMap<String, Integer> cnt = new HashMap<String, Integer>();
        for(int i=0; i<M; i++){
        cnt.put(a[i], 0);
        cnt.put(b[i], 0);
        }
        
        for(int i=0; i<M; i++){
        cnt.put(a[i], cnt.get(a[i])+1);
        cnt.put(b[i], cnt.get(b[i])+1);
        }
        
        for(int i=0; i<; i++){
            System.out.println(cnt.get[i]);
        }
        
    }
}

Compiler output:
Main.java:26: error: illegal start of expression
        for(int i=0; i<; i++){
                       ^
1 error
Language: Java

import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int a[] = new int[M];
        int b[] = new int[M];
        
        for(int i=0; i<M; i++){
            a[] = sc.nextInt();
            b[] = sc.nextInt();
        }
        
        HashMap<String, Integer> cnt = new HashMap<String, Integer>();
        for(int i=0; i<M; i++){
        cnt.put(a[i], 0);
        cnt.put(b[i], 0);
        }
        
        for(int i=0; i<M; i++){
        cnt.put(a[i], cnt.get([i])+1);
        cnt.put(b[i], cnt.get([i])+1);
        }
        
        for(int i=0; i<; i++){
            System.out.println(cnt.get[i]);
        }
        
    }
}

Compiler output:
Main.java:11: error: not a statement
            a[] = sc.nextInt();
             ^
Main.java:11: error: ';' expected
            a[] = sc.nextInt();
               ^
Main.java:12: error: not a statement
            b[] = sc.nextInt();
             ^
Main.java:12: error: ';' expected
            b[] = sc.nextInt();
               ^
Main.java:22: error: illegal start of expression
        cnt.put(a[i], cnt.get([i])+1);
                              ^
Main.java:22: error: not a statement
        cnt.put(a[i], cnt.get([i])+1);
                                  ^
Main.java:22: error: ';' expected
        cnt.put(a[i], cnt.get([i])+1);
                                    ^
Main.java:23: error: illegal start of expression
        cnt.put(b[i], cnt.get([i])+1);
                              ^
Main.java:23: error: not a statement
        cnt.put(b[i], cnt.get([i])+1);
                                  ^
Main.java:23: error: ';' expected
        cnt.put(b[i], cnt.get([i])+1);
                                    ^
Main.java:26: error: illegal start of expression
        for(int i=0; i<; i++){
                       ^
11 errors
Language: C++

#include<iostream>
using namespace std;

int main() {
  int n,m,a,b,v[50]={0};
  cin >> n >> m;
  for(int i=0; i<m; i++) {
    cin >> a >> b;
    v[a]++;
    v[b]++;
  }
  for(int i=0; i<n; i++) {
    cout << v[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {

	int N[60] ={0};
	int M;
	int t;
	cin >> t >> M;
	
	for (int i = 0; i < M; i++)
	{
		int a,b;
		cin >> a >> b;
		N[a]++;
		N[b]++;
	}
	for each (int var in N)
	{
		if(var){
		cout << var << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: expected '(' before 'each'
   18 |         for each (int var in N)
      |             ^~~~
      |             (
a.cc:18:19: error: expected primary-expression before 'int'
   18 |         for each (int var in N)
      |                   ^~~
a.cc:18:13: error: 'each' was not declared in this scope
   18 |         for each (int var in N)
      |             ^~~~
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
a.cc:23:10: error: expected ';' before '}' token
   23 |         }
      |          ^
      |          ;
   24 | }
      | ~         
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
a.cc:23:10: error: expected ')' before '}' token
   23 |         }
      |          ^
      |          )
   24 | }
      | ~         
a.cc:18:13: note: to match this '('
   18 |         for each (int var in N)
      |             ^~~~
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <set>

using namespace std;

int main() {
	int N[60] ={0};
	int M;
	int t;
	cin >> t >> M;
	
	for (int i = 0; i < M; i++)
	{
		int a,b;
		cin >> a >> b;
		N[a]++;
		N[b]++;
	}
	for each (int var in N)
	{
		if(var){
		cout << var << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: expected '(' before 'each'
   20 |         for each (int var in N)
      |             ^~~~
      |             (
a.cc:20:19: error: expected primary-expression before 'int'
   20 |         for each (int var in N)
      |                   ^~~
a.cc:20:13: error: 'each' was not declared in this scope
   20 |         for each (int var in N)
      |             ^~~~
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
a.cc:25:10: error: expected ';' before '}' token
   25 |         }
      |          ^
      |          ;
   26 | }
      | ~         
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
a.cc:25:10: error: expected ')' before '}' token
   25 |         }
      |          ^
      |          )
   26 | }
      | ~         
a.cc:20:13: note: to match this '('
   20 |         for each (int var in N)
      |             ^~~~
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <set>

using namespace std;

int main() {
	
	int N[60] ={0};
	int M;
	int t;
	cin >> t >> M;
	
	for (int i = 0; i < M; i++)
	{
		int a,b;
		cin >> a >> b;
		N[a]++;
		N[b]++;
	}
	for each (int var in N)
	{
		if(var){
		cout << var << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: expected '(' before 'each'
   21 |         for each (int var in N)
      |             ^~~~
      |             (
a.cc:21:19: error: expected primary-expression before 'int'
   21 |         for each (int var in N)
      |                   ^~~
a.cc:21:13: error: 'each' was not declared in this scope
   21 |         for each (int var in N)
      |             ^~~~
a.cc:27:1: error: expected primary-expression before '}' token
   27 | }
      | ^
a.cc:26:10: error: expected ';' before '}' token
   26 |         }
      |          ^
      |          ;
   27 | }
      | ~         
a.cc:27:1: error: expected primary-expression before '}' token
   27 | }
      | ^
a.cc:26:10: error: expected ')' before '}' token
   26 |         }
      |          ^
      |          )
   27 | }
      | ~         
a.cc:21:13: note: to match this '('
   21 |         for each (int var in N)
      |             ^~~~
a.cc:27:1: error: expected primary-expression before '}' token
   27 | }
      | ^
Language: C++

import collections

N, M = map(int, input().split())
a, b = [0] * M, [0] * M
for i in range(M):
    a[i], b[i] = map(int, input().split())

c = collections.Counter(a + b)

for i in range(1, N + 1):
    print(c[i])


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import collections
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(void){
    int N,M;
    cin>>N>>M;
    int cnt[N];
    for(int i=0;i<N;i++)
        cnt[[i=0;

    for(int i=0;i<M;i++){
        int a,b;
        cin>>a>>b;
        cnt[a-1]++;
        cnt[b-1]++;
    }

    for(int i=0;i<N;i++)
        cout<<cnt[i]<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: two consecutive '[' shall only introduce an attribute before '[' token
    9 |         cnt[[i=0;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(void){
    int N,M;
    cin>>N>>M;
    int cnt[N];

    for(int i=0;i<M;i++){{
        int a,b;
        cin>>a>>b;
        cnt[a-1]++;
        cnt[b-1]++;
    }

    for(int i=0;i<N;i++)
        cout<<cnt[i]<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#Include<bits/stdc++.h>
using namespace std;

int main(void){
    int N,M;
    cin>>N>>M;
    int cnt[N];

    for(int i=0;i<M;i++){{
        int a,b;
        cin>>a>>b;
        cnt[a-1]++;
        cnt[b-1]++;
    }

    for(int i=0;i<N;i++)
        cout<<cnt[i]<<endl;

    return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>N>>M;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #Include<bits/stdc++.h>
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout<<cnt[i]<<endl;
      |         ^~~~
a.cc:17:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:23: error: 'endl' was not declared in this scope
   17 |         cout<<cnt[i]<<endl;
      |                       ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #Include<bits/stdc++.h>
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, r, c;
  cin >> N >> M;
  int matrix[N][N];
  for (int i = 0; i < M; i++) {
    cin >> r >> c;
    matrix[r][c] = 1;
    matrix[c][r] = 1;
  }
  for (int i = 0; i < N; i++) {
    int num = 0
    for (int j = 0; j < N; j++) {
      num += matrix[i][j]
    }
    cout << num << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected ',' or ';' before 'for'
   15 |     for (int j = 0; j < N; j++) {
      |     ^~~
a.cc:15:21: error: 'j' was not declared in this scope
   15 |     for (int j = 0; j < N; j++) {
      |                     ^
Language: C++

#include <iostream>
using namespae std;

int main(){
  int n,m;
  cin >> n >> m;
  int a[m],b[m];
  for(int i=0;i<m;i++){
    cin >> a[i] >> b[i];
  }
  int ans[n];
  for(int i=0;i<n;i++){
    ans[i]=0;
  }
  for(int i=0;i<m;i++){
    ans[a[i]-1]++;
    ans[b[i]-1]++;
  }
  for(int i=0;i<n;i++){
    cout << ans[i] << endl;
  }
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespae'
    2 | using namespae std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n >> m;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout << ans[i] << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |     cout << ans[i] << endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

/* REPmacro */
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i)
#define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i)

/*alias*/
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define MP make_pair 

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

/*using*/
using ll = long long;
using ull = unsigned long long;
using unsi = unsigned;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using db = double;
using plex = complex<double>;
using vs = vector<string>;

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

/*struct*/
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const db EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

//#define int ll
//#define int long long

signed main()
{
  int n,m; cin >> n >> m;
  set<int> s;
  int p;
  REP(i,2m){
    cin >> p;
    s.insert(p);
  }
  
  REP(i,2m){
    auto itr = s.find(i)
      cout << *itr << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:9: error: unable to find numeric literal operator 'operator""m'
   63 |   REP(i,2m){
      |         ^~
a.cc:5:39: note: in definition of macro 'REP'
    5 | #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
      |                                       ^
a.cc:68:9: error: unable to find numeric literal operator 'operator""m'
   68 |   REP(i,2m){
      |         ^~
a.cc:5:39: note: in definition of macro 'REP'
    5 | #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
      |                                       ^
a.cc:70:7: error: expected ',' or ';' before 'cout'
   70 |       cout << *itr << endl;
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> L(N);
  
  for (int i = 0; i < M, i++) {
    int a, b;
    cin >> a >> b;
    L.at(a) += 1;
    L.at(b) += 1;
  }
  
  for (int i = 0; i < N, i++) {
    cout << L.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected ';' before ')' token
    9 |   for (int i = 0; i < M, i++) {
      |                             ^
      |                             ;
a.cc:16:29: error: expected ';' before ')' token
   16 |   for (int i = 0; i < N, i++) {
      |                             ^
      |                             ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  
  vector<int> A(N);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    A.at(a-1)++;
    A.at(b-1)++;
  }
  
  for (int i = 0; i < N; i++) {
    cout << A.(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected unqualified-id before '(' token
   17 |     cout << A.(i) << endl;
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  vector <int> road_city(2*m);
  vector <int> road_count(n);
  for (int i=0; i<2*m; i++)
  {
    cin >> road_city.at(i);
  }
  for (int i=0; i<2*m; i++)
  {
    road_count.at(road_city.(i)-1)++;
  }
  for (int i=0; i<n; i++)
  {
    cout << road_count.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: expected unqualified-id before '(' token
   16 |     road_count.at(road_city.(i)-1)++;
      |                             ^
Language: C++

#include <stdc++.h>
using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  vector <int> road_city(2*m);
  vector <int> road_count(n);
  for (int i=0; i<2*m; i++)
  {
    cin >> road_city.at(i);
  }
  for (int i=0; i<2*m; i++)
  {
    road_count.at(road_city.(i)-1)++;
  }
  for (int i=0; i<n; i++)
  {
    cout << road_count.at(i) << endl;
  }
}

Compiler output:
a.cc:1:10: fatal error: stdc++.h: No such file or directory
    1 | #include <stdc++.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() 
{
  int N,M;
  cin >> N >> M;
  vector <int> road_num(N);
  vector <int> road(2*M);
  for (int i=0; i<2*M; i++)
  {
    cin >> road.at(i);
  }
  for (int i=0; i<2*M; i++)
  {
    road_num.at(road.at(i))++
  }
  for (int i=0; i<N; i++)
  {
    cout << road_num.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: expected ';' before '}' token
   16 |     road_num.at(road.at(i))++
      |                              ^
      |                              ;
   17 |   }
      |   ~
Language: C

#include<stdio.h>

int main(){
  int i,j,k;
  int N,M;
  
  scanf("%d %d",&N,&M);
  
  int A[2*M];
  
  for(i=0;i<2*M;i+=2)
    scanf("%d %d",&A[i],&A[i+1]);
  
  int B[N] = {0};
  
  for(i=0;i<2*M;i++){
    B[A[i]]++;
  }
  
  for(i=0;i<N;i++){
    printf("%d\n",B[i]);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:14: error: variable-sized object may not be initialized except with an empty initializer
   14 |   int B[N] = {0};
      |              ^
Language: C++

#include <iostream>
using namespace std;

int main(){

  int N, M;
  cin >> N >> M;
  int a[M], b[M], c[N];
  for(int i=0; i<M; i++){
    cin >> a[i] >> b[i];
  }

  for(int i=0 i<N; i++){
    c[i] = 0;
  }

  for(int i=0; i<M; i++){
    c[a[i]]++;
    c[b[i]]++;
  }

  for(int i=0; i<N; i++){
    cout << c[i] << endl;
  }
  return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: expected ';' before 'i'
   13 |   for(int i=0 i<N; i++){
      |              ^~
      |              ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int city, load;
  int go, back;
  cin >> city >> load;
  vector<int> cities(city);
  for (int i = 0; i < load; i++){
    cin >> go >> back;
    cities.at(go) = cities.at(go) + 1
    cities.at(back) = cities.at(back) + 1
  }
  
  for (int i = 0; i < cities.size(); i++){
    cout << cities.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:38: error: expected ';' before 'cities'
   11 |     cities.at(go) = cities.at(go) + 1
      |                                      ^
      |                                      ;
   12 |     cities.at(back) = cities.at(back) + 1
      |     ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int city, load;
  int go, back;
  cin >> city >> load;
  vector<int> cities(city);
  for (int i = 0; i < load; i++){
    cin >> go >> back;
    city.at(go) = cities.at(go) + 1
    city.at(back) = cities.at(back) + 1
  }
  
  for (int i = 0; i < cities.size(); i++){
    cout << cities.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: request for member 'at' in 'city', which is of non-class type 'int'
   11 |     city.at(go) = cities.at(go) + 1
      |          ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int city, load;
  int go, back;
  cin >> city >> load;
  vector<int> cities(city);
  for (int i = 0; i < load; i++){
    cin >> go >> back;
    city.at(go) = city.at(go) + 1
    city.at(back) = city.at(back) + 1
  }
  
  for (int i = 0; i < len(cities); i++){
    cout << cities.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: request for member 'at' in 'city', which is of non-class type 'int'
   11 |     city.at(go) = city.at(go) + 1
      |          ^~
a.cc:11:24: error: request for member 'at' in 'city', which is of non-class type 'int'
   11 |     city.at(go) = city.at(go) + 1
      |                        ^~
a.cc:15:23: error: 'len' was not declared in this scope
   15 |   for (int i = 0; i < len(cities); i++){
      |                       ^~~
Language: C

#include <stdio.h>
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    int a[m],b[m],road[n];
    for (int i=0;i<m;i++){
        scanf("%d%d",&a[i],&b[i]);
    }
    for (int i=0;i<n;i++){
        for (int j=0;j<m;j++){
            if (i==a[j]){
                road[i]++;
            }
            if (i==b[j]){
                road[i]++;
            }
        }
        print("%d\n",road[i]);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   18 |         print("%d\n",road[i]);
      |         ^~~~~
      |         printf
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int number, city, load, num,load_go, load_back;
  cin >> number;
  city = number[0];
  load = number[1];
  vector<int> cities(city) = {};
  vector<int> loads(load) = {};
  
  for (int i = 0; i < city; i++){
    cities.at[i] = 0;
  }
  
  for (int i = 0; i < load; i++){
    cin >> num
   	load_go = num[0]
    load_back = num[1]
    city.at(load_go) = city.at(load_go) + 1;
    city.at(load_back) = city.at(load_back) + 1;
  }
  
  for (int i = 0; i < city; i++){
    cout << cities.at[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: invalid types 'int[int]' for array subscript
    7 |   city = number[0];
      |                ^
a.cc:8:16: error: invalid types 'int[int]' for array subscript
    8 |   load = number[1];
      |                ^
a.cc:9:28: error: expected ',' or ';' before '=' token
    9 |   vector<int> cities(city) = {};
      |                            ^
a.cc:10:27: error: expected ',' or ';' before '=' token
   10 |   vector<int> loads(load) = {};
      |                           ^
a.cc:13:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |     cities.at[i] = 0;
      |              ^
a.cc:17:15: error: expected ';' before 'load_go'
   17 |     cin >> num
      |               ^
      |               ;
   18 |         load_go = num[0]
      |         ~~~~~~~
a.cc:21:10: error: request for member 'at' in 'city', which is of non-class type 'int'
   21 |     city.at(load_back) = city.at(load_back) + 1;
      |          ^~
a.cc:21:31: error: request for member 'at' in 'city', which is of non-class type 'int'
   21 |     city.at(load_back) = city.at(load_back) + 1;
      |                               ^~
a.cc:25:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |     cout << cities.at[i] << endl;
      |                      ^
Language: C++

#include <iostream>
using ll = long long;
const int AMAX = (int)1e5;
ll cnt[AMAX + 1];

int main() {
    int N;
    ll K;
    cin >> N >> K;

    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        cnt[a] += b;
    }

    for (int ans = 1; ans <= AMAX; ++ans) {
        if (K <= cnt[ans]) {
            cout << ans << endl;
            return 0;
        }
        K -= cnt[ans];
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     cin >> N >> K;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |             cout << ans << endl;
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |             cout << ans << endl;
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <iostream>

using namespace std;

int main() {
  cin.tie(0); ios_base::sync_with_stdio(false);
  int N, M;
  int n[50];
  cin >> N >> M;
  for (int i=0; i<M; ++i) {
    int a, b;
    cin >> a >> b;
    ++n[a-1];
    ++n[b-1];
  }
  for (int i=0; i<N; ++i) {
    cout << n[i] << "\n";
  }
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, m; cin >> n >> m;
  int a[m], b[m];
  int c[m] = 0;
  for(int i = 0; i < m; i++){
    cin >> a[i] >> b[i];
    c[a[i]]++; c[b[i]]++;
  }
  for(int i = 0; i < m; i++){
    cout << c[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: array must be initialized with a brace-enclosed initializer
    6 |   int c[m] = 0;
      |              ^
Language: C++

int main(void) {
 int N, M;
 cin >> N >> M;

 const int NMMAX = 50;
 int A[NMMAX], B[NMMAX];

 for (int i = 0; i < M; ++i) {
 cin >> A[i] >> B[i];
 }

 int road[NMMAX];
 for (int i = 0; i < N; ++i) {
 road[i] = 0;
 }

 for (int i = 0; i < M; ++i) {
 road[A[i] - 1] += 1;
 road[B[i] - 1] += 1;
 }

 for (int i = 0; i < N; ++i) {
 cout << road[i] << endl;
 }

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:2: error: 'cin' was not declared in this scope
    3 |  cin >> N >> M;
      |  ^~~
a.cc:23:2: error: 'cout' was not declared in this scope
   23 |  cout << road[i] << endl;
      |  ^~~~
a.cc:23:21: error: 'endl' was not declared in this scope
   23 |  cout << road[i] << endl;
      |                     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main() {
	int N, M, A[N], road1[M], road2[M];
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		cin >> road1[i] >> raod2[i];
	}
	for (int i = 0; i++; i < N) {
		A[i] = 0;
	}
	for (int i = 0; i < M; i++) {
		A[road1[i] - 1]++;
		A[road2[i] - 1]++;

	}
	for (int i = 0; i < N; i++) {
		cout << A[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:36: error: 'raod2' was not declared in this scope; did you mean 'road2'?
    7 |                 cin >> road1[i] >> raod2[i];
      |                                    ^~~~~
      |                                    road2
Language: C++

#include<iostream>
using namespace std;
int main() {
	int N, M, A[N], road1[M], raod2[M];
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		cin >> road1[i] >> raod2[i];
	}
	for (int i = 0; i++; i < N) {
		A[i] = 0;
	}
	for (int i = 0; i < M; i++) {
		A[road1[i] - 1]++;
		A[road2[i] - 1]++;

	}
	for (int i = 0; i < N; i++) {
		cout << A[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'road2' was not declared in this scope; did you mean 'raod2'?
   14 |                 A[road2[i] - 1]++;
      |                   ^~~~~
      |                   raod2
Language: C

#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int N, M;
  cin >> N >> M;
  vector<vector<int>> v(N);
  
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  
  for (int i = 0; i < N; i++) {
    cout << v[i].size() << endl;
  }
  
  return 0;
}
  


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <climits>

using namespace std;

int main(){
  int N, M, a[51], b[51], ans[51] = {0};

  cin >> N >> M;
  for(int i = 0; i < M; i++) cin >> a[i] >> b[i];

  for(int i = 0; i < M; i++){
    ans[a[i]]++;
    ans[b[i]]++:
  }

  for (int i = 1; i <= N; i++) cout << ans[i] << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: expected ';' before ':' token
   17 |     ans[b[i]]++:
      |                ^
      |                ;
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n, m, ab[51] = {0}, a, b;
    cin >> n >> m;
    for(int i = 0; i < m; i++){
        cin >> a >> b;
        ab[a] += 1;
        ab[b] += 1;
    }
    for(int i = 1; i <= n; i++){
        cout << ab[i] << endl;
    }
    return ０;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: '\U0000ff10' was not declared in this scope
   15 |     return ０;
      |            ^~
Language: C++

#include<stdio.h>
using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:50: error: 'cin' was not declared in this scope
    2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
      |                                                  ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
a.cc:2:135: error: 'cout' was not declared in this scope
    2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
      |                                                                                                                                       ^~~~
a.cc:2:135: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:2:147: error: 'endl' was not declared in this scope
    2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
      |                                                                                                                                                   ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<stdio.h>
  +++ |+#include <ostream>
    2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}