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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m;
  
  cin>>n>>m;
  
  int a[n];
  
  for(int i=0;i<n;i++)
    a[i]=0;
  
  for(int i=0;i<m;i++)
    int ai=0;
    int bi=0;
  
    cin>>ai>>bi;
    
    a[ai-1]++;
    a[bi-1]++;
}

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



}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: 'ai' was not declared in this scope; did you mean 'bi'?
   18 |     cin>>ai>>bi;
      |          ^~
      |          bi
a.cc: At global scope:
a.cc:24:3: error: expected unqualified-id before 'for'
   24 |   for(int i=0;i<n;i++)
      |   ^~~
a.cc:24:15: error: 'i' does not name a type
   24 |   for(int i=0;i<n;i++)
      |               ^
a.cc:24:19: error: 'i' does not name a type
   24 |   for(int i=0;i<n;i++)
      |                   ^
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

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

int main() {
  int N,M;
  cin >> N >> M;
  vector<int> out;
  //入力部
  for (int j=0;j<M;j++) {
    int x,y;
    cin >> x >> y;
    out.at(x)++;
    out.at(y)++;
  }
  //出力部
  for (int i=0;i<N;i++) {
    cout << out.at(i) << endl;
}

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

#include<stdio.h>
int main(void){
  int n,m;
  scanf("%d %d",&n,&m);
  int a[50],b[50];
  for(int i=0;i<m;++i){
    scanf("%d %d",&a[i],&b[i]);
  }
  int road[50];
  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){
    printf("%d",road[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:23: error: 'N' undeclared (first use in this function)
   10 |   for (int i = 0; i < N; ++i){
      |                       ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

if __name__ == '__main__':
    a,b = map(int,input().split())
    
    list = [0]*a
    
    for i in range(b):
        n,m=map(int, input().split())
        list[n-1]+=1
        list[m-1]+=1
    for i in list:
        print(i)

Compiler output:
a.cc:21:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   21 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |     a.at(s)++;
      |     ~~~~~~~^~
Language: C++

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

int main() {
  int N,M;
  cin >> N >> M;
  vector<int> a(2*M);
  int x=0;
  
  for(int i=0;i<2*M;i++) {
    cin >> a.at(i);
  }
  
  for(int i=0;i<N;i++) {
    for(int l=0;l<2*M;l++) {
      if(a.at(l)==i+1) {
        x++;
      }
    }
    cout << x << endl;
    x=0:
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: expected ';' before ':' token
   21 |     x=0:
      |        ^
      |        ;
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector(int) buf(N);
  for (int i = 1; i < M + 1; i++) {
    int a, b;
    cin >> a >> b;
    if (a == i) {
      buf.at(i) += 1;
    }
    if (b == i) {
      buf.at(i) += 1;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: missing template arguments before '(' token
    7 |   vector(int) buf(N);
      |         ^
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector(int) buf(N);
      |          ^~~
a.cc:12:7: error: 'buf' was not declared in this scope
   12 |       buf.at(i) += 1;
      |       ^~~
a.cc:15:7: error: 'buf' was not declared in this scope
   15 |       buf.at(i) += 1;
      |       ^~~
Language: C++

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

int main(){
	int N, M;
	cin >> N >> M;
	vector<int> cities(N), roads(2M);
	
	for(int i = 0;i<2M;i++){
		cin >> roads(i);
	}
	
	for(int j = 0;j<2M;j++){
		int c;
		c = roads(j);
		c = c-1;
		cities.at(c)++;
	}
	
	for(int k = 0;k<N;k++){
		cout << cities(k) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:38: error: unable to find numeric literal operator 'operator""M'
    7 |         vector<int> cities(N), roads(2M);
      |                                      ^~
a.cc:9:25: error: unable to find numeric literal operator 'operator""M'
    9 |         for(int i = 0;i<2M;i++){
      |                         ^~
a.cc:10:29: error: no match for call to '(std::vector<int>) (int&)'
   10 |                 cin >> roads(i);
      |                        ~~~~~^~~
a.cc:13:25: error: unable to find numeric literal operator 'operator""M'
   13 |         for(int j = 0;j<2M;j++){
      |                         ^~
a.cc:15:26: error: no match for call to '(std::vector<int>) (int&)'
   15 |                 c = roads(j);
      |                     ~~~~~^~~
a.cc:21:31: error: no match for call to '(std::vector<int>) (int&)'
   21 |                 cout << cities(k) << endl;
      |                         ~~~~~~^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'cin'
    7 |   cin>>N>>M;
      |   ^~~
Language: C++

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

int main(){
  int n,m,ans[100]={};
  cin>>n>>m;
  for(int i=0;i<n;i++){
    for(int j=0;j<2;j++){
      cin>>t;
      ans[t]++;
    }
  }
  for(int i=1;i<=n;i++){
    cout<<ans[i]<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 't' was not declared in this scope
    9 |       cin>>t;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int n,m;
cin >> n>>m;
vector<int>count(m);

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'a' was not declared in this scope
    9 |   cin >> a >> b;
      |          ^
a.cc:9:15: error: 'b' was not declared in this scope
    9 |   cin >> a >> b;
      |               ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |         cout << sum +=1 << endl;
      |                       ~~^~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 |         cout << sum+=1 << endl;
      |                      ~~^~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |         cout << sum+=1 << endl;
      |                      ~~^~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: no match for 'operator+=' (operand types are 'std::basic_ostream<char>' and 'int')
   17 |         cout << sum+=1;
      |         ~~~~~~~~~~~^~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |         cout << sum+=1 << endl;
      |                      ~~^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |         cout << sum+=1 << endl;
      |                      ~~^~~~~~~
Language: C++

int main(){
  int n,m;
  cin >>n>>m;
  int a[m][2];
  rep(i,m){
    rep(j,2){
      cin>>a[i][j];
    }
  }
  int bucket[n]={0};
  rep(i,m){
    rep(j,2){
      bucket[a[i][j]-1]++;
    }
  }
  rep(i,n) cout<<bucket[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >>n>>m;
      |   ^~~
a.cc:5:7: error: 'i' was not declared in this scope
    5 |   rep(i,m){
      |       ^
a.cc:5:3: error: 'rep' was not declared in this scope
    5 |   rep(i,m){
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)

int main(){
  int n,m;
  cin >>n>>m;
  int a[m][2];
  rep(i,m){
    rep(j,2){
      cin>>a[i][j];
    }
  }
  int bucket[n]={0};
  rep(i,m){2){
    rep(j,
      bucket[a[i][j]-1]++;
    }
  }
  rep(i,n) cout<<bucket[i]<<endl;
}

Compiler output:
a.cc:21:2: error: unterminated argument list invoking macro "rep"
   21 | }
      |  ^
a.cc: In function 'int main()':
a.cc:15:13: error: expected ';' before ')' token
   15 |   rep(i,m){2){
      |             ^
      |             ;
a.cc:16:8: error: expected '}' at end of input
   16 |     rep(j,
      |        ^
a.cc:15:11: note: to match this '{'
   15 |   rep(i,m){2){
      |           ^
a.cc:16:8: error: expected '}' at end of input
   16 |     rep(j,
      |        ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main() {
  int n, m; cin >> n >> m;

  vector<int> count(n);

  for(int i = 0; i < m*2; i++){
    int x; cin >> x;
    count[x-1]++;
  }

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



Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'N' was not declared in this scope
   15 |   for(int i = 0; i < N; i++)
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main(){
  int N,M;
  cin >> N >> M;
  vector <int> a(M),
  vector <int> b(M);
  
  rep(i,M)
    cin >> a.at(i) >> b.at(i);
  rep(i,N){
    int x=0;
    rep(j,M){
      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:9:16: error: invalid declarator before 'b'
    9 |   vector <int> b(M);
      |                ^
a.cc:12:23: error: 'b' was not declared in this scope
   12 |     cin >> a.at(i) >> b.at(i);
      |                       ^
a.cc:16:28: error: 'b' was not declared in this scope
   16 |       if(a.at(j) == i+1 || b.at(j) == i+1)
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before '}' token
   13 |         city.at(b-1)++
      |                       ^
      |                       ;
   14 |     }
      |     ~
Language: C

#include<limits.h>

#define NUM 51

int main(){
	int n, m, a, b;
	int r[NUM];
	scanf("%d%d\n", &n, &m);
	for(int i=1; i<=n; i++){
		p[i] = 0;
	}
	for(int i=0; i<m; i++){
		scanf("%d%d\n", &a, &b);
		p[a]++;
		p[b]++;
	}
	for(int i=1; i<=n; i++){
		printf("%d\n", r[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |         scanf("%d%d\n", &n, &m);
      |         ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<limits.h>
  +++ |+#include <stdio.h>
    2 | 
main.c:8:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |         scanf("%d%d\n", &n, &m);
      |         ^~~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:17: error: 'p' undeclared (first use in this function)
   10 |                 p[i] = 0;
      |                 ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |                 printf("%d\n", r[i]);
      |                 ^~~~~~
main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'N' was not declared in this scope
    7 |   vector<int> ans(N,0);
      |                   ^
Language: C

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

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: request for member 'at' in 'N', which is of non-class type 'int'
   16 |     cout << N.at(i) << endl;
      |               ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: request for member 'at' in 'N', which is of non-class type 'int'
   12 |     N.at(a) +=1;
      |       ^~
a.cc:13:7: error: request for member 'at' in 'N', which is of non-class type 'int'
   13 |     N.at(b) +=1;
      |       ^~
a.cc:16:15: error: request for member 'at' in 'N', which is of non-class type 'int'
   16 |     cout << N.at(i) << endl;
      |               ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: request for member 'at' in 'N', which is of non-class type 'int'
   12 |     N.at(a)++;
      |       ^~
a.cc:13:7: error: 'at' was not declared in this scope; did you mean 'a'?
   13 |     N,at(b)++;
      |       ^~
      |       a
a.cc:16:14: error: 'N' cannot be used as a function
   16 |     cout << N(i) << endl;
      |             ~^~~
Language: C++

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

int main(){
  int N,M;
  cin >> N >> M;
  vector<int> k(2*M);
  for(int i=0;i<2*M;i=i+1){
    cin >> k.at(i);
  }
  sort(k.begin(),k.end())
  map<int,int> unti;
  for(int x:k){
    if(unti.count(x)){
      unti.at(x)=unti.at(x)+1;
    }
    else{
      unti.at(x)=1;
    }
  }
  for(int i=1;i<=N;i=i+1){
    cout << unti.at(i) << endl;
  }
}

      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected ';' before 'map'
   11 |   sort(k.begin(),k.end())
      |                          ^
      |                          ;
   12 |   map<int,int> unti;
      |   ~~~                     
a.cc:14:8: error: 'unti' was not declared in this scope
   14 |     if(unti.count(x)){
      |        ^~~~
a.cc:22:13: error: 'unti' was not declared in this scope
   22 |     cout << unti.at(i) << endl;
      |             ^~~~
Language: C++

#include<iostream>
#include <bits/stdc++.h>

using namespace std;

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected initializer before 'int'
   11 |   int c[n] = {0} ;
      |   ^~~
a.cc:13:20: error: 'b' was not declared in this scope
   13 |     cin >> a[i] >> b[i] ;
      |                    ^
a.cc:17:5: error: 'c' was not declared in this scope
   17 |     c[a[i]-1]++;
      |     ^
a.cc:18:7: error: 'b' was not declared in this scope
   18 |     c[b[i]-1]++;
      |       ^
a.cc:22:13: error: 'c' was not declared in this scope
   22 |     cout << c[i] << endl ;
      |             ^
Language: C++

#include <iostream>

int main()
{
   int n,m;
   scanf("%d%d",&n,&m);
   int i,a,b;
   int h[n+1],i;
   for(i=1;i<=m;++i)
   {
     scanf("%d",&a);
     scanf("%d",&b);
     h[a]++;
     h[b]++;
   }
  
  for(i=1;i<n;++i)
  {
    if(h[i]!=0) 
        printf("%d\n",h[i]);
  }
  
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: redeclaration of 'int i'
    8 |    int h[n+1],i;
      |               ^
a.cc:7:8: note: 'int i' previously declared here
    7 |    int i,a,b;
      |        ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ';' before '}' token
   13 |       ans.at(j) +=1
      |                    ^
      |                    ;
   14 |     }
      |     ~
Language: C++

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

int main() {//それぞれの数字の数を出力したい
  int N,M;
  cin >> N >> M;
  vector<int> vec(2);
  
    for(int i=0;i<M;i++){
       cin >> vec.at(0) >> vec.at(1);
       for(int j=1;j<N+1;j++){
    int f=0;
         if(vec.at(0)==j||vec.at(1)==j)
        f++;
    }
	cout << f << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'f' was not declared in this scope
   16 |         cout << f << endl;
      |                 ^
Language: C++

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

int main() {//それぞれの数字の数を出力したい
  int N,M;
  cin >> N >> M;
  vector<int> vec(2);
  
  for(int i=0;i<M;i++){
    cin >> vec.at(0) >> vec.at(1);
  }
  
  for(int j=1;j<N+1;j++){
    int f=0;
    for(int i=0;i<M;i++){
      if(vec.at(0)=j||vec.at(1)=j)
        f++;
    }
	cout << f << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: lvalue required as left operand of assignment
   16 |       if(vec.at(0)=j||vec.at(1)=j)
      |                    ~^~~~~~~~~~~
Language: C++

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

int main() {//それぞれの数字の数を出力したい
  int N,M;
  cin >> N >> M;
  
  for(int i=0;i<M;i++){
    vector<int> vec(2);
    cin >> vec.at(0) >> vec.at(1);
  }
  
  for(int j=1;j<N+1;j++){
    int f=0;
    for(int i=0;i<M;i++){
      if(vec.at(0)=j||vec.at(1)=j)
        f++;
    }
	cout << f << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'vec' was not declared in this scope
   16 |       if(vec.at(0)=j||vec.at(1)=j)
      |          ^~~
Language: C++

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

int main() {//それぞれの数字の数を出力したい
  int N,M;
  cin >> N >> M;
  
  for(int i=0;i<M;i++)
    vector<int> vec(2);
    cin >> vec.at(0) >> vec.at(1);
  
  for(int j=1;j<N+1;j++){
    int f=0;
    for(int i=0;i<M;i++){
      if(vec.at(0)=j||vec.at(1)=j)
        f++;
    }
	cout << f << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(0) >> vec.at(1);
      |            ^~~
Language: C++

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

int main() {//それぞれの数字の数を出力したい
  int N,M;
  cin >> N >> M;
  
  for(int i=0;i<M;i++)
    cin >> vector<int> vec(2);
  
  for(int j=1;j<N+1;j++){
    int f=0;
    for(int i=0;i<M;i++){
      if(vec.at(0)=j||vec.at(1)=j)
        f++;
    }
	cout << f << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected primary-expression before 'vec'
    9 |     cin >> vector<int> vec(2);
      |                        ^~~
a.cc:14:10: error: 'vec' was not declared in this scope
   14 |       if(vec.at(0)=j||vec.at(1)=j)
      |          ^~~
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: 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(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.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: request for member 'at' in 'a', which is of non-class type 'int'
   12 |     a.at(a-1)++;
      |       ^~
a.cc:13:7: error: request for member 'at' in 'a', which is of non-class type 'int'
   13 |     a.at(b-1)++;
      |       ^~
Language: C++

#include <bits/stdc++.h>

int n, m;

int main()
{
  std::cin >> n >> m;
  std::vector<int> a(m), b(m);
  for (int i = 0; i < m; ++i)
  {
    std::cin >> a[i] >> b[i];
  }

  std::vector<int> road(n);
  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) {
	std::cout << road[i] << std::endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: 'M' was not declared in this scope
   19 |   for (int i = 0; i < M; ++i) {
      |                       ^
a.cc:24:23: error: 'N' was not declared in this scope
   24 |   for (int i = 0; i < N; ++i) {
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n, m;
    cin >> n >> m;
    vi deg(n);
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        --a, --b;
        deg[a]++;deg[b]++;
    }
    for(auto i : deg)
        cout << i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vi' was not declared in this scope
    8 |     vi deg(n);
      |     ^~
a.cc:13:9: error: 'deg' was not declared in this scope
   13 |         deg[a]++;deg[b]++;
      |         ^~~
a.cc:15:18: error: 'deg' was not declared in this scope
   15 |     for(auto i : deg)
      |                  ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef long long ll;

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  int road[n];

  rep(i, n) {
    road[i] = 0;
  }

  rep(i, m) {
    int a, b;
    cin >> a >> b;
    ++road[a - 1];
    ++road[b - 1];
  }

  rep(i, n) {
    cout << road[i] << endl;
  }

  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:45:12: error: expected '}' at end of input
   45 |   return 0;
      |            ^
a.cc:25:12: note: to match this '{'
   25 | int main() {
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:4: error: expected '}' at end of input
   18 |   }
      |    ^
a.cc:8:25: note: to match this '{'
    8 |   for(int i=0;i<2*M;i++){
      |                         ^
a.cc:18:4: error: expected '}' at end of input
   18 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<2*M;i++){
      |       ^
a.cc:11:7: error: 'j' was not declared in this scope
   11 |   for(j=0;j<N;j++){
      |       ^
a.cc:18:4: error: expected '}' at end of input
   18 |   }
      |    ^
a.cc:8:21: note: to match this '{'
    8 |   for(i=0;i<2*M;i++){
      |                     ^
a.cc:18:4: error: expected '}' at end of input
   18 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected ',' or ';' before 'count'
    6 |   vector<int> road(2*M)count(N);
      |                        ^~~~~
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<2*M;i++){
      |       ^
a.cc:9:17: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'?
    9 |       cin>>road.t(i);
      |                 ^
      |                 at
a.cc:11:7: error: 'j' was not declared in this scope
   11 |   for(j=0;j<N;j++){
      |       ^
a.cc:13:15: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'?
   13 |       if(road.t(i)==j)
      |               ^
      |               at
a.cc:14:15: error: overloaded function with no contextual type information
   14 |         count.at(j)++;
      |               ^~
a.cc:16:17: error: overloaded function with no contextual type information
   16 |     cout<<count.at(j)<<endl;
      |                 ^~
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:8:21: note: to match this '{'
    8 |   for(i=0;i<2*M;i++){
      |                     ^
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: unable to find numeric literal operator 'operator""M'
    6 |   vector<int> road(2M)count(N);
      |                    ^~
a.cc:6:23: error: expected ',' or ';' before 'count'
    6 |   vector<int> road(2M)count(N);
      |                       ^~~~~
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<2M;i++){
      |       ^
a.cc:8:13: error: unable to find numeric literal operator 'operator""M'
    8 |   for(i=0;i<2M;i++){
      |             ^~
a.cc:9:17: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'?
    9 |       cin>>road.t(i);
      |                 ^
      |                 at
a.cc:11:7: error: 'j' was not declared in this scope
   11 |   for(j=0;j<N;j++){
      |       ^
a.cc:12:15: error: unable to find numeric literal operator 'operator""M'
   12 |     for(i=0;i<2M;i++){
      |               ^~
a.cc:13:15: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'?
   13 |       if(road.t(i)==j)
      |               ^
      |               at
a.cc:14:15: error: overloaded function with no contextual type information
   14 |         count.at(j)++;
      |               ^~
a.cc:16:17: error: overloaded function with no contextual type information
   16 |     cout<<count.at(j)<<endl;
      |                 ^~
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:8:20: note: to match this '{'
    8 |   for(i=0;i<2M;i++){
      |                    ^
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:4:12: 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> vec(2M);
  
  for (int i = 0 ; i < 2M ; i++ ) {
    cin >> vec.at(i) ;
  }
  
  for ( int i = 0 ; i < M ; i++) {
    int sum = 0 ;
    for ( int k = 0 ; k < 2M ; k++){
      if ( vec.at (k) == i ){
        sum++ ;
      }
    }
    cout << sum << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: unable to find numeric literal operator 'operator""M'
    8 |   vector<int> vec(2M);
      |                   ^~
a.cc:10:24: error: unable to find numeric literal operator 'operator""M'
   10 |   for (int i = 0 ; i < 2M ; i++ ) {
      |                        ^~
a.cc:16:27: error: unable to find numeric literal operator 'operator""M'
   16 |     for ( int k = 0 ; k < 2M ; k++){
      |                           ^~
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:4:13: 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);
  for(int i=0;i<M;i++){
    cin >> a.at(i) >> b.at(i);
  }
  int count = 0;
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      if(a.at(j) == i){
        count++;
      }
      if(b.at(j) == i){
        count++;
      }
    }
    cout << count << endl;
  }
}
}


Compiler output:
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
signed main(){
  int n,m;
  cin>>n>>m;
  V<int> a(n,0);
  for(int i=0; i<m; i++){
    int b,c;
    cin>>b>>c;
    a[b-1]++;
    a[c-1]++;

  }
  fo(i,n){
    cout<<a[i]<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:3: error: 'V' was not declared in this scope
   76 |   V<int> a(n,0);
      |   ^
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:76:5: note: in expansion of macro 'int'
   76 |   V<int> a(n,0);
      |     ^~~
a.cc:80:5: error: 'a' was not declared in this scope
   80 |     a[b-1]++;
      |     ^
a.cc:85:11: error: 'a' was not declared in this scope
   85 |     cout<<a[i]<<endl;
      |           ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
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> vec(2*M);
  
  for(int i=0; i<2*M; i++){
    cin >> vec.at(i);
  }
  int number(N);
  
  for(int i=0; i<2*M; i++){
    number.at(vec.at(i))++;
  }
  
  for(int i=0; i<N; i++){
    cout << number.at(i) << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: request for member 'at' in 'number', which is of non-class type 'int'
   15 |     number.at(vec.at(i))++;
      |            ^~
a.cc:19:20: error: request for member 'at' in 'number', which is of non-class type 'int'
   19 |     cout << number.at(i) << endl;
      |                    ^~
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
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> vec(2M);
  
  for(int i=0; i<2M; i++){
    cin >> vec.at(i);
  }
  int number(N);
  
  for(int i=0; i<2M; i++){
    number.at(vec.at(i))++;
  }
  
  for(int i=0; i<N; i++){
    cout << number.at(i) << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: unable to find numeric literal operator 'operator""M'
    7 |   vector<int> vec(2M);
      |                   ^~
a.cc:9:18: error: unable to find numeric literal operator 'operator""M'
    9 |   for(int i=0; i<2M; i++){
      |                  ^~
a.cc:14:18: error: unable to find numeric literal operator 'operator""M'
   14 |   for(int i=0; i<2M; i++){
      |                  ^~
a.cc:15:12: error: request for member 'at' in 'number', which is of non-class type 'int'
   15 |     number.at(vec.at(i))++;
      |            ^~
a.cc:19:20: error: request for member 'at' in 'number', which is of non-class type 'int'
   19 |     cout << number.at(i) << endl;
      |                    ^~
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
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, a;
  cin >> N >> M;
  vector<int> vec(N, 0);
  for(int i=0;i<2*N;i++){
    cin >> a;
    vec.at(a)++;
  }
  for(int i=0;i<N;i++){
    cout << vec.at(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, M, a;
  cin >> N >> M;
  vector<int> vec(N, 0);
  for(i=0;i<2*N;i++){
    cin >> a;
    vec.at(a)++;
  }
  for(i=0;i<N;i++){
    cout << vec.at(i) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<2*N;i++){
      |       ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=0;i<N;i++){
      |       ^
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()
{
  ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0);
  int n, m;
  cin >> n >> m;
  
  vector<int> a(n+1, 0);
  for(int i = 0; i < m; i++)
  {
    cin >> x >> y;
    a[x]++;
    a[y]++;
  }
  
  for(int i = 1; i <= n; i++)
  {
    cout << a[i] << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'x' was not declared in this scope
   13 |     cin >> x >> y;
      |            ^
a.cc:13:17: error: 'y' was not declared in this scope
   13 |     cin >> x >> y;
      |                 ^
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'class std::vector<int>' has no member named 'length'
   14 |     cout << city.length(i+1) <<endl;
      |                  ^~~~~~
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int M = scanner.nextInt();
		int[] a = new int[M];
		int[] b = new int[M];
		int[] ans = new int[N + 1];
		for (int i = 0; i < M; i++) {
			a[i] = scanner.nextInt();
			b[i] = scanner.nextInt();
			ans[a[i]]++;
			ans[b[i]]++;
		}
		scanner.close();

		for(int i = 1; i < ans.length; i++) {
			System.out.println(ans[i]);
		}
	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		                      ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <stdio.h>

int main(void){
    int n = 0, m = 0;
    int a = 0, b = 0;
    int ans[51];

    scanf("%d%d", &n, &m);
    for(int i = 1; i<= n; i++){
        ans[i] = 0;
    }

    for(int i = 0; i < m; i++){
        scanf("%d%d", &a, &b);
        ans[a]++;
        ans[b]++;
    }

    for(int i = 1; i<= n; i++){
        printf("%d\n", ans[i]);
    }    

    return 0;

} 


Compiler output:
a.cc:12:1: error: stray '\16' in program
   12 | <U+000E>
      | ^~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

  	const int NMMAX = 50;
    int A[NMMAX], B[NMMAX];
	for (inti=0;i<M;++i){
    cin >> A[i] >> B[i];
	}

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

  	for (inti=0;i<M;++i){
    	road[A[i] - 1] += 1;
    	road[B[i] - 1] += 1;
	}
	for (inti=0;i<N;++i){ 
    cout << road[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'inti' was not declared in this scope; did you mean 'int'?
   10 |         for (inti=0;i<M;++i){
      |              ^~~~
      |              int
a.cc:10:21: error: 'i' was not declared in this scope
   10 |         for (inti=0;i<M;++i){
      |                     ^
a.cc:15:14: error: 'inti' was not declared in this scope; did you mean 'int'?
   15 |         for (inti=0;i<N;++i){
      |              ^~~~
      |              int
a.cc:15:21: error: 'i' was not declared in this scope
   15 |         for (inti=0;i<N;++i){
      |                     ^
a.cc:19:14: error: 'inti' was not declared in this scope; did you mean 'int'?
   19 |         for (inti=0;i<M;++i){
      |              ^~~~
      |              int
a.cc:19:21: error: 'i' was not declared in this scope
   19 |         for (inti=0;i<M;++i){
      |                     ^
a.cc:23:14: error: 'inti' was not declared in this scope; did you mean 'int'?
   23 |         for (inti=0;i<N;++i){
      |              ^~~~
      |              int
a.cc:23:21: error: 'i' was not declared in this scope
   23 |         for (inti=0;i<N;++i){
      |                     ^
Language: C++

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

int main() {

int N,M; cin>>N>>M;
  vector<int> a(M),b(M);
  map<int,int> A;
  for(int i=0;i<M;i++){
    cin>>a.at(i)>>b.at(i);}
  
  for(int i=0; i<M; i++){
    if(!A.count(a.at(i))){A[a.at(i)]=1}
    else{A.at(a.at(i))++;}
    if(!A.count(b.at(i))){A[b.at(i)]=1}
    else{A.at(b.at(i))++;}
  }
  for(int i=0;i<N;i++){
    cout<<A.at(i)<<endl;}
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:39: error: expected ';' before '}' token
   13 |     if(!A.count(a.at(i))){A[a.at(i)]=1}
      |                                       ^
      |                                       ;
a.cc:15:39: error: expected ';' before '}' token
   15 |     if(!A.count(b.at(i))){A[b.at(i)]=1}
      |                                       ^
      |                                       ;
Language: C++

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

int main() {
  int cities, roads;
  cin >> cities >> roads;
  vector<int> answers(cities);
  for(int i =0; i < roads; i++) {
   int a,b;
    cin >> a >> b;
    answers.at(a)++;
    answers.at(b)++;
  }
  for(int i = 0; i < cities; ii++) {
    cout << answers.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: 'ii' was not declared in this scope; did you mean 'i'?
   14 |   for(int i = 0; i < cities; ii++) {
      |                              ^~
      |                              i
Language: C

#include <stdio.h>
int main() {
	int n,m,i,c1,c2;
	scanf("%d%d",&n,&m);
	int c[n];
	for(i=1;i<=n;i++) {
		c[i]=0;
	}
	for(i=0;i<m;i++){
		scanf("%d%d",&c1,&c2);
		c[c1]+= 1;
		c[c2]+= 1;
	}
	for(i=1;i<=N;i++){
		printf("%d\n",c[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:20: error: 'N' undeclared (first use in this function)
   14 |         for(i=1;i<=N;i++){
      |                    ^
main.c:14:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'b' was not declared in this scope
   12 |         b[enb-1]++;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int> a,q;
 int s,d,f,g,y = 0;
  cin >> s >> d;
  for (int i= 0;i<d;i++){
    cin >> f >> g;
    a.push_back(f);
        q.push_back(g);
  }
  for(int j =0;i<s;i++){
  y=0;
    for(int i=0;i<d;i++){
    if(i+1 == a.at(i))
      y += 1;
    if(i+1 == q.at(i))
      y += 1;
    }
    cout << y << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'i' was not declared in this scope
   12 |   for(int j =0;i<s;i++){
      |                ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected ',' or ';' before 'for'
    8 |         for (int i = 0 ; i < M ; i ++){
      |         ^~~
a.cc:8:26: error: 'i' was not declared in this scope
    8 |         for (int i = 0 ; i < M ; i ++){
      |                          ^