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

#include<iostream>
using namespace std;

int main()
{
  int N,M;	//N個の都市、M本の道路
  cin>>N>>M;
  vector<int> a(M),b(M),total(N);
  for(int ni =0;ni<M;ni++)
  {
    cin>>a.at(ni)>>b.at(ni);
    total(a.at(ni)-1)++;
    total(b.at(ni)-1)++;
  }
  return 0;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> a(M),b(M),total(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a(M),b(M),total(N);
      |          ^~~
a.cc:11:10: error: 'a' was not declared in this scope
   11 |     cin>>a.at(ni)>>b.at(ni);
      |          ^
a.cc:11:20: error: 'b' was not declared in this scope
   11 |     cin>>a.at(ni)>>b.at(ni);
      |                    ^
a.cc:12:5: error: 'total' was not declared in this scope
   12 |     total(a.at(ni)-1)++;
      |     ^~~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N, M;
  
  int a, b; 
  cin >> N >> M;
  
  
  
  
  vector<int> city(N);
  
  for (int i = 0; i < M; i++) {
    
    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:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int n,m,tmp1,tmp2;
  cin >> n >> m;
  vector<int> town(n);
  for(int i=0;i<M;i++){
    cin >> tmp1 >> tmp2;
    town.at(tmp1-1)++;
    town.at(tmp2-1)++;
  }

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

#include <iostream>
#include <algorithm>
#include <math.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<N;i++){
    cin>>a>>b;
    c[a]++;
    c[b]++;
  }
  
  for(int i=0;i<N;i++){
    cout<<c[i]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int>c(N)={0};
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <math.h>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int>c(N)={0};
      |          ^~~
a.cc:14:5: error: 'c' was not declared in this scope
   14 |     c[a]++;
      |     ^
a.cc:19:11: error: 'c' was not declared in this scope
   19 |     cout<<c[i]<<endl;
      |           ^
Language: C++

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

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 (inti=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:12:6: error: 'inti' was not declared in this scope; did you mean 'int'?
   12 | for (inti=0;i<N;++i){
      |      ^~~~
      |      int
a.cc:12:13: error: 'i' was not declared in this scope
   12 | for (inti=0;i<N;++i){
      |             ^
Language: C++

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

int main(void) {
    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:9:6: error: 'inti' was not declared in this scope; did you mean 'int'?
    9 | for (inti=0;i<M;++i){ cin >> A[i] >> B[i];
      |      ^~~~
      |      int
a.cc:9:13: error: 'i' was not declared in this scope
    9 | for (inti=0;i<M;++i){ cin >> A[i] >> B[i];
      |             ^
a.cc:12:6: error: 'inti' was not declared in this scope; did you mean 'int'?
   12 | for (inti=0;i<N;++i){
      |      ^~~~
      |      int
a.cc:12:13: error: 'i' was not declared in this scope
   12 | for (inti=0;i<N;++i){
      |             ^
a.cc:14:6: error: 'inti' was not declared in this scope; did you mean 'int'?
   14 | for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1;
      |      ^~~~
      |      int
a.cc:14:13: error: 'i' was not declared in this scope
   14 | for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1;
      |             ^
a.cc:16:6: error: 'inti' was not declared in this scope; did you mean 'int'?
   16 | for (inti=0;i<N;++i){ cout << road[i] << endl;
      |      ^~~~
      |      int
a.cc:16:13: error: 'i' was not declared in this scope
   16 | for (inti=0;i<N;++i){ cout << road[i] << endl;
      |             ^
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 Count[] = new int[N];
      	int i = 0;
      	for(i = 0;i < M;i++){
		  Count[sc.nextInt()];
        }
      	for(i = 0;i < N; i++){
          System.out.println(Count[i]);   
        }
 
    }
}

Compiler output:
Main.java:11: error: not a statement
		  Count[sc.nextInt()];
		       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main (void){
  int a,b,N,M;
  int road[55] = {};
  cin >> N >> M;
  
  for(int i = 0; i < M; i++){
    cin a >> b;
    a--;
    b--;
    road[a]++;
    road[b]++;
  }
  for(int i = 0; i < N; i++){
    cout << road[i] << '\n';
  }
  return 0;
}
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: expected ';' before 'a'
    9 |     cin a >> b;
      |        ^~
      |        ;
Language: C++

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

int main() {
	int n, m;// n 個の都市 m 本の道路
	cin >> n >> m;
	int a, b;
    vector<int>	c (n);
    for (int i = 0; i < m; i++) {
    	cin >> a >> b ;
        vec.at(a - 1)++;
        vec.at(b - 1)++;
    }
    for (int j = 0; i < n; i++) {
    	cout << vec.at(i) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'vec' was not declared in this scope
   11 |         vec.at(a - 1)++;
      |         ^~~
a.cc:14:21: error: 'i' was not declared in this scope
   14 |     for (int j = 0; i < n; i++) {
      |                     ^
a.cc:15:17: error: 'vec' was not declared in this scope
   15 |         cout << vec.at(i) << endl;
      |                 ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected ';' before 'for'
   17 |     Answer = 0
      |               ^
      |               ;
   18 |     for (int j=0; j<2*M; j++){
      |     ~~~        
a.cc:18:19: error: 'j' was not declared in this scope
   18 |     for (int j=0; j<2*M; j++){
      |                   ^
Language: C++

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

int main() {
  int N,M;
  cin >> N >> M;
  vecter<int> a(M);
  vecter<int> b(M);
  vector<int> c(N);
  for(int i=0;i<M;i++){
    cin >> a.at(i) >> b.at(i);   
    c.at(a.at(i)-1)++;
    c.at(b.at(i)-1)++;
  }
  for(int j=0;j<N;j++){
    cout << c.at(j) << 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:8:10: error: expected primary-expression before 'int'
    8 |   vecter<int> b(M);
      |          ^~~
a.cc:11:12: error: 'a' was not declared in this scope
   11 |     cin >> a.at(i) >> b.at(i);
      |            ^
a.cc:11:23: error: 'b' was not declared in this scope
   11 |     cin >> a.at(i) >> b.at(i);
      |                       ^
Language: C++

n, m = map(int, input().split())
t=[0]*n
for i in range(m):
    a, b = map(int, input().split())
    t[a-1]+=1
    t[b-1]+=1
for x in t: print(x)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = map(int, input().split())
      | ^
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<N;i++){
    int P, Q;
    cin >> P >> Q;
    for(int j =0;j<100;j++){
    	if(j == P){
          ans.at(j-1) +=1;
        }
      
      for(int j =0;j<100;j++){
    	if(j == Q){
          ans.at(j-1) +=1;
        }
    }
  }
 
  for (int i =0;i < ans.size();i++){
  cout << ans.at(i) << endl;
  }
  return 0;
}

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


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

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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected primary-expression before '<<' token
   14 |     cout << d.at(i); << endl;
      |                      ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vec' was not declared in this scope
    7 |   vec<int> d(N);
      |   ^~~
a.cc:7:7: error: expected primary-expression before 'int'
    7 |   vec<int> d(N);
      |       ^~~
a.cc:10:5: error: 'd' was not declared in this scope
   10 |     d.at(b-1)++;
      |     ^
a.cc:14:13: error: 'd' was not declared in this scope
   14 |     cout << d.at(i); << endl;
      |             ^
a.cc:14:22: error: expected primary-expression before '<<' token
   14 |     cout << d.at(i); << endl;
      |                      ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: no match for call to '(std::vector<int>) (int)'
   10 |   c(x-1)++;
      |   ~^~~~~
a.cc:12:4: error: no match for call to '(std::vector<int>) (int)'
   12 |   c(x-1)++;
      |   ~^~~~~
a.cc:15:12: error: no match for call to '(std::vector<int>) (int&)'
   15 |     cout>>c(i)>>endl;
      |           ~^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: no match for call to '(std::vector<int>) (int)'
   10 |   c(x-1)++;
      |   ~^~~~~
a.cc:12:4: error: no match for call to '(std::vector<int>) (int)'
   12 |   c(x-1)++
      |   ~^~~~~
a.cc:15:12: error: no match for call to '(std::vector<int>) (int&)'
   15 |     cout>>c(i)>>endl;
      |           ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int City, Road;
  cin >> City >> Road;
  vector<int> ans(City,0);
  
  for(int r = 0; r < Road * 2; r++){
    int city;
    cin >> city;
    ans.at(city-1) += 1;
  }
  for(int c = 0; c < city.size(); c++){
    cout << city.at(c) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: 'city' was not declared in this scope; did you mean 'City'?
   14 |   for(int c = 0; c < city.size(); c++){
      |                      ^~~~
      |                      City
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);
  }
  vector<int> road(N);
  for (int i = 0; i < N; i++){
    for (int j = 0; j < M; j++){
      if (a.at(j) == i + 1 || b.at(j) == i + 1) road(i) += 1;
    }
  }
  for (int i = 0; i < N; i++){
    cout << road.at(i) << endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:53: error: no match for call to '(std::vector<int>) (int&)'
   15 |       if (a.at(j) == i + 1 || b.at(j) == i + 1) road(i) += 1;
      |                                                 ~~~~^~~
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);
  }
  vector<int> road(N);
  for (int i = 0; i < N; i++){
    for (int j = 0; j < M; j++){
      if (a.at(j) == i + 1 || b.at(j) == i + 1) road =+ 1;
    }
  }
  for (int i = 0; i < N; i++){
    cout << road.at(i) << endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:57: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   15 |       if (a.at(j) == i + 1 || b.at(j) == i + 1) road =+ 1;
      |                                                         ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
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);
  }
  vector<int> road(N);
  for (int i = 0; i < N; i++){
    for (int j = 0; j < M; j++){
      if (a.at(j) == i + 1 || b.at(j) == i + 1) road += 1;
    }
  }
  for (int i = 0; i < N; i++){
    cout << road.at(i) << endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:54: error: no match for 'operator+=' (operand types are 'std::vector<int>' and 'int')
   15 |       if (a.at(j) == i + 1 || b.at(j) == i + 1) road += 1;
      |                                                 ~~~~~^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:55: error: expected ';' before '}' token
   18 |     if (a.at(i) == i + 1 || b.at(i) == i) c.at(i) += 1
      |                                                       ^
      |                                                       ;
   19 |   }
      |   ~
Language: C++

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

int main(){
  int N;  //都市の数
  int M;  //道路の数

  cin >> N >> M;
  
  int Route;               // 都市iから出ている道路の数
  vector <int> RoadA(M);   // 道路i  都市Aiの番号
  vector <int> RoadB(M);   // 道路i  都市Biの番号

  for (int i=0; i<M; i++){
    cin >> RoadA.at(i) >> RoadB.at(i);
  }

  for (int i=0; i<N; i++){
    Route=0;
    for (int j=0; j<M; j++){
      if (RoadA.at(i) == i){
        Toshi.at(i) +=1;
      }
      if (RoadB.at(i) == i){
        Toshi.at(i) +=1;
      }
    }
    cout << Route << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'Toshi' was not declared in this scope
   22 |         Toshi.at(i) +=1;
      |         ^~~~~
a.cc:25:9: error: 'Toshi' was not declared in this scope
   25 |         Toshi.at(i) +=1;
      |         ^~~~~
Language: C++

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

int main(){
  int N;  //都市の数
  int M;  //道路の数

  cin >> N >> M;
  
  int Route;               // 都市iから出ている道路の数
  vector <int> RoadA(M);   // 道路i  都市Aiの番号
  vector <int> RoadB(M);   // 道路i  都市Biの番号

  for (int i=0; i<M; i++){
    cin >> RoadA.at(i) >> RoadB.at(i);
  }

  for (int i=0; i<N; i++){
    Route=0;
    for (int j=0; j<M; j++){
      if (RoadA,at(i) == i){
        Toshi.at(i) +=1;
      }
      if (RoadB.at(i) == i){
        Toshi.at(i) +=1;
      }
    }
    cout << Route << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'at' was not declared in this scope
   21 |       if (RoadA,at(i) == i){
      |                 ^~
a.cc:22:9: error: 'Toshi' was not declared in this scope
   22 |         Toshi.at(i) +=1;
      |         ^~~~~
a.cc:25:9: error: 'Toshi' was not declared in this scope
   25 |         Toshi.at(i) +=1;
      |         ^~~~~
Language: C++

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

int main(){
  int N;  //都市の数
  int M;  //道路の数

  cin >> N >> M;
  
  int Route;               // 都市iから出ている道路の数
  vector <int> RoadA(M);   // 道路i  都市Aiの番号
  vector <int> RoadB(M);   // 道路i  都市Biの番号

  for (int i=0; i<M; i++){
    cin >> RoadA.at(i) >> RoadB.at(i);
  }

  for (int i=0; i<N; i++){
    Route=0;
    for (j=0; j<M; j++){
      if (RoadA,at(i) == i){
        Toshi.at(i) +=1;
      }
      if (RoadB.at(i) == i){
        Toshi.at(i) +=1;
      }
    }
    cout << Route << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'j' was not declared in this scope
   20 |     for (j=0; j<M; j++){
      |          ^
a.cc:21:17: error: 'at' was not declared in this scope
   21 |       if (RoadA,at(i) == i){
      |                 ^~
a.cc:22:9: error: 'Toshi' was not declared in this scope
   22 |         Toshi.at(i) +=1;
      |         ^~~~~
a.cc:25:9: error: 'Toshi' was not declared in this scope
   25 |         Toshi.at(i) +=1;
      |         ^~~~~
Language: C++

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   cin >> int N, M;
      |          ^~~
a.cc:6:22: error: 'N' was not declared in this scope
    6 |   for(int t = 0; t < N; t++){
      |                      ^
a.cc:8:26: error: 'M' was not declared in this scope
    8 |     for(int i = 0; i < 2*M; i++) {
      |                          ^
a.cc:9:14: error: expected primary-expression before 'int'
    9 |       cin >> int r;
      |              ^~~
a.cc:10:17: error: 'r' was not declared in this scope
   10 |       if(t+1 == r){
      |                 ^
a.cc:11:12: error: expected initializer before '++' token
   11 |       int a++;
      |            ^~
a.cc:14:13: error: expected primary-expression before 'int'
   14 |     cout << int a << endl;
      |             ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull; 
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define SQ(a) (a)*(a)

template <class T, class U> ostream& operator<< (ostream &out, pair<T,U> c) { out << "(" << c.first << " "; out << c.second << ")"; return out; }
template <class T> ostream& operator<< (ostream &out, vector<T> c) { for (auto it = c.begin(); it != c.end(); ++it) { if (it != c.begin()) out << " "; out << *it; } return out; }
template <class T> ostream& operator<< (ostream &out, set<T> c) { for (auto it = c.begin(); it != c.end(); ++it) { if (it != c.begin()) out << " "; out << *it; } return out; }
const double PI  = 3.141592653589793238463;


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, m, a, b;
    cin >> n >> m;
    vi c(n);
    FOR(i,0,m){
        cin >> a >> b;
        vi[a-1]++;
        vi[b-1]++; 
    }
    FOR(i,0,n){
        cout << c[i] << endl;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: expected ']' before '-' token
   31 |         vi[a-1]++;
      |             ^
      |             ]
a.cc:31:11: error: structured binding declaration cannot have type 'vi' {aka 'std::vector<int>'}
   31 |         vi[a-1]++;
      |           ^
a.cc:31:11: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:31:16: error: expected initializer before '++' token
   31 |         vi[a-1]++;
      |                ^~
a.cc:31:16: error: expected ';' before '++' token
a.cc:32:13: error: expected ']' before '-' token
   32 |         vi[b-1]++;
      |             ^
      |             ]
a.cc:32:11: error: structured binding declaration cannot have type 'vi' {aka 'std::vector<int>'}
   32 |         vi[b-1]++;
      |           ^
a.cc:32:11: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:32:16: error: expected initializer before '++' token
   32 |         vi[b-1]++;
      |                ^~
a.cc:32:16: error: expected ';' before '++' token
Language: C

#include <stdio.h>

main(){
  int N, M;
  scanf("%d %d",&N,&M);
  int A[50], B[50];
  for(int i = 0; i < M; i++){
     scanf("%d",&A[i]);
     scanf("%d",&B[i]);
  }
  int road[N];
  for(int i = 0; i < M; i++){
    road[A[i] - 1]++;
    road[B[i] - 1]++;
  }
  for(int i = 0; i < N; i++){
  pritnf("%d\n",road[i]);
  }
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:17:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |   pritnf("%d\n",road[i]);
      |   ^~~~~~
      |   printf
Language: C

#include <stdio.h>

main(){
  int N, M;
  scanf("%d %d",&N,&M);
  int A[50], B[50];
  for(int i = 0; i < M; i++){
     scanf("%d",&A[i]);
     scanf("%d",&B[i]);
  }
  int road[N];
  for(int i = 0; i < M; i++){
    roaa[A[i] - 1]++;
    road[B[i] - 1]++;
  }
  for(int i = 0; i < N; i++){
  pritnf("%d\n",road[i]);
  }
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:5: error: 'roaa' undeclared (first use in this function); did you mean 'road'?
   13 |     roaa[A[i] - 1]++;
      |     ^~~~
      |     road
main.c:13:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |   pritnf("%d\n",road[i]);
      |   ^~~~~~
      |   printf
Language: C

#include <stdio.h>

main(){
  int N, M;
  scanf("%d %d",&N,&M);
  int A[50], B[50];
  for(int i = 0; i < M; i++){
     scanf("%d",&A[i]);
     scanf("%d",&B[i]);
  }
  int road[N];
  for(int i = 0; i < M; i++){
    roaa[A[i] - 1]++;
    road[B[i] - 1]++;
  }
  for(int i = 0; i < N; i++){
  pritnf("%d",road[i]);
  }
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:5: error: 'roaa' undeclared (first use in this function); did you mean 'road'?
   13 |     roaa[A[i] - 1]++;
      |     ^~~~
      |     road
main.c:13:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |   pritnf("%d",road[i]);
      |   ^~~~~~
      |   printf
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: expected ',' before '[' token
   19 |         [b[i] - 1] += 1;
      |           ^
      |           ,
a.cc:19:11: error: expected identifier before '[' token
a.cc: In lambda function:
a.cc:19:20: error: expected '{' before '+=' token
   19 |         [b[i] - 1] += 1;
      |                    ^~
a.cc: In function 'int main()':
a.cc:19:20: error: no match for 'operator+=' (operand types are 'main()::<lambda()>' and 'int')
   19 |         [b[i] - 1] += 1;
      |         ~~~~~~~~~~~^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'imt' was not declared in this scope; did you mean 'int'?
    9 |   for (imt j=0;j<N;j++) {
      |        ^~~
      |        int
a.cc:9:16: error: 'j' was not declared in this scope
    9 |   for (imt j=0;j<N;j++) {
      |                ^
Language: C++

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

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

    
      
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'imt' was not declared in this scope; did you mean 'int'?
    9 |   for (imt j=0;j<N;j++) {
      |        ^~~
      |        int
a.cc:9:16: error: 'j' was not declared in this scope
    9 |   for (imt j=0;j<N;j++) {
      |                ^
a.cc:19:15: error: 'x' was not declared in this scope
   19 |       cout << x << endl;
      |               ^
Language: C

#include <stdio.h>

int main()
{
	int i, N, M, a[51], b[51];
	scanf("%d %d", &N, &M&);
	for (i = 1; i <= M; i++) scanf("%d %d", &(a[i]), &(b[i]));
	
	int deg[51] = {};
	for (i = 1; i <= M; i++) {
		deg[a[i]]++;
		deg[b[i]]++;
	}
	
	for (i = 1; i <= N; i++) printf("%d\n", deg[i]);
	fflush(stdout);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:31: error: expected expression before ')' token
    6 |         scanf("%d %d", &N, &M&);
      |                               ^
Language: C++

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

int main() {
  cin >> N >> M;
  vector<int> city(3,0);
  for ( int i=0; i < M; i++){
    cin >> a >> b;
    city[a-1]+=1;
    city[b-1]+=1;
    i++;
  }
  for ( int i=0; i<N; i++){
    cout << city[i] << endl;
  }
     
}


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

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

int main() {
  int n, m;
  cin >> n >> m;
  
  vector<int> vec(n)

  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<n; i++){
    cout << vec.at(i) << endl;
  }
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vecotr' was not declared in this scope
    7 |   vecotr<int> vec2(M);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vecotr<int> vec2(M);
      |          ^~~
a.cc:9:26: error: 'vec2' was not declared in this scope; did you mean 'vec1'?
    9 |     cin >> vec1.at(i) >> vec2.at(i);
      |                          ^~~~
      |                          vec1
a.cc:14:28: error: 'vec2' was not declared in this scope; did you mean 'vec1'?
   14 |       if(i==vec1.at(j)||i==vec2.at(j)){
      |                            ^~~~
      |                            vec1
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vecotr' was not declared in this scope
    7 |   vecotr<int> vec2(M);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vecotr<int> vec2(M);
      |          ^~~
a.cc:9:26: error: 'vec2' was not declared in this scope; did you mean 'vec1'?
    9 |     cin >> vec1.at(i) >> vec2.at(i);
      |                          ^~~~
      |                          vec1
a.cc:14:28: error: 'vec2' was not declared in this scope; did you mean 'vec1'?
   14 |       if(i==vec1.at(j)||i==vec2.at(j)){
      |                            ^~~~
      |                            vec1
Language: C++

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

int main() {
  int N,M; cin >> N >> M;
  
  vector<int> c(M * 2);
  for(int i = 0; i < M * 2; i++){
    cin >> c.at(i);
  }
  
  for(int j = 0; j < M; j++){
  	int n = 0;
  	for(int i = 0; i < M * 2; i++){
  	  if(c.at(i) == j + 1) n++;
  	  else continue;
  	}
    if(n != 0)  cout << n << endl;
    else continue
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: expected ';' before '}' token
   19 |     else continue
      |                  ^
      |                  ;
   20 |   }
      |   ~
Language: C++

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

int main() {
  int N,M; cin >> N >> M;
  
  vector(int) c(M * 2);
  for(int i = 0; i < M * 2; i++){
    cin >> c;
  }
  
  for(int j = 0; j < M; j++){
  	int n = 0;
  	for(int i = 0; i < M * 2; i++){
  	  if(c.at(i) == j + 1) n++;
  	  else continue;
  	}
  	cout << n << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: missing template arguments before '(' token
    7 |   vector(int) c(M * 2);
      |         ^
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector(int) c(M * 2);
      |          ^~~
a.cc:9:12: error: 'c' was not declared in this scope
    9 |     cin >> c;
      |            ^
a.cc:15:14: error: 'c' was not declared in this scope
   15 |           if(c.at(i) == j + 1) n++;
      |              ^
Language: C++

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

int main() {
  int N,M; cin >> N >> M;
  
  vector(int) c(M * 2);
  for(int i = 0; i < M　* 2; i++){
    cin >> c;
  }
  
  for(int j = 0; j < M; j++){
  	int n = 0;
  	for(int i = 0; i < M * 2; i++){
  	  if(c.at(i) == j + 1) n++;
  	  else continue;
  	}
  	cout << n << endl;
  }
}


Compiler output:
a.cc:8:22: error: extended character 　 is not valid in an identifier
    8 |   for(int i = 0; i < M　* 2; i++){
      |                      ^
a.cc: In function 'int main()':
a.cc:7:9: error: missing template arguments before '(' token
    7 |   vector(int) c(M * 2);
      |         ^
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector(int) c(M * 2);
      |          ^~~
a.cc:8:22: error: 'M\U00003000' was not declared in this scope
    8 |   for(int i = 0; i < M　* 2; i++){
      |                      ^~~
a.cc:9:12: error: 'c' was not declared in this scope
    9 |     cin >> c;
      |            ^
a.cc:15:14: error: 'c' was not declared in this scope
   15 |           if(c.at(i) == j + 1) n++;
      |              ^
Language: C++

//どの道が幾つの街を繋げれるか

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

    
int main() {
    int N ,M; //,a ,b;
  cin >> N >> M;
  vector<int> a(M);
  vector<int> b(M);
  vector<int> c(N); //= 0;
// vector<int> c(M) = 0; (M)だとだいいから外れる
//  vector<string> だと3+3=33になる
  
  for (int i=0;i<M;i++){
    cin >> a.at(i) >> b.at(i);
  }
  cout << endl;
  
   for (int i=0;i<M;i++){
    for (int j=0;j<N;j++){
     if ( a.at(i) == j ){
    c.at(j) = c.at(j) + 1
    }
    else if ( b.at(i) == j ){
    c.at(j) = c.at(j) + 1
    }
        cout << c.at(i) << endl;
    }
   }
}
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: expected ';' before '}' token
   24 |     c.at(j) = c.at(j) + 1
      |                          ^
      |                          ;
   25 |     }
      |     ~                     
a.cc:27:26: error: expected ';' before '}' token
   27 |     c.at(j) = c.at(j) + 1
      |                          ^
      |                          ;
   28 |     }
      |     ~
Language: C++

//どの道が幾つの街を繋げれるか

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

    
int main() {
  int N ,M ,a ,b;
  cin >> N >> M;
  vector<int> a(M);
  vector<int> b(M);
  vector<int> c(N) = 0;
// vector<int> c(M) = 0; (M)だとだいいから外れる
//  vector<string> だと3+3=33になる
  
  for (int i=0;i<M;i++){
    cin >> a.at(i) >> b.at(i);
  }
  cout << endl;
  
   for (int i=0;i<M;i++){
    for (int j=0;j<N;j++){
     if ( a.at(i) == j ){
    c.at(j) = c.at(j) + 1
    }
    else if ( b.at(i) == j ){
    c.at(j) = c.at(j) + 1
    }
        cout << c.at(i) << endl;
    }
   }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: conflicting declaration 'std::vector<int> a'
   10 |   vector<int> a(M);
      |               ^
a.cc:8:13: note: previous declaration as 'int a'
    8 |   int N ,M ,a ,b;
      |             ^
a.cc:11:15: error: conflicting declaration 'std::vector<int> b'
   11 |   vector<int> b(M);
      |               ^
a.cc:8:16: note: previous declaration as 'int b'
    8 |   int N ,M ,a ,b;
      |                ^
a.cc:12:20: error: expected ',' or ';' before '=' token
   12 |   vector<int> c(N) = 0;
      |                    ^
a.cc:17:14: error: request for member 'at' in 'a', which is of non-class type 'int'
   17 |     cin >> a.at(i) >> b.at(i);
      |              ^~
a.cc:17:25: error: request for member 'at' in 'b', which is of non-class type 'int'
   17 |     cin >> a.at(i) >> b.at(i);
      |                         ^~
a.cc:23:13: error: request for member 'at' in 'a', which is of non-class type 'int'
   23 |      if ( a.at(i) == j ){
      |             ^~
a.cc:24:26: error: expected ';' before '}' token
   24 |     c.at(j) = c.at(j) + 1
      |                          ^
      |                          ;
   25 |     }
      |     ~                     
a.cc:26:17: error: request for member 'at' in 'b', which is of non-class type 'int'
   26 |     else if ( b.at(i) == j ){
      |                 ^~
a.cc:27:26: error: expected ';' before '}' token
   27 |     c.at(j) = c.at(j) + 1
      |                          ^
      |                          ;
   28 |     }
      |     ~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  
  vector<string> town(M*2);
  for (int i=0; i<M*2; i++){
    cin >> town.at(i);
  }
  
  vector<int> count(N);
  
  for(int i=0; i<N; i++) {
  
    for(int j=0; j<M*2; j++) {
      if (town.at(j) = i+1) {
        count.at(i) += 1;
      }
    }
    
    cout << count.at(i) << endl;
    
  }

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: could not convert '(& town.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)j)))->std::__cxx11::basic_string<char>::operator=(((int)((char)(i + 1))))' from 'std::__cxx11::basic_string<char>' to 'bool'
   18 |       if (town.at(j) = i+1) {
      |           ~~~~~~~~~~~^~~~~
      |                      |
      |                      std::__cxx11::basic_string<char>
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  
  vector<string> town(M*2);
  for (int i=0; i<M*2; i++){
    cin >> town.at(i);
  }
  
  vector<int> count(N);
  
  for(int i=0; i<N; i++) {
  
    for(int j=0; j<M*2; j++) {
      if (road.at(j) = i+1) {
        count.at(i) += 1;
      }
    }
    
    cout << count.at(i) << endl;
    
  }

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'road' was not declared in this scope; did you mean 'read'?
   18 |       if (road.at(j) = i+1) {
      |           ^~~~
      |           read
Language: C++

#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 < M; i++) {
    cout << city.at(i) << endl;
  }
}

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

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

int main(){
    int city,street;
  cin >> city>>street;
  
  vector<int> num(2*street);
  for(int i=0;i<2*street;i++){
    cin >> num[i];
     }
  
  for(int i=0;i<city;i++){
    int ans=0;
    for(int j=0;j<2*street;j++){
      if(num[j]==i){ans++;}
     }
   cout << ans <<endl; 
    
  }
}


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

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

int main(){
    int city,street;
  cin >> city>>street;
  
  vector<int> num(2*street);
  for(int i=0;i<2*street;i++){
    cin >> num[i];
     }
  
  for(int i=0;i<city;i++){
    int ans=0;
    for(int j=0;j<2*street;j++){
      if(num[j]==i){ans++;}
     }
   cout << ans <<endl; 
    
  }
}

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

#include<stdio.h>
int main(){
  int N,M;
  scanf("%d %d",&N,&M);
  int a[M]
  int b[M];
  int i;
  int count[50]={0};
  for(i=0;i<M;i++){
    scanf("%d %d",&a[i],&b[i]);
    count[a[i]]++;
  }
  for(i=0;i<M;i++){
    count[b[i]]++;
  }
  for(i=1;i<=N;i++){
    printf("%d\n",count[i]);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:11: error: expected ';' before 'int'
    5 |   int a[M]
      |           ^
      |           ;
    6 |   int b[M];
      |   ~~~      
main.c:10:20: error: 'a' undeclared (first use in this function)
   10 |     scanf("%d %d",&a[i],&b[i]);
      |                    ^
main.c:10:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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


    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected ',' or ';' before ':' token
    7 |         vector<int> vec(2*M):
      |                             ^
a.cc:14:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |                 if(vec[k]==i) ++ans[i];
      |                                 ^~~
      |                                 abs
a.cc:16:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |             cout << ans[i] << endl;
      |                     ^~~
      |                     abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 't' was not declared in this scope
   20 |     cin>>t>>r;
      |          ^
a.cc: At global scope:
a.cc:26:3: error: expected unqualified-id before 'for'
   26 |   for(h=0;h<n;h++)
      |   ^~~
a.cc:26:11: error: 'h' does not name a type
   26 |   for(h=0;h<n;h++)
      |           ^
a.cc:26:15: error: 'h' does not name a type
   26 |   for(h=0;h<n;h++)
      |               ^
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
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 t=0;
    int r=0;
  
    cin>>t>>r;
    
    a[t-1]++;
    a[r-1]++;
}

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



}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: 't' was not declared in this scope
   18 |     cin>>t>>r;
      |          ^
a.cc: At global scope:
a.cc:24:3: error: expected unqualified-id before 'for'
   24 |   for(int h=0;h<n;h++)
      |   ^~~
a.cc:24:15: error: 'h' does not name a type
   24 |   for(int h=0;h<n;h++)
      |               ^
a.cc:24:19: error: 'h' does not name a type
   24 |   for(int h=0;h<n;h++)
      |                   ^
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;
  
  int a[n];
  
  for(int i=0;i<n;i++)
  {
    a[i]=0;
  }
  
  for(int i=0;i<m;i++)
    int ai;
    int bi;
  
    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:20:10: error: 'ai' was not declared in this scope; did you mean 'bi'?
   20 |     cin>>ai>>bi;
      |          ^~
      |          bi
a.cc: At global scope:
a.cc:26:3: error: expected unqualified-id before 'for'
   26 |   for(int i=0;i<n;i++)
      |   ^~~
a.cc:26:15: error: 'i' does not name a type
   26 |   for(int i=0;i<n;i++)
      |               ^
a.cc:26:19: error: 'i' does not name a type
   26 |   for(int i=0;i<n;i++)
      |                   ^
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^