submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s608371025
p03720
C++
#include <iostream> #include <algorithm> #include <set> using namespace std; int main() { int N[60] ={0}; int M; int t; cin >> t >> M; for (int i = 0; i < M; i++) { int a,b; cin >> a >> b; N[a]++; N[b]++; } for each (int var in N) { if(var){ cout << var << endl; } } }
a.cc: In function 'int main()': a.cc:21:13: error: expected '(' before 'each' 21 | for each (int var in N) | ^~~~ | ( a.cc:21:19: error: expected primary-expression before 'int' 21 | for each (int var in N) | ^~~ a.cc:21:13: error: 'each' was not declared in this scope 21 | for each (int var in N) | ^~~~ a.cc:27:1: error: expected primary-expression before '}' token 27 | } | ^ a.cc:26:10: error: expected ';' before '}' token 26 | } | ^ | ; 27 | } | ~ a.cc:27:1: error: expected primary-expression before '}' token 27 | } | ^ a.cc:26:10: error: expected ')' before '}' token 26 | } | ^ | ) 27 | } | ~ a.cc:21:13: note: to match this '(' 21 | for each (int var in N) | ^~~~ a.cc:27:1: error: expected primary-expression before '}' token 27 | } | ^
s794747631
p03720
C++
import collections N, M = map(int, input().split()) a, b = [0] * M, [0] * M for i in range(M): a[i], b[i] = map(int, input().split()) c = collections.Counter(a + b) for i in range(1, N + 1): print(c[i])
a.cc:1:1: error: 'import' does not name a type 1 | import collections | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s248857338
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int N,M; cin>>N>>M; int cnt[N]; for(int i=0;i<N;i++) cnt[[i=0; for(int i=0;i<M;i++){ int a,b; cin>>a>>b; cnt[a-1]++; cnt[b-1]++; } for(int i=0;i<N;i++) cout<<cnt[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: two consecutive '[' shall only introduce an attribute before '[' token 9 | cnt[[i=0; | ^
s986731917
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int N,M; cin>>N>>M; int cnt[N]; for(int i=0;i<M;i++){{ int a,b; cin>>a>>b; cnt[a-1]++; cnt[b-1]++; } for(int i=0;i<N;i++) cout<<cnt[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s026943492
p03720
C++
#Include<bits/stdc++.h> using namespace std; int main(void){ int N,M; cin>>N>>M; int cnt[N]; for(int i=0;i<M;i++){{ int a,b; cin>>a>>b; cnt[a-1]++; cnt[b-1]++; } for(int i=0;i<N;i++) cout<<cnt[i]<<endl; return 0; }
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include? 1 | #Include<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin>>N>>M; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #Include<bits/stdc++.h> a.cc:17:9: error: 'cout' was not declared in this scope 17 | cout<<cnt[i]<<endl; | ^~~~ a.cc:17:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:17:23: error: 'endl' was not declared in this scope 17 | cout<<cnt[i]<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #Include<bits/stdc++.h> a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s029276172
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, r, c; cin >> N >> M; int matrix[N][N]; for (int i = 0; i < M; i++) { cin >> r >> c; matrix[r][c] = 1; matrix[c][r] = 1; } for (int i = 0; i < N; i++) { int num = 0 for (int j = 0; j < N; j++) { num += matrix[i][j] } cout << num << endl; } }
a.cc: In function 'int main()': a.cc:15:5: error: expected ',' or ';' before 'for' 15 | for (int j = 0; j < N; j++) { | ^~~ a.cc:15:21: error: 'j' was not declared in this scope 15 | for (int j = 0; j < N; j++) { | ^
s604188230
p03720
C++
#include <iostream> using namespae std; int main(){ int n,m; cin >> n >> m; int a[m],b[m]; for(int i=0;i<m;i++){ cin >> a[i] >> b[i]; } int ans[n]; for(int i=0;i<n;i++){ ans[i]=0; } for(int i=0;i<m;i++){ ans[a[i]-1]++; ans[b[i]-1]++; } for(int i=0;i<n;i++){ cout << ans[i] << endl; } }
a.cc:2:7: error: expected nested-name-specifier before 'namespae' 2 | using namespae std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n >> m; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 20 | cout << ans[i] << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:20:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 20 | cout << ans[i] << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s507724631
p03720
C++
#include <bits/stdc++.h> using namespace std; /* REPmacro */ #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) #define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i) #define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i) /*alias*/ #define ALL(x) (x).begin(),(x).end() #define SZ(x) ((int)(x).size()) #define F first #define S second #define PB push_back #define EB emplace_back #define MP make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext #define prev asdprev /*using*/ using ll = long long; using ull = unsigned long long; using unsi = unsigned; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; using db = double; using plex = complex<double>; using vs = vector<string>; /*template*/ template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } /*struct*/ struct aaa{ aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa; /* const */ const int INF = 1001001001; const ll LINF = 1001001001001001001ll; const int MOD = 1e9 + 7; //10^9 const db EPS = 1e-9; const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1}; //#define int ll //#define int long long signed main() { int n,m; cin >> n >> m; set<int> s; int p; REP(i,2m){ cin >> p; s.insert(p); } REP(i,2m){ auto itr = s.find(i) cout << *itr << endl; } return 0; }
a.cc: In function 'int main()': a.cc:63:9: error: unable to find numeric literal operator 'operator""m' 63 | REP(i,2m){ | ^~ a.cc:5:39: note: in definition of macro 'REP' 5 | #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) | ^ a.cc:68:9: error: unable to find numeric literal operator 'operator""m' 68 | REP(i,2m){ | ^~ a.cc:5:39: note: in definition of macro 'REP' 5 | #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) | ^ a.cc:70:7: error: expected ',' or ';' before 'cout' 70 | cout << *itr << endl; | ^~~~
s333032112
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> L(N); for (int i = 0; i < M, i++) { int a, b; cin >> a >> b; L.at(a) += 1; L.at(b) += 1; } for (int i = 0; i < N, i++) { cout << L.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:9:29: error: expected ';' before ')' token 9 | for (int i = 0; i < M, i++) { | ^ | ; a.cc:16:29: error: expected ';' before ')' token 16 | for (int i = 0; i < N, i++) { | ^ | ;
s077946425
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; A.at(a-1)++; A.at(b-1)++; } for (int i = 0; i < N; i++) { cout << A.(i) << endl; } }
a.cc: In function 'int main()': a.cc:17:15: error: expected unqualified-id before '(' token 17 | cout << A.(i) << endl; | ^
s035980406
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector <int> road_city(2*m); vector <int> road_count(n); for (int i=0; i<2*m; i++) { cin >> road_city.at(i); } for (int i=0; i<2*m; i++) { road_count.at(road_city.(i)-1)++; } for (int i=0; i<n; i++) { cout << road_count.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:16:29: error: expected unqualified-id before '(' token 16 | road_count.at(road_city.(i)-1)++; | ^
s860922580
p03720
C++
#include <stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector <int> road_city(2*m); vector <int> road_count(n); for (int i=0; i<2*m; i++) { cin >> road_city.at(i); } for (int i=0; i<2*m; i++) { road_count.at(road_city.(i)-1)++; } for (int i=0; i<n; i++) { cout << road_count.at(i) << endl; } }
a.cc:1:10: fatal error: stdc++.h: No such file or directory 1 | #include <stdc++.h> | ^~~~~~~~~~ compilation terminated.
s384835953
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int> road_num(N); vector <int> road(2*M); for (int i=0; i<2*M; i++) { cin >> road.at(i); } for (int i=0; i<2*M; i++) { road_num.at(road.at(i))++ } for (int i=0; i<N; i++) { cout << road_num.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:16:30: error: expected ';' before '}' token 16 | road_num.at(road.at(i))++ | ^ | ; 17 | } | ~
s395092329
p03720
C
#include<stdio.h> int main(){ int i,j,k; int N,M; scanf("%d %d",&N,&M); int A[2*M]; for(i=0;i<2*M;i+=2) scanf("%d %d",&A[i],&A[i+1]); int B[N] = {0}; for(i=0;i<2*M;i++){ B[A[i]]++; } for(i=0;i<N;i++){ printf("%d\n",B[i]); } return 0; }
main.c: In function 'main': main.c:14:14: error: variable-sized object may not be initialized except with an empty initializer 14 | int B[N] = {0}; | ^
s078329598
p03720
C++
#include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; int a[M], b[M], c[N]; for(int i=0; i<M; i++){ cin >> a[i] >> b[i]; } for(int i=0 i<N; i++){ c[i] = 0; } for(int i=0; i<M; i++){ c[a[i]]++; c[b[i]]++; } for(int i=0; i<N; i++){ cout << c[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:14: error: expected ';' before 'i' 13 | for(int i=0 i<N; i++){ | ^~ | ;
s411854624
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int city, load; int go, back; cin >> city >> load; vector<int> cities(city); for (int i = 0; i < load; i++){ cin >> go >> back; cities.at(go) = cities.at(go) + 1 cities.at(back) = cities.at(back) + 1 } for (int i = 0; i < cities.size(); i++){ cout << cities.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:11:38: error: expected ';' before 'cities' 11 | cities.at(go) = cities.at(go) + 1 | ^ | ; 12 | cities.at(back) = cities.at(back) + 1 | ~~~~~~
s076919686
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int city, load; int go, back; cin >> city >> load; vector<int> cities(city); for (int i = 0; i < load; i++){ cin >> go >> back; city.at(go) = cities.at(go) + 1 city.at(back) = cities.at(back) + 1 } for (int i = 0; i < cities.size(); i++){ cout << cities.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:11:10: error: request for member 'at' in 'city', which is of non-class type 'int' 11 | city.at(go) = cities.at(go) + 1 | ^~
s730708922
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int city, load; int go, back; cin >> city >> load; vector<int> cities(city); for (int i = 0; i < load; i++){ cin >> go >> back; city.at(go) = city.at(go) + 1 city.at(back) = city.at(back) + 1 } for (int i = 0; i < len(cities); i++){ cout << cities.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:11:10: error: request for member 'at' in 'city', which is of non-class type 'int' 11 | city.at(go) = city.at(go) + 1 | ^~ a.cc:11:24: error: request for member 'at' in 'city', which is of non-class type 'int' 11 | city.at(go) = city.at(go) + 1 | ^~ a.cc:15:23: error: 'len' was not declared in this scope 15 | for (int i = 0; i < len(cities); i++){ | ^~~
s469827606
p03720
C
#include <stdio.h> int main(){ int n,m; scanf("%d%d",&n,&m); int a[m],b[m],road[n]; for (int i=0;i<m;i++){ scanf("%d%d",&a[i],&b[i]); } for (int i=0;i<n;i++){ for (int j=0;j<m;j++){ if (i==a[j]){ road[i]++; } if (i==b[j]){ road[i]++; } } print("%d\n",road[i]); } return 0; }
main.c: In function 'main': main.c:18:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 18 | print("%d\n",road[i]); | ^~~~~ | printf
s661149903
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int number, city, load, num,load_go, load_back; cin >> number; city = number[0]; load = number[1]; vector<int> cities(city) = {}; vector<int> loads(load) = {}; for (int i = 0; i < city; i++){ cities.at[i] = 0; } for (int i = 0; i < load; i++){ cin >> num load_go = num[0] load_back = num[1] city.at(load_go) = city.at(load_go) + 1; city.at(load_back) = city.at(load_back) + 1; } for (int i = 0; i < city; i++){ cout << cities.at[i] << endl; } }
a.cc: In function 'int main()': a.cc:7:16: error: invalid types 'int[int]' for array subscript 7 | city = number[0]; | ^ a.cc:8:16: error: invalid types 'int[int]' for array subscript 8 | load = number[1]; | ^ a.cc:9:28: error: expected ',' or ';' before '=' token 9 | vector<int> cities(city) = {}; | ^ a.cc:10:27: error: expected ',' or ';' before '=' token 10 | vector<int> loads(load) = {}; | ^ a.cc:13:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 13 | cities.at[i] = 0; | ^ a.cc:17:15: error: expected ';' before 'load_go' 17 | cin >> num | ^ | ; 18 | load_go = num[0] | ~~~~~~~ a.cc:21:10: error: request for member 'at' in 'city', which is of non-class type 'int' 21 | city.at(load_back) = city.at(load_back) + 1; | ^~ a.cc:21:31: error: request for member 'at' in 'city', which is of non-class type 'int' 21 | city.at(load_back) = city.at(load_back) + 1; | ^~ a.cc:25:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 25 | cout << cities.at[i] << endl; | ^
s530883617
p03720
C++
#include <bits/stdc++.h> using namespace std; int count[55]; int main () { int N,M; cin >> N >> M; for (int i = 0; i < M; ++i) { int tmp1 = 0; int tmp2 = 0; cin >> tmp1 >> tmp2; count[tmp1]++; count[tmp2]++; } for (int i = 0; i < N; ++i) { cout << count[i] << endl; } }
a.cc: In function 'int main()': a.cc:12:17: error: reference to 'count' is ambiguous 12 | count[tmp1]++; | ^~~~~ In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ a.cc:3:5: note: 'int count [55]' 3 | int count[55]; | ^~~~~ a.cc:13:17: error: reference to 'count' is ambiguous 13 | count[tmp2]++; | ^~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ /usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ a.cc:3:5: note: 'int count [55]' 3 | int count[55]; | ^~~~~ a.cc:17:25: error: reference to 'count' is ambiguous 17 | cout << count[i] << endl; | ^~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ /usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ a.cc:3:5: note: 'int count [55]' 3 | int count[55]; | ^~~~~
s326714303
p03720
C++
#include<bits/stdc++.h> using namespace std; int a[1001],b[1001]; int main(){ int i,j,n; cin>>a>>b; for(i=1;i<=n;i++){ a[i]++; b[i]++; } cout<<a<<b; return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1001]') 6 | cin>>a>>b; | ~~~^~~ | | | | | int [1001] | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 6 | cin>>a>>b; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(short int)((int*)(& a))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(int)((int*)(& a))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(unsigned int)((int*)(& a))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long int)((int*)(& a))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long long int)((int*)(& a))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 6 | cin>>a>>b; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [1001]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [1001]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [1001]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [1001]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [1001]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator
s452931085
p03720
C++
#include<bits/stdc++.h> using namespace std; int a[1001],b[1001]; int main(){ int i,j,n; cin>>a>>b; for(i=1;i<=n;i++){ a[i]++; b[i]++; } return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1001]') 6 | cin>>a>>b; | ~~~^~~ | | | | | int [1001] | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 6 | cin>>a>>b; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(short int)((int*)(& a))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(int)((int*)(& a))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(unsigned int)((int*)(& a))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long int)((int*)(& a))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long long int)((int*)(& a))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 6 | cin>>a>>b; | ^ | | | int* a.cc:6:14: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:6:14: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 6 | cin>>a>>b; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [1001]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [1001]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [1001]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [1001]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [1001]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator
s825586090
p03720
C++
#include <iostream> using ll = long long; const int AMAX = (int)1e5; ll cnt[AMAX + 1]; int main() { int N; ll K; cin >> N >> K; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; cnt[a] += b; } for (int ans = 1; ans <= AMAX; ++ans) { if (K <= cnt[ans]) { cout << ans << endl; return 0; } K -= cnt[ans]; } }
a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin >> N >> K; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:19:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 19 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:19:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 19 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s251294270
p03720
C
#include <iostream> using namespace std; int main() { cin.tie(0); ios_base::sync_with_stdio(false); int N, M; int n[50]; cin >> N >> M; for (int i=0; i<M; ++i) { int a, b; cin >> a >> b; ++n[a-1]; ++n[b-1]; } for (int i=0; i<N; ++i) { cout << n[i] << "\n"; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s218061200
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int a[m], b[m]; int c[m] = 0; for(int i = 0; i < m; i++){ cin >> a[i] >> b[i]; c[a[i]]++; c[b[i]]++; } for(int i = 0; i < m; i++){ cout << c[i] << endl; } }
a.cc: In function 'int main()': a.cc:6:14: error: array must be initialized with a brace-enclosed initializer 6 | int c[m] = 0; | ^
s153422394
p03720
C++
int main(void) { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (int i = 0; i < M; ++i) { cin >> A[i] >> B[i]; } int road[NMMAX]; for (int i = 0; i < N; ++i) { road[i] = 0; } for (int i = 0; i < M; ++i) { road[A[i] - 1] += 1; road[B[i] - 1] += 1; } for (int i = 0; i < N; ++i) { cout << road[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:3:2: error: 'cin' was not declared in this scope 3 | cin >> N >> M; | ^~~ a.cc:23:2: error: 'cout' was not declared in this scope 23 | cout << road[i] << endl; | ^~~~ a.cc:23:21: error: 'endl' was not declared in this scope 23 | cout << road[i] << endl; | ^~~~
s435657524
p03720
C++
#include<iostream> using namespace std; int main() { int N, M, A[N], road1[M], road2[M]; cin >> N >> M; for (int i = 0; i < M; i++) { cin >> road1[i] >> raod2[i]; } for (int i = 0; i++; i < N) { A[i] = 0; } for (int i = 0; i < M; i++) { A[road1[i] - 1]++; A[road2[i] - 1]++; } for (int i = 0; i < N; i++) { cout << A[i] << endl; } }
a.cc: In function 'int main()': a.cc:7:36: error: 'raod2' was not declared in this scope; did you mean 'road2'? 7 | cin >> road1[i] >> raod2[i]; | ^~~~~ | road2
s382662596
p03720
C++
#include<iostream> using namespace std; int main() { int N, M, A[N], road1[M], raod2[M]; cin >> N >> M; for (int i = 0; i < M; i++) { cin >> road1[i] >> raod2[i]; } for (int i = 0; i++; i < N) { A[i] = 0; } for (int i = 0; i < M; i++) { A[road1[i] - 1]++; A[road2[i] - 1]++; } for (int i = 0; i < N; i++) { cout << A[i] << endl; } }
a.cc: In function 'int main()': a.cc:14:19: error: 'road2' was not declared in this scope; did you mean 'raod2'? 14 | A[road2[i] - 1]++; | ^~~~~ | raod2
s793092522
p03720
C
#include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<int>> v(N); for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; a--; b--; v[a].push_back(b); v[b].push_back(a); } for (int i = 0; i < N; i++) { cout << v[i].size() << endl; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s427117985
p03720
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <climits> using namespace std; int main(){ int N, M, a[51], b[51], ans[51] = {0}; cin >> N >> M; for(int i = 0; i < M; i++) cin >> a[i] >> b[i]; for(int i = 0; i < M; i++){ ans[a[i]]++; ans[b[i]]++: } for (int i = 1; i <= N; i++) cout << ans[i] << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:16: error: expected ';' before ':' token 17 | ans[b[i]]++: | ^ | ;
s071026488
p03720
C++
#include<iostream> using namespace std; int main() { int n, m, ab[51] = {0}, a, b; cin >> n >> m; for(int i = 0; i < m; i++){ cin >> a >> b; ab[a] += 1; ab[b] += 1; } for(int i = 1; i <= n; i++){ cout << ab[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:12: error: '\U0000ff10' was not declared in this scope 15 | return 0; | ^~
s623155491
p03720
C++
#include<stdio.h> using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
a.cc: In function 'int main()': a.cc:2:50: error: 'cin' was not declared in this scope 2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<stdio.h> +++ |+#include <iostream> 2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} a.cc:2:135: error: 'cout' was not declared in this scope 2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~~ a.cc:2:135: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:2:147: error: 'endl' was not declared in this scope 2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include<stdio.h> +++ |+#include <ostream> 2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
s398519423
p03720
C++
#include<stdio.h> using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
a.cc: In function 'int main()': a.cc:2:50: error: 'cin' was not declared in this scope 2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<stdio.h> +++ |+#include <iostream> 2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} a.cc:2:135: error: 'cout' was not declared in this scope 2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~~ a.cc:2:135: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:2:147: error: 'endl' was not declared in this scope 2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include<stdio.h> +++ |+#include <ostream> 2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
s422629004
p03720
C++
#include <ios> using namespace std; int g[55]; main() { int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~ a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <ios> +++ |+#include <iostream> 2 | using namespace std; a.cc:6:94: error: 'cout' was not declared in this scope 6 | int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; | ^~~~ a.cc:6:94: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:6:106: error: 'endl' was not declared in this scope 6 | int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <ios> +++ |+#include <ostream> 2 | using namespace std;
s455865622
p03720
C++
#include <iostream> using namespace std; int g[89]; main(int) { n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(int) | ^~~~ a.cc:4:1: warning: 'int main(int)' takes only zero or two arguments [-Wmain] a.cc: In function 'int main(int)': a.cc:6:4: error: 'n' was not declared in this scope 6 | n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; | ^ a.cc:6:6: error: 'm' was not declared in this scope; did you mean 'tm'? 6 | n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; | ^ | tm a.cc:6:40: error: 'a' was not declared in this scope 6 | n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; | ^ a.cc:6:42: error: 'b' was not declared in this scope 6 | n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; | ^
s347395335
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N , M; cin >> N, M; vector<int> A; vector<int> B; for (int i = 0; i < N; i++) { cin >> A.at(i); }
a.cc: In function 'int main()': a.cc:11:4: error: expected '}' at end of input 11 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s432334865
p03720
Java
import java.util.*; import static java.lang.System.*; import static java.lang.Math.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(in); int n = Integer.parseInt(sc.next()); int m = Integer.parseInt(sc.next()); int[] a=new int[m]; int[] b=new int[m]; HashMap<Integer,Integer> map=new HashMap<>(); for (int i = 0; i < m; i++) { a[i]=Integer.parseInt(sc.next()); b[i]=Integer.parseInt(sc.next()); } for (int i = 0; i < m; i++) { map.put(a[i], 0); map.put(b[i], 0); } for (int i = 0; i < m; i++) { int c=map.get(a[i])++; map.put(a[i], c); c=map.get(b[i])++; map.put(b[i], c); } for (int i = 1; i <= n; i++) { out.println(map.get(i)); } } }
Main.java:21: error: unexpected type int c=map.get(a[i])++; ^ required: variable found: value Main.java:23: error: unexpected type c=map.get(b[i])++; ^ required: variable found: value 2 errors
s536898716
p03720
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define llong long long #define pb(a) push_back(a) #define INF 1000000000 using namespace std; typedef pair<int, int> P; typedef pair<llong, llong> LP; typedef pair<int, P> PP; typedef pair<llong, LP> LPP; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,M; cin >> N >> M; int a[2]; int sum[N] = 0; for(int i=0;i < M;i++){ cin >> a[0] >> a[1]; sum[a[0]]++; sum[a[1]]++; } REP(i,N) cout << sum[i] << endl; }
a.cc: In function 'int main()': a.cc:26:16: error: array must be initialized with a brace-enclosed initializer 26 | int sum[N] = 0; | ^
s582962352
p03720
C++
#include<iostream> using namespace std; int main(){ int N, M; int a[110]; multiset<int> st; for(int i = 0; i < 2*M; i += 2){ cin >> a[i]; st.insert(a[i]); } for(int i = 0; i < N) cout << st.count(i+1) << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'multiset' was not declared in this scope 7 | multiset<int> st; | ^~~~~~~~ a.cc:2:1: note: 'std::multiset' is defined in header '<set>'; this is probably fixable by adding '#include <set>' 1 | #include<iostream> +++ |+#include <set> 2 | using namespace std; a.cc:7:12: error: expected primary-expression before 'int' 7 | multiset<int> st; | ^~~ a.cc:11:5: error: 'st' was not declared in this scope; did you mean 'std'? 11 | st.insert(a[i]); | ^~ | std a.cc:13:23: error: expected ';' before ')' token 13 | for(int i = 0; i < N) | ^ | ; a.cc:14:13: error: 'st' was not declared in this scope; did you mean 'std'? 14 | cout << st.count(i+1) << endl; | ^~ | std
s872008906
p03720
C++
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int cnt[n + 1]; // 初期化 for (int i = 1; i <= n; i++) cnt[i] = 0; for (int i = 1; i <= m; i++) { int a = 0 int b = 0; cin >> a >> b; cnt[a] += 1; cnt[b] += 1; } for (int i = 1; i <= n; i++) { if (cnt[i] != 0) cout << cnt[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:5: error: expected ',' or ';' before 'int' 14 | int b = 0; | ^~~ a.cc:15:17: error: 'b' was not declared in this scope 15 | cin >> a >> b; | ^
s093236664
p03720
C++
#include "stdafx.h" #include "iostream" #include "algorithm" #include "string" #include "vector" #include "cmath" #define INT_MAX 2147483647 #define LLINT_MAX 9223372036854775807 #define mod 1000000007 #define ll long long int using namespace std; int main() { int n, m; cin >> n >> m; int a, b; int ans[50]; for (int i = 0; i < 50; i++) ans[i] = 0; for (int i = 0; i < m; i++) { cin >> a >> b; ans[a - 1]++; ans[b - 1]++; } for (int i = 0; i < n; i++) cout << ans[i] << endl; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s411659057
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; for (int n = 1; n < N + 1; n++){ //Nの値を順に調べる for (int j = 0; j < M; j++){ //各行ごとに調べる int a, b; cin >> a >> b >> endl; //入力受付 if(n == a){ // N=aのとき if(n == b){ sum += 2; } else{ sum += 1; } } else{ // N!=aのとき if(n == b){ sum += 1; } else{ sum += 0; } } } cout << sum << endl; sum = 0; } }
a.cc: In function 'int main()': a.cc:11:21: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 11 | cin >> a >> b >> endl; //入力受付 | ~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for
s880883411
p03720
C++
using namespace std; int main() { int N, M, a, b; cin >> N >> M; for (int n = 1; n < N + 1; n++){ int sum = 0; //N = pの個数のカウント //以下で各行ごとに調べる for (int j = 0; j < M; j++){ cin >> a >> b; //行のa, bの入力 //a, bがNに等しいか否かの判定 if (n == a && n == b){ sum += 2; } else if (n == a && n != b){ sum += 1; } else if (n != a && n == b){ sum += 1; } else{ continue; } } cout << sum << endl; } }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> N >> M; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:27:3: error: 'cout' was not declared in this scope 27 | cout << sum << endl; | ^~~~ a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:27:18: error: 'endl' was not declared in this scope 27 | cout << sum << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s660805201
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 for (int k = 0; k < 2; k++){ //配列の各要素についてiを探索 vector<int>city; cin << city.at(k); if (i == city.at(k)){ sum += 1; } else{ continue; } } } cout << sum << endl; sum = 0; } }
a.cc: In function 'int main()': a.cc:14:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 14 | cin << city.at(k); | ~~~ ^~ ~~~~~~~~~~ | | | | | __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int} | std::istream {aka std::basic_istream<char>} a.cc:14:13: note: candidate: 'operator<<(int, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int})' (built-in) 14 | cin << city.at(k); | ~~~~^~~~~~~~~~~~~ a.cc:14:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:14:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 14 | cin << city.at(k); | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin << city.at(k); | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin << city.at(k); | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | cin << city.at(k); | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:14:25: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | cin << city.at(k); |
s309450345
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 cin >> a >> b; vector<int>city; city = {a, b}; for (int k = 0; k < 2; k++){ //配列の各要素についてiを探索 if (i == city(k)){ sum += 1; } else{ continue; } } } cout << sum << endl; sum = 0; } }
a.cc: In function 'int main()': a.cc:16:22: error: no match for call to '(std::vector<int>) (int&)' 16 | if (i == city(k)){ | ~~~~^~~
s355587709
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 cin >> a >> b; vector<int>city; city = {a, b}; for (int k = 0; k < 2; k++){ //配列の各要素についてiを探索 if (i == city(k)){ sum += 1; } else{ continue; } } cout << sum << endl; sum = 0; } }
a.cc: In function 'int main()': a.cc:16:22: error: no match for call to '(std::vector<int>) (int&)' 16 | if (i == city(k)){ | ~~~~^~~ a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s731976151
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 cin >> a >> b; vector<int>city; city = {a, b} //配列に各行のa, bを代入 for(k = 0; k < 2; k++){ if (i = city.at(k)){ //配列の先頭から探索.kは配列の番号 sum += 1; } else{ continue; } } // 各要素の探索終わり } //各行の探索処理終わり cout << sum << endl; } }
a.cc: In function 'int main()': a.cc:14:20: error: expected ';' before 'for' 14 | city = {a, b} //配列に各行のa, bを代入 | ^ | ; 15 | 16 | for(k = 0; k < 2; k++){ | ~~~ a.cc:16:18: error: 'k' was not declared in this scope 16 | for(k = 0; k < 2; k++){ | ^
s085820723
p03720
C
#include <iostream> #include <cstring> int main() { int n, m; std::cin >> n >> m; int r[ n ]; std::memset( r, 0, sizeof( r ) ); for( int i = 0; i < m; i++ ) { int a, b; std::cin >> a >> b; r[ a - 1 ] += 1; r[ b - 1 ] += 1; } for( int i = 0; i < n; i++ ) { std::cout << r[ i ] << std::endl; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s814976703
p03720
C++
int main(void){ int n,m; int a[55],b[55]; cin >> n >> m; for(int i=0 ; i<m ; i++){ cin >> a[i] >>b[i]; a[i] -= 1; b[i] -= 1; } int ans[55]; for(int i = 0 ; i < n ; i++){ for(int j = 0 ; j < m ; i++){ if(a[j] == i|| b[j] == i){ ans[i] += 1; } } } for(int i = 0; i < n; i++){ cout << ans[i] << endl; } }
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> n >> m; | ^~~ a.cc:19:9: error: 'cout' was not declared in this scope 19 | cout << ans[i] << endl; | ^~~~ a.cc:19:27: error: 'endl' was not declared in this scope 19 | cout << ans[i] << endl; | ^~~~
s332288750
p03720
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N,M; N=sc.nextInt(); M=sc.nextInt(); int [] num_road = new int[N]; for(int a=0;a<M;a++){ int a_city =sc.nextInt(); int b_city =sc.nextInt(); num_road[a_city-1]++; num_road[b_city-1]++; } for(int b=0;b<N;b++){ System.out.println(num_road[b]); } }
Main.java:19: error: reached end of file while parsing } ^ 1 error
s608291979
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>n,m; vector<int>ab(2*m); vector<int>num(n); for(int i=0;i<n;i++){ num.at(i)=0; for(int i=0;i<2*m;i++){ cin>>ab.at(i); int t=ab.at(i)-1; num.at(t)++; } for(int i=0;i<n;i++){ cout<<num.at(i)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s350699186
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>n,m; vector<int>ab(2*m); vector<int>num(n); for(int i=0;i<n;i++){ num(i)=0; for(int i=0;i<2*m;i++){ cin>>ab.at(i); int t=ab.at(i)-1; num.at(t)++; } for(int i=0;i<n;i++){ cout<<num.at(i)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:6: error: no match for call to '(std::vector<int>) (int&)' 10 | num(i)=0; | ~~~^~~ a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s573588723
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>n,m; vector<int>ab(2*m); vector<int>num(n); for(int i=0;i<2*m;i++){ cin>>ab.at(i); num(ab.at(i))++; } for(int i=0;i<n;i++){ cout<<num.at(i)<<endl/; } return 0; }
a.cc: In function 'int main()': a.cc:11:6: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 11 | num(ab.at(i))++; | ~~~^~~~~~~~~~ a.cc:15:25: error: expected primary-expression before ';' token 15 | cout<<num.at(i)<<endl/; | ^
s821684445
p03720
C++
#include <iostream> using namespace std; int main() { int n,m,a,b; cin>>n>>m; vector<int> road(n,0); for(int i=0;i<m;i++) { cin>>a>>b; road.at(a-1)++; road.at(b-1)++; } for(int i=0;i<n;i++) { cout<<road.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<int> road(n,0); | ^~~~~~ 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:9:10: error: expected primary-expression before 'int' 9 | vector<int> road(n,0); | ^~~ a.cc:13:5: error: 'road' was not declared in this scope 13 | road.at(a-1)++; | ^~~~ a.cc:19:11: error: 'road' was not declared in this scope 19 | cout<<road.at(i)<<endl; | ^~~~
s452912881
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; int city[N] for(int i = 0;i < 2 * M;i++){ int a,b; cin >> a >> b; city[a - 1]++; city[b - 1]++; } for(int i = 0;i < N;i++){ cout << city[i]; } }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'for' 8 | for(int i = 0;i < 2 * M;i++){ | ^~~ a.cc:8:17: error: 'i' was not declared in this scope 8 | for(int i = 0;i < 2 * M;i++){ | ^ a.cc:15:13: error: 'city' was not declared in this scope 15 | cout << city[i]; | ^~~~
s240363533
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; int city[N] for(int i = 0;i < 2 * M;i++){ int a,b; cin >> a >> b; city[a - 1]++; city[b - 1]++; } for(int i = 0;i < N;i++){ cout << city[i]; } }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'for' 8 | for(int i = 0;i < 2 * M;i++){ | ^~~ a.cc:8:17: error: 'i' was not declared in this scope 8 | for(int i = 0;i < 2 * M;i++){ | ^ a.cc:15:13: error: 'city' was not declared in this scope 15 | cout << city[i]; | ^~~~
s024644873
p03720
C++
#include <iostream> #include <climits> #include <stack> #include <queue> #include <string> #include <set> #include <map> #include <math.h> #include <algorithm> #include <vector> using namespace std; typedef long long ll; typedef pair<ll,ll> P; long long int INF = 1e18; double Pi = 3.141592653589; const int mod = 1000000007; // memset(a,0,sizeof(a)); →全部0にする vector<int> G[100005]; std::vector<P> tree[100010]; int dx[8]={1,0,-1,0,1,1,-1,-1}; int dy[8]={0,1,0,-1,1,-1,-1,1}; #define p(x) cout<<x<<endl; #define pe(x) cout<<x<<" "; ll i,j,k,l,ii,jj; ll n,m; ll x,y; ll used[200005]; char s[305][305]; ll ans=0; ll v=-1,w; int main(){ int n,m; int x,y; cin>>n>>m; int a[55]; for(i=0;i<=n;i++){ a[i]=0; } for(i=0;i<m;i++){ cin>>x>>y; a[x]+=1; a[y]+=1; } for(i=1;i<=n;i++){ pe(a[i]); } p(); return 0; }
a.cc: In function 'int main()': a.cc:28:21: error: expected primary-expression before '<<' token 28 | #define p(x) cout<<x<<endl; | ^~ a.cc:55:9: note: in expansion of macro 'p' 55 | p(); | ^
s717650734
p03720
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> using namespace std; int main (void) { int N, M; int ans =0; cin >> N >> M; int A[N][N]={0}; for (int i=0; i<=M-1;i++){ cin >> a >> b; A[a][b]=1; A[b][a]=1; } for (int j=0; j<=N-1; j++) { for (int k=0; k<=N-1; k++){ if (A[j][k]== 1 ){ ans++; } } cout << ans << endl; ans=0; } }
a.cc: In function 'int main()': a.cc:14:12: error: 'a' was not declared in this scope 14 | cin >> a >> b; | ^ a.cc:14:17: error: 'b' was not declared in this scope 14 | cin >> a >> b; | ^
s793201665
p03720
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<vector> #include<map> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vc(N); for(int i=0;i<M;i++){ cin >> a >> b; vc[a-1]++; vc[b-1]++; } for(int i=0;i<vc.size();i++){ cout << vc[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: 'a' was not declared in this scope 12 | cin >> a >> b; | ^ a.cc:12:21: error: 'b' was not declared in this scope 12 | cin >> a >> b; | ^
s847137719
p03720
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] a = new int[M]: int[] b = new int[M]; for(int i = 0;i < M;i++){ a[i] = sc.nextInt(); b[i] = sc.nextIny(); } for(int i = 0;i < N;i++){ int ans = 0; for(int j = 0;j < M;j++){ if(a[j] == i+1)ans++; if(b[j] == 1+1)ans++; } System.out.println(ans); } }}
Main.java:7: error: ';' expected int[] a = new int[M]: ^ 1 error
s206214498
p03720
Java
import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int ab; int[] road = new int[n+1]; for(int i = 0;i<m*2;i++) { ab = sc.nextInt(); road[ab-1] =road[ab-1]+1; } for(int i = 0;i < n;i++) { System.out.println(road[i]); } }
Main.java:18: error: reached end of file while parsing } ^ 1 error
s740902775
p03720
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; int a[M], b[M]; for(int i=0; i<M; i++){ cin >> a[i] >> b[i]; } for(int i=0; i<N; i++){ cout << count(a,a+M,i) + count(b,b+M,i) << endl; }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s605349653
p03720
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; int a[M], b[M]; for(int i=0; i<M; i++){ cin >> a[i] >> b[i]; } for(int i=0; i<N; i++){ cout << count(a,i) + count(b,i) << endl; }
a.cc: In function 'int main()': a.cc:13:30: error: no matching function for call to 'count(int [M], int&)' 13 | cout << count(a,i) + count(b,i) << endl; | ~~~~~^~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ /usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate expects 4 arguments, 2 provided a.cc:13:43: error: no matching function for call to 'count(int [M], int&)' 13 | cout << count(a,i) + count(b,i) << endl; | ~~~~~^~~~~ /usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ /usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate expects 4 arguments, 2 provided a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s827154553
p03720
C++
#include <iostream> using namespace std; int cnt[100]; int N, K; int main() { cin >> N >> K: for(int i = 0; i < K; ++i) { int a, b; cin >> a >> b; --a; --b; cnt[a]++; cnt[b]++; } for(int i = 0; i < N; ++i) { cout << cnt[i] << endl; } }
a.cc: In function 'int main()': a.cc:7:16: error: expected ';' before ':' token 7 | cin >> N >> K: | ^ | ; a.cc:8:18: error: 'i' was not declared in this scope 8 | for(int i = 0; i < K; ++i) { | ^
s184872949
p03720
C++
#include <cstdio> #include <cstdlib> #include <iostream> #include <fstream> #include <sstream> #include <set> #include <map> #include <vector> #include <list> #include <algorithm> #include <cstring> #include <cmath> #include <string> #include <queue> #include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic #include <cassert> #include <iomanip> //do setprecision #include <ctime> #include <complex> using namespace std; #define FOR(i,b,e) for(int i=(b);i<(e);++i) #define FORQ(i,b,e) for(int i=(b);i<=(e);++i) #define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i) #define REP(x, n) for(int x = 0; x < (n); ++x) #define ST first #define ND second #define PB push_back #define MP make_pair #define LL long long #define ULL unsigned LL #define LD long double const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342; const int mod=1000000007; int main(){ int n,m,i,j; cin>>n>>m; int a[55],p,q; FOR(i,0,m){ cin>>p>>q; a[p]++; a[q]++; } FOR(i,n+1){ cout<<a[i]<<endl; } return 0; }
a.cc:47:18: error: macro "FOR" requires 3 arguments, but only 2 given 47 | FOR(i,n+1){ | ^ a.cc:22:9: note: macro "FOR" defined here 22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i) | ^~~ a.cc: In function 'int main()': a.cc:47:9: error: 'FOR' was not declared in this scope 47 | FOR(i,n+1){ | ^~~
s168393326
p03720
C++
#include<bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; int main(){ int a,b,c,f=0; cin>>a>>b; multi_set<int>s[100]; r(i,b){ cin>>c>>f; s[c].insert(f); s[f].insert(c); } r(i,a)cout<<s[i+1].size()<<endl; }
a.cc: In function 'int main()': a.cc:7:9: error: 'multi_set' was not declared in this scope 7 | multi_set<int>s[100]; | ^~~~~~~~~ a.cc:7:19: error: expected primary-expression before 'int' 7 | multi_set<int>s[100]; | ^~~ a.cc:10:17: error: 's' was not declared in this scope 10 | s[c].insert(f); | ^ a.cc:13:21: error: 's' was not declared in this scope 13 | r(i,a)cout<<s[i+1].size()<<endl; | ^
s856278221
p03720
C++
#include<bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; int main(){ int a,b,c,f=0; cin>>a>>b; set<int>s[100]; r(i,m){ cin>>c>>f; s[c].insert(f); s[f].insert(c); } r(i,n)cout<<s[i+1].size()<<endl; }
a.cc: In function 'int main()': a.cc:8:13: error: 'm' was not declared in this scope 8 | r(i,m){ | ^ a.cc:2:30: note: in definition of macro 'r' 2 | #define r(i,n) for(int i=0;i<n;i++) | ^ a.cc:13:13: error: 'n' was not declared in this scope 13 | r(i,n)cout<<s[i+1].size()<<endl; | ^ a.cc:2:30: note: in definition of macro 'r' 2 | #define r(i,n) for(int i=0;i<n;i++) | ^
s879954956
p03720
C++
#include<iostream> using namespace std; int n,m; int a[55],b[55],c[55]; int main() { cin>>n>>m; for(i=1;i<=n;i++) { cin>>a[i]>>b[i]; c[a[i]]++; c[b[i]]++; } for(i=1;i<=n;i++) { cout<<c[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:13: error: 'i' was not declared in this scope 8 | for(i=1;i<=n;i++) | ^ a.cc:14:13: error: 'i' was not declared in this scope 14 | for(i=1;i<=n;i++) | ^
s870938859
p03720
C++
// glory be to the sky #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m; int dg[250]; cin >> n >> m; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; ++dg[a]; ++dg[b]; } for (int i = 1; i <= n; i++) cout << dg[a] << endl; return 0; }
a.cc: In function 'int main()': a.cc:25:49: error: 'a' was not declared in this scope 25 | for (int i = 1; i <= n; i++) cout << dg[a] << endl; | ^
s622692791
p03720
C++
// glory be to the sky #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m; int dg[250]; cin >> n >> m; for (int i = 0; i < m; i++) { cin >> a >> b; ++dg[a]; ++dg[b]; } for (int i = 1; i <= n; i++) cout << dg[a] << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:24: error: 'a' was not declared in this scope 20 | cin >> a >> b; | ^ a.cc:20:29: error: 'b' was not declared in this scope 20 | cin >> a >> b; | ^ a.cc:24:49: error: 'a' was not declared in this scope 24 | for (int i = 1; i <= n; i++) cout << dg[a] << endl; | ^
s894301278
p03720
C++
#include<bits/stdc++.h> int main(){ int n,m,i,a; int x[51]; cin>>n>>m; for(i=1;i<=n;i++){ x[i]=0; } for(i=0;i<m*2;i++){ cin>>a; x[a]+=1; } for(i=1;i<=n;i++){ cout<<x[i]; } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n>>m; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout<<x[i]; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s645045502
p03720
C++
#include<bits/stdc++.h> int main(void){ int n,m,i,a; int x[51]; cin>>n>>m; for(i=1;i<=n;i++){ x[i]=0; } for(i=0;i<m*2;i++){ cin>>a; x[a]+=1; } for(i=1;i<=n;i++){ cout<<x[i] } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n>>m; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout<<x[i] | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s332117525
p03720
C++
N,M = map(int,input().split()) a = [] for i in range(M): x,y = input().split() a.append(x),a.append(y) for i in range(1,N+1):print(a.count(str(i)))
a.cc:1:1: error: 'N' does not name a type 1 | N,M = map(int,input().split()) | ^
s182802856
p03720
C++
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <numeric> using namespace std; const double PI = acos(-1.0); const string ALP = "abcdefghijklmnopqrstuvwxyz"; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) int main(){ int n,m,a; cin >> n >> m; vector<int> c(n); REP(i,m){ REP(i,2){ cin >> a; c[a]++ } } REP(i,n)cout << c[i] << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:13: error: expected ';' before '}' token 20 | c[a]++ | ^ | ; 21 | } | ~
s925863644
p03720
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { string[] s = Console.ReadLine().Split(' '); int N = int.Parse(s[0]); int M = int.Parse(s[1]); int[] n = new int[N]; for(int i = 0; i < M; i++) { s = Console.ReadLine().Split(' '); n[int.Parse(s[0])-1]++; n[int.Parse(s[1])-1]++; } for(int i=0;i<N;i++) Console.WriteLine(n[i]); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:25:6: error: expected ';' after class definition 25 | } | ^ | ; a.cc: In static member function 'static void ConsoleApp1::Program::Main(int*)': a.cc:13:13: error: 'string' was not declared in this scope 13 | string[] s = Console.ReadLine().Split(' '); | ^~~~~~ a.cc:13:20: error: expected primary-expression before ']' token 13 | string[] s = Console.ReadLine().Split(' '); | ^ a.cc:14:21: error: expected primary-expression before 'int' 14 | int N = int.Parse(s[0]); | ^~~ a.cc:15:21: error: expected primary-expression before 'int' 15 | int M = int.Parse(s[1]); | ^~~ a.cc:16:16: error: structured binding declaration cannot have type 'int' 16 | int[] n = new int[N]; | ^~ a.cc:16:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:16:16: error: empty structured binding declaration a.cc:16:19: error: expected initializer before 'n' 16 | int[] n = new int[N]; | ^ a.cc:19:17: error: 's' was not declared in this scope 19 | s = Console.ReadLine().Split(' '); | ^ a.cc:19:21: error: 'Console' was not declared in this scope 19 | s = Console.ReadLine().Split(' '); | ^~~~~~~ a.cc:20:17: error: 'n' was not declared in this scope 20 | n[int.Parse(s[0])-1]++; | ^ a.cc:20:19: error: expected primary-expression before 'int' 20 | n[int.Parse(s[0])-1]++; | ^~~ a.cc:20:19: error: expected ']' before 'int' a.cc:21:19: error: expected primary-expression before 'int' 21 | n[int.Parse(s[1])-1]++; | ^~~ a.cc:21:19: error: expected ']' before 'int' a.cc:23:34: error: 'Console' was not declared in this scope 23 | for(int i=0;i<N;i++) Console.WriteLine(n[i]); | ^~~~~~~ a.cc:23:52: error: 'n' was not declared in this scope 23 | for(int i=0;i<N;i++) Console.WriteLine(n[i]); | ^
s008720068
p03720
C++
using namespace std; //-------------------------------------------- #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define LL long long #define INF INT_MAX/3 //-------------------------------------------- const double EPS = 1e-14; const double PI = acos(-1.0); //-------------------------------------------- int main(){ int n,m; int a,b; scanf("%d %d",&n,&m); int city[60]; REP (i, m) { scanf("%d %d",&a,&b); city[a - 1] += 1; city[b - 1] += 1; } REP (i, n) printf("%d\n",city[i]); }
a.cc:13:20: error: 'acos' was not declared in this scope 13 | const double PI = acos(-1.0); | ^~~~ a.cc: In function 'int main()': a.cc:21:3: error: 'scanf' was not declared in this scope 21 | scanf("%d %d",&n,&m); | ^~~~~ a.cc:31:14: error: 'printf' was not declared in this scope 31 | REP (i, n) printf("%d\n",city[i]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | using namespace std;
s479378263
p03720
C
#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); int c[a]={0}; for(int i=0;i<b;i++){ int x,y; scanf("%d%d",&x,&y); c[x-1]++; c[y-1]++; } for(int i=0;i<a;i++){ printf("%d\n",c[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int c[a]={0}; | ^
s722753886
p03720
C
#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); int c[a]={0}; for(int i=0;i<b;i++){ int x,y; scanf("%d%d",&x,&y); c[x-1]++; c[y-1]++; } for(int i=0;i<a;i++){ printf("%d\n",c[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int c[a]={0}; | ^
s045862542
p03720
C++
#include<iostream> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; a=a%b; c=c%b; for(int i=1;i<=b;i++){ if((a*i)%b==c){ cout<<"YES<<endl; return 0; } } cout<<"NO<<endl; return 0; }
a.cc:10:7: warning: missing terminating " character 10 | cout<<"YES<<endl; | ^ a.cc:10:7: error: missing terminating " character 10 | cout<<"YES<<endl; | ^~~~~~~~~~~ a.cc:14:7: warning: missing terminating " character 14 | cout<<"NO<<endl; | ^ a.cc:14:7: error: missing terminating " character 14 | cout<<"NO<<endl; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:11:1: error: expected primary-expression before 'return' 11 | return 0; | ^~~~~~ a.cc:15:1: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~
s896605777
p03720
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <queue> #include <stack> #include <functional> #include <set> #include <map> #include <deque> #include <cmath> #define WMAX 10000 #define HMAX 10000 #define NMAX 52 #define MMAX 52 //コメントアウトするとdebug()を実行しない #define DEBUG using namespace std; template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } typedef long long ll; typedef pair<int ,int > P; struct edge{ int to,cost; }; int A[MMAX],B[MMAX],C,N,W,H,ans[NMAX] = {},dp[HMAX][WMAX]; string S; static const int dx[8] = {0,1,1,1,0,-1,-1,-1}, dy[8] = {1,1,0,-1,-1,-1,0,1}; void solve(){ for (int i = 0; i < M; ++i) { ans[A[i]]++; ans[B[i]]++; } } void debug(){ } void answer(){ for (int i = 0; i < N; ++i) { cout << ans[i] << "\n"; } } int main(){ cin >> N >> M; for (int i = 0; i < M; ++i) { cin >> A[i] >> B[i]; } solve(); #ifdef DEBUG debug(); #endif answer(); return 0; }
a.cc: In function 'void solve()': a.cc:41:29: error: 'M' was not declared in this scope 41 | for (int i = 0; i < M; ++i) | ^ a.cc: In function 'int main()': a.cc:60:21: error: 'M' was not declared in this scope 60 | cin >> N >> M; | ^
s970928297
p03720
C++
#include<stdio.h> int n,m,p,a[50],b[50],c[50][50]; int main() { scanf("%d%d",&n,&m); for(i=0;i<m;i++){ scanf("%d%d",&a[i],&b[i]); c[a[i]][b[i]]=1; c[b[i]][a[i]]=1; } for(i=0;i<n;i++){ p=0; for(j=0;j<51;j++){ p+=c[i][j]; } printf("%d\n",p); } return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: 'i' was not declared in this scope 6 | for(i=0;i<m;i++){ | ^ a.cc:11:13: error: 'i' was not declared in this scope 11 | for(i=0;i<n;i++){ | ^ a.cc:13:21: error: 'j' was not declared in this scope 13 | for(j=0;j<51;j++){ | ^
s921814044
p03720
C
#include<stdio.h> int main(){ int nn,mm; int ss[51][2]; int ans; int i,j; scanf("%d %d",&nn,&mm); for(i=0;i<mm;i++){ scanf("%d %d",&ss[i][0],&ss[i][1]); } for(j=1;j<=nn;j++){ ans = 0; for(i=0;i<mm;i++){ if(ss[i][0] == j) ans++; if(ss[i][1] == j) ans++; } printf("%d\n",ans); }
main.c: In function 'main': main.c:23:9: error: expected declaration or statement at end of input 23 | } | ^
s174969209
p03720
C++
#include<iostream> #include<string> using namespace std; int main(){ int a,b,c[50],d[50]; cin>>a>>b;s for(int i=0;i<b;i++){ cin>>c[i]; } for(int x=0;x<a;x++){ for(int z=0;z<b;z++){ if(c[z]==x){ d[x]++; } } } for(int y=0;y<a;y++){ cout<<d[y]<<endl; } }
a.cc: In function 'int main()': a.cc:6:19: error: 's' was not declared in this scope 6 | cin>>a>>b;s | ^ a.cc:7:21: error: 'i' was not declared in this scope 7 | for(int i=0;i<b;i++){ | ^
s993664043
p03720
C++
n, m = map(int, input().split()) nums = [] for i in range(m) : for val in map(int, input().split()): nums.append(val-1) for i in range(n): print(nums.count(i))
a.cc:1:1: error: 'n' does not name a type 1 | n, m = map(int, input().split()) | ^
s153379203
p03720
C++
2 5 1 2 2 1 1 2 2 1 1 2
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 5 | ^
s372662038
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m; int map<int,int> ans; for ( int i = 0; i < m; i++) { int x,y; cin >>x >> y; ans[x]++; ans[y]++; } for ( int i = 1 ; i <= n; i++) cout << ans[i] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:26: error: invalid declarator before 'ans' 7 | int map<int,int> ans; | ^~~ a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | ans[x]++; | ^~~ | abs a.cc:16:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 16 | cout << ans[i] << endl; | ^~~ | abs
s985206877
p03720
C++
#include<iostream> using namespace std; int num[50]; int main(){ int A,B; cin >> A >> B >>//A都市,B道路 int n,m; int a,b cin >> n >> m; while() { cin >> a >> b; num[a]++ ; num[b]++: } for(int i=1; i <=n; i++) cout << num[i] << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: expected primary-expression before 'int' 11 | int n,m; | ^~~ a.cc:14:5: error: expected initializer before 'cin' 14 | cin >> n >> m; | ^~~ a.cc:16:11: error: expected primary-expression before ')' token 16 | while() | ^ a.cc:18:21: error: 'b' was not declared in this scope 18 | cin >> a >> b; | ^ a.cc:24:22: error: 'n' was not declared in this scope 24 | for(int i=1; i <=n; i++) | ^
s092987143
p03720
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int[] m_sum = new int[m]; for(int i = 0 ; i < n ; i++){ int a = scan.nextInt() - 1 int b = scan.nextInt() - 1 m_sum[a]++; m_sum[b]++; } for(int i = 0 ; i < n ; i++){ System.out.println(m_sum[i]); } } }
Main.java:15: error: ';' expected int a = scan.nextInt() - 1 ^ Main.java:16: error: ';' expected int b = scan.nextInt() - 1 ^ 2 errors
s461532461
p03720
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int[] m_sum = new int[m]; for(int i = 0 ; i < n ; i++){ m_sum[scan.nextInt() - 1]++: m_sum[scan.nextInt() - 1]++: } for(int i = 0 ; i < n ; i++){ System.out.println(m_sum[i]); } } }
Main.java:15: error: ';' expected m_sum[scan.nextInt() - 1]++: ^ Main.java:16: error: ';' expected m_sum[scan.nextInt() - 1]++: ^ 2 errors
s443740881
p03720
C++
#include<iostream> using namespace std; int main(){ int ans[100]; int N,M; cin >> N >> M; 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[i] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: expected primary-expression before ')' token 7 | for(int i=0;i<M;i+=){ | ^
s545325809
p03720
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<math.h> #include<vector> using namespace std;   int c[50]; signed main() { int a, b; cin >> a >> b; for (int d = 0; d < b; d++) { int e, f; cin >> e >> f; c[e - 1]++; c[f - 1]++; } for (int i = 0; i < a; i++) { cout << c[i] << endl; } }
a.cc:7:1: error: extended character   is not valid in an identifier 7 |   | ^ a.cc:7:1: error: '\U000000a0' does not name a type 7 |   | ^ a.cc: In function 'int main()': a.cc:13:17: error: 'c' was not declared in this scope 13 | c[e - 1]++; c[f - 1]++; | ^ a.cc:16:25: error: 'c' was not declared in this scope 16 | cout << c[i] << endl; | ^
s508119054
p03720
Java
//package com.zhangyong.algorithm; import java.io.*; import java.util.StringTokenizer; public class Solution { FastScanner in; PrintWriter out; class FastScanner { BufferedReader br; StringTokenizer st; private FastScanner(File f) { try { br = new BufferedReader(new FileReader(f)); } catch (FileNotFoundException e) { e.printStackTrace(); } } private FastScanner(InputStream f) { br = new BufferedReader(new InputStreamReader(f)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } } private void solve() { int n, m; n = in.nextInt(); m = in.nextInt(); int[] arr = new int[n+1]; int l, r; for (int i = 0; i < m; i++) { l = in.nextInt(); r = in.nextInt(); arr[l] += 1; arr[r] += 1; } for (int i = 1; i <= n; i++) { out.println(arr[i]); } } private void run() { in = new FastScanner(System.in); out = new PrintWriter(System.out); solve(); out.close(); } public static void main(String[] args) { new Solution().run(); } }
Main.java:6: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ 1 error
s877422341
p03720
C
#include <stdio.h> #define NMAX 50 int main(void) { int N, M; int A[NMAX], B[NMAX]; int road[NMAX]; int i; scanf("%d %d", N ,M); for (i = 0; i < M+ i++) { scanf("%d %d", A[i], B[i]); } for (i = 0; i < N; i++) { road[i] = 0; } for (i = 0; i < M; i++) { road[A[i] - 1]++; road[B[i] - 1]++; } for (i = 0; i < N; i++) { printf("%d\n", road[i]); } return 0; }
main.c: In function 'main': main.c:13:31: error: expected ';' before ')' token 13 | for (i = 0; i < M+ i++) { | ^ | ;
s371961742
p03720
C++
using namespace std; int main() { int N, M, metro, i; int count[50] = {}; cin >> N >> M; for (i = 0; i < M * 2; i++) { cin >> metro; count[metro - 1]++; } for (i = 0; i < N; i++) { cout << count[i] << endl; } }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> N >> M; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:11:17: error: 'cout' was not declared in this scope 11 | cout << count[i] << endl; | ^~~~ a.cc:11:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:11:37: error: 'endl' was not declared in this scope 11 | cout << count[i] << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s812528037
p03720
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int m, n;int a[55]; ios::sync_with_stdio; while (cin >> m >> n) { memset(a, 0, sizeof(a)); for (int i = 0; i < n; i++) { int aa, bb; cin >> aa >> bb; if (aa != bb) { a[aa]++; a[bb]++; } } for (int i = 1; i <= m; i++) cout << a[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'memset' was not declared in this scope 9 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | using namespace std;
s739984694
p03720
C++
#include<iostream> using namespace std; int main(void){ int N,M; cin >> N >> M; int town[N]; fill(town,town+N,0); for(int i = 0 ;i<M;++i){ int tmp1,tmp2; cin >> tmp1 >> tmp2; tmp1--; tmp2--; town[tmp1]++; town[tmp2]++; } for(int i = ; i < N;++i){ cout << town[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:15: error: expected primary-expression before ';' token 23 | for(int i = ; i < N;++i){ | ^
s659436682
p03720
C++
#include<string.h> int map[100][100]; int main(){ int n,m,i,a,b,j,sum; scanf("%d%d",&n,&m); memset(map,0,sizeof(map)); for(i=0;i<m;i++){ scanf("%d%d",&a,&b); map[a][b]++; map[b][a]++; } for(i=1;i<=n;i++){ sum=0; for(j=1;j<=n;j++){ sum+=map[i][j]; } printf("%d\n",sum); } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf' was not declared in this scope 5 | scanf("%d%d",&n,&m); | ^~~~~ a.cc:17:17: error: 'printf' was not declared in this scope 17 | printf("%d\n",sum); | ^~~~~~ a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 1 | #include<string.h> +++ |+#include <cstdio> 2 | int map[100][100];
s368003853
p03720
C++
#include <iostream> #include <algorithm> #include <queue> #include <stack> #include <cmath> #include <string> #include <cstdio> #include <cstdlib> using namespace std; int main() { int m, n;int a[55]; ios::sync_with_stdio; while (cin >> m >> n) { memset(a, 0, sizeof(a)); for (int i = 0; i < n; i++) { int aa, bb; cin >> aa >> bb; if (aa != bb) { a[aa]++; a[bb]++; } } for (int i = 1; i <= m; i++) cout << a[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <cstdlib> +++ |+#include <cstring> 9 | using namespace std;
s610851553
p03720
C++
#include <iostream> #include <algorithm> #include <queue> #include <stack> #include <cmath> #include <string> #include <cstdio> #include <cstdlib> using namespace std; int main() { int m, n;int a[55]; ios::sync_with_stdio; while (cin >> m >> n) { memset(a, 0, sizeof(a)); for (int i = 0; i < n; i++) { int aa, bb; cin >> aa >> bb; a[aa]++; a[bb]++; } for (int i = 1; i <= m; i++) cout << a[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <cstdlib> +++ |+#include <cstring> 9 | using namespace std;