submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s110709766
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } for(int i=0;i<N;i++) { int sum=0; for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { cout << sum+=1 << endl; } } } }
a.cc: In function 'int main()': a.cc:18:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 18 | cout << sum+=1 << endl; | ~~^~~~~~~
s756322409
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { cout << sum+=1 << endl; } } } }
a.cc: In function 'int main()': a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 17 | cout << sum+=1 << endl; | ~~^~~~~~~
s774860622
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { cout << sum+=1; cout << endl; } } } }
a.cc: In function 'int main()': a.cc:17:20: error: no match for 'operator+=' (operand types are 'std::basic_ostream<char>' and 'int') 17 | cout << sum+=1; | ~~~~~~~~~~~^~~
s665213754
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { cout << sum+=1 << endl; } } } }
a.cc: In function 'int main()': a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 17 | cout << sum+=1 << endl; | ~~^~~~~~~
s896660003
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<M;j++) { if(a.at(i)==b.at(j)>0) { cout << sum+=1 << endl; } } } }
a.cc: In function 'int main()': a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 17 | cout << sum+=1 << endl; | ~~^~~~~~~
s483219609
p03720
C++
int main(){ int n,m; cin >>n>>m; int a[m][2]; rep(i,m){ rep(j,2){ cin>>a[i][j]; } } int bucket[n]={0}; rep(i,m){ rep(j,2){ bucket[a[i][j]-1]++; } } rep(i,n) cout<<bucket[i]<<endl; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >>n>>m; | ^~~ a.cc:5:7: error: 'i' was not declared in this scope 5 | rep(i,m){ | ^ a.cc:5:3: error: 'rep' was not declared in this scope 5 | rep(i,m){ | ^~~
s746181746
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) int main(){ int n,m; cin >>n>>m; int a[m][2]; rep(i,m){ rep(j,2){ cin>>a[i][j]; } } int bucket[n]={0}; rep(i,m){2){ rep(j, bucket[a[i][j]-1]++; } } rep(i,n) cout<<bucket[i]<<endl; }
a.cc:21:2: error: unterminated argument list invoking macro "rep" 21 | } | ^ a.cc: In function 'int main()': a.cc:15:13: error: expected ';' before ')' token 15 | rep(i,m){2){ | ^ | ; a.cc:16:8: error: expected '}' at end of input 16 | rep(j, | ^ a.cc:15:11: note: to match this '{' 15 | rep(i,m){2){ | ^ a.cc:16:8: error: expected '}' at end of input 16 | rep(j, | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s441722084
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> count(n); for(int i = 0; i < m*2; i++){ int x; cin >> x; count[x-1]++; } for(int i = 0; i < N; i++) cout << count[i] << endl; }
a.cc: In function 'int main()': a.cc:15:22: error: 'N' was not declared in this scope 15 | for(int i = 0; i < N; i++) | ^
s081409230
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int N,M; cin >> N >> M; vector <int> a(M), vector <int> b(M); rep(i,M) cin >> a.at(i) >> b.at(i); rep(i,N){ int x=0; rep(j,M){ if(a.at(j) == i+1 || b.at(j) == i+1) x++; } cout << x << endl; } }
a.cc: In function 'int main()': a.cc:9:16: error: invalid declarator before 'b' 9 | vector <int> b(M); | ^ a.cc:12:23: error: 'b' was not declared in this scope 12 | cin >> a.at(i) >> b.at(i); | ^ a.cc:16:28: error: 'b' was not declared in this scope 16 | if(a.at(j) == i+1 || b.at(j) == i+1) | ^
s283560963
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int N,M; cin >> N >> M; vector <int> a,b(N); rep(i,M) cin >> a.at(i) >> b.at(i); rep(i,N){ int x=0; rep(j,N){ if(a.at(j) == j+1 || b.at(j) == j+1) x++; } cout << x << endl; }
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s780626682
p03720
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; vector<int> city(n, 0); for (int i=0; i<m; i++) { int a, b; cin >> a >> b; city.at(a-1)++; city.at(b-1)++ } for (int i=0; i<n; i++) { cout << city.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:13:23: error: expected ';' before '}' token 13 | city.at(b-1)++ | ^ | ; 14 | } | ~
s850029116
p03720
C
#include<limits.h> #define NUM 51 int main(){ int n, m, a, b; int r[NUM]; scanf("%d%d\n", &n, &m); for(int i=1; i<=n; i++){ p[i] = 0; } for(int i=0; i<m; i++){ scanf("%d%d\n", &a, &b); p[a]++; p[b]++; } for(int i=1; i<=n; i++){ printf("%d\n", r[i]); } return 0; }
main.c: In function 'main': main.c:8:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | scanf("%d%d\n", &n, &m); | ^~~~~ main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 1 | #include<limits.h> +++ |+#include <stdio.h> 2 | main.c:8:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 8 | scanf("%d%d\n", &n, &m); | ^~~~~ main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:10:17: error: 'p' undeclared (first use in this function) 10 | p[i] = 0; | ^ main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in main.c:18:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 18 | printf("%d\n", r[i]); | ^~~~~~ main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:18:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf'
s028778672
p03720
C++
#include<iostream> using namespace std; int main(){ int N,M; cin>>N>>M; int a[M],b[M]; int i; for(i=0;i<M;i++){ cin>>a[i]>>b[i]; } int backet[N]; for(i=0;i<N;i++){ backet[a[i]]++; backet[b[i]]++; } for(i=0;i<N;i++){ cout>>backet[i];} }
a.cc: In function 'int main()': a.cc:17:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 17 | cout>>backet[i];} | ~~~~^~~~~~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:17:7: note: candidate: 'operator>>(int, int)' (built-in) 17 | cout>>backet[i];} | ~~~~^~~~~~~~~~~ a.cc:17:7: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:17:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout>>backet[i];} | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:17:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 17 | cout>>backet[i];} | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:17:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout>>backet[i];} | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:17:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout>>backet[i];} | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:17:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout>>backet[i];} | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:17:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout>>backet[i];} | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:17:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout>>backet[i];} | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:17:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout>>backet[i];} | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:17:17: required from here 17 | cout>>backet[i];} | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s556697868
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m; vector<int> ans(N,0); for(int i = 0; i < m; i++) { int a,b; cin >> a >> b; ans[a-1]++; ans[b-1]++; } for(int i=0;i < n;i++) cout << ans.at(i) << endl; }
a.cc: In function 'int main()': a.cc:7:19: error: 'N' was not declared in this scope 7 | vector<int> ans(N,0); | ^
s973249418
p03720
C
#include<stdio.h> int main(void){ int n,m,i,a,b; scanf("%d %d",&n,&m); int r[n]={0}; for(i=0;i<m;i++){ scanf("%d %d",&a,&b); r[a]++; r[b]++; } for(i=0;i<n;i++){ printf("%d",r[i]); } return 0; }
main.c: In function 'main': main.c:5:12: error: variable-sized object may not be initialized except with an empty initializer 5 | int r[n]={0}; | ^
s649971432
p03720
C
#include<stdio.h> int main(void){ int n,m,i,a,b; scanf("%d %d",&n,&m); int road[n]={0}; for(i=0;i<m;i++){ scanf("%d %d",&a,&b); road[a]++; road[b]++; } for(i=0;i<n;i++){ printf("%d",road[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int road[n]={0}; | ^
s550650954
p03720
C
#include<stdio.h> int main(void){ int n,m,i,a,b; scanf("%d %d",&n,&m); int road[n]={0}; for(i=0;i<m;i++){ scanf("%d %d",&a,&b); road[a]++; road[b]++; } for(i=0;i<n;i++){ printf("%d",road[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int road[n]={0}; | ^
s011594906
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> c(N,0); int a,b; for(int i=0;i<M;i++){ cin >> a >> b; c.at(a-1)++; c.at(b-1)++; } for(int i=0;i<N;i++) cout << N.at(i) << endl; }
a.cc: In function 'int main()': a.cc:16:15: error: request for member 'at' in 'N', which is of non-class type 'int' 16 | cout << N.at(i) << endl; | ^~
s900583551
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> c(N,0); int a,b; for(int i=0;i<M;i++){ cin >> a >> b; N.at(a) +=1; N.at(b) +=1; } for(int i=0;i<N;i++) cout << N.at(i) << endl; }
a.cc: In function 'int main()': a.cc:12:7: error: request for member 'at' in 'N', which is of non-class type 'int' 12 | N.at(a) +=1; | ^~ a.cc:13:7: error: request for member 'at' in 'N', which is of non-class type 'int' 13 | N.at(b) +=1; | ^~ a.cc:16:15: error: request for member 'at' in 'N', which is of non-class type 'int' 16 | cout << N.at(i) << endl; | ^~
s742379212
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> c(N,0); int a,b; for(int i=0;i<M;i++){ cin >> a >> b; N.at(a)++; N,at(b)++; } for(int i=0;i<N;i++) cout << N(i) << endl; }
a.cc: In function 'int main()': a.cc:12:7: error: request for member 'at' in 'N', which is of non-class type 'int' 12 | N.at(a)++; | ^~ a.cc:13:7: error: 'at' was not declared in this scope; did you mean 'a'? 13 | N,at(b)++; | ^~ | a a.cc:16:14: error: 'N' cannot be used as a function 16 | cout << N(i) << endl; | ~^~~
s443563264
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> k(2*M); for(int i=0;i<2*M;i=i+1){ cin >> k.at(i); } sort(k.begin(),k.end()) map<int,int> unti; for(int x:k){ if(unti.count(x)){ unti.at(x)=unti.at(x)+1; } else{ unti.at(x)=1; } } for(int i=1;i<=N;i=i+1){ cout << unti.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:11:26: error: expected ';' before 'map' 11 | sort(k.begin(),k.end()) | ^ | ; 12 | map<int,int> unti; | ~~~ a.cc:14:8: error: 'unti' was not declared in this scope 14 | if(unti.count(x)){ | ^~~~ a.cc:22:13: error: 'unti' was not declared in this scope 22 | cout << unti.at(i) << endl; | ^~~~
s306066498
p03720
C++
#include<iostream> #include <bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m ; int a[m],b[m] int c[n] = {0} ; for(int i=0;i<m;i++){ cin >> a[i] >> b[i] ; } for(int i=0;i<m;i++){ c[a[i]-1]++; c[b[i]-1]++; } for(int i=0;i<n;i++){ cout << c[i] << endl ; } }
a.cc: In function 'int main()': a.cc:11:3: error: expected initializer before 'int' 11 | int c[n] = {0} ; | ^~~ a.cc:13:20: error: 'b' was not declared in this scope 13 | cin >> a[i] >> b[i] ; | ^ a.cc:17:5: error: 'c' was not declared in this scope 17 | c[a[i]-1]++; | ^ a.cc:18:7: error: 'b' was not declared in this scope 18 | c[b[i]-1]++; | ^ a.cc:22:13: error: 'c' was not declared in this scope 22 | cout << c[i] << endl ; | ^
s753255721
p03720
C++
#include <iostream> int main() { int n,m; scanf("%d%d",&n,&m); int i,a,b; int h[n+1],i; for(i=1;i<=m;++i) { scanf("%d",&a); scanf("%d",&b); h[a]++; h[b]++; } for(i=1;i<n;++i) { if(h[i]!=0) printf("%d\n",h[i]); } }
a.cc: In function 'int main()': a.cc:8:15: error: redeclaration of 'int i' 8 | int h[n+1],i; | ^ a.cc:7:8: note: 'int i' previously declared here 7 | int i,a,b; | ^
s414675504
p03720
C++
#include <bits/stdc++.h>// using namespace std; int main() { int N, M; cin >> N >> M; vector<int> ans(N); for (int i=0;i<M;i++){ int a,b; cin >> a >> b; for (int j=0;j<N;j++){ if(j+1 == a || j+1 == b) ans.at(j) +=1 } } for (int i=0;i<N;i++){ cout << ans.at(i) <<endl; } }
a.cc: In function 'int main()': a.cc:13:20: error: expected ';' before '}' token 13 | ans.at(j) +=1 | ^ | ; 14 | } | ~
s449664772
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; vector<int> vec(2); for(int i=0;i<M;i++){ cin >> vec.at(0) >> vec.at(1); for(int j=1;j<N+1;j++){ int f=0; if(vec.at(0)==j||vec.at(1)==j) f++; } cout << f << endl; } }
a.cc: In function 'int main()': a.cc:16:17: error: 'f' was not declared in this scope 16 | cout << f << endl; | ^
s902927572
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; vector<int> vec(2); for(int i=0;i<M;i++){ cin >> vec.at(0) >> vec.at(1); } for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } cout << f << endl; } }
a.cc: In function 'int main()': a.cc:16:21: error: lvalue required as left operand of assignment 16 | if(vec.at(0)=j||vec.at(1)=j) | ~^~~~~~~~~~~
s619744430
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; for(int i=0;i<M;i++){ vector<int> vec(2); cin >> vec.at(0) >> vec.at(1); } for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } cout << f << endl; } }
a.cc: In function 'int main()': a.cc:16:10: error: 'vec' was not declared in this scope 16 | if(vec.at(0)=j||vec.at(1)=j) | ^~~
s927497078
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; for(int i=0;i<M;i++) vector<int> vec(2); cin >> vec.at(0) >> vec.at(1); for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } cout << f << endl; } }
a.cc: In function 'int main()': a.cc:10:12: error: 'vec' was not declared in this scope 10 | cin >> vec.at(0) >> vec.at(1); | ^~~
s907471644
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; for(int i=0;i<M;i++) cin >> vector<int> vec(2); for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } cout << f << endl; }
a.cc: In function 'int main()': a.cc:9:24: error: expected primary-expression before 'vec' 9 | cin >> vector<int> vec(2); | ^~~ a.cc:14:10: error: 'vec' was not declared in this scope 14 | if(vec.at(0)=j||vec.at(1)=j) | ^~~ a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() {//それぞれの数字の数を出力したい | ^
s164504544
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.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:12:7: error: request for member 'at' in 'a', which is of non-class type 'int' 12 | a.at(a-1)++; | ^~ a.cc:13:7: error: request for member 'at' in 'a', which is of non-class type 'int' 13 | a.at(b-1)++; | ^~
s250301161
p03720
C++
#include <bits/stdc++.h> int n, m; int main() { std::cin >> n >> m; std::vector<int> a(m), b(m); for (int i = 0; i < m; ++i) { std::cin >> a[i] >> b[i]; } std::vector<int> road(n); for (int i = 0; i < n; ++i) { road[i] = 0; } for (int i = 0; i < M; ++i) { road[a[i]-1] += 1; road[b[i]-1] += 1; } for (int i = 0; i < N; ++i) { std::cout << road[i] << std::endl; } }
a.cc: In function 'int main()': a.cc:19:23: error: 'M' was not declared in this scope 19 | for (int i = 0; i < M; ++i) { | ^ a.cc:24:23: error: 'N' was not declared in this scope 24 | for (int i = 0; i < N; ++i) { | ^
s202348671
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n, m; cin >> n >> m; vi deg(n); for(int i = 0; i < m; i++){ int a, b; cin >> a >> b; --a, --b; deg[a]++;deg[b]++; } for(auto i : deg) cout << i << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: 'vi' was not declared in this scope 8 | vi deg(n); | ^~ a.cc:13:9: error: 'deg' was not declared in this scope 13 | deg[a]++;deg[b]++; | ^~~ a.cc:15:18: error: 'deg' was not declared in this scope 15 | for(auto i : deg) | ^~~
s478309134
p03720
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) typedef long long ll; template <class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; int main() { int n, m; cin >> n >> m; int road[n]; rep(i, n) { road[i] = 0; } rep(i, m) { int a, b; cin >> a >> b; ++road[a - 1]; ++road[b - 1]; } rep(i, n) { cout << road[i] << endl; } return 0;
a.cc: In function 'int main()': a.cc:45:12: error: expected '}' at end of input 45 | return 0; | ^ a.cc:25:12: note: to match this '{' 25 | int main() { | ^
s001328402
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2*M),count(N); for(int i=0;i<2*M;i++){ cin>>road.at(i); for(int j=0;j<N;j++){ for(int i=0;i<2*M;i++){ if(road.at(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:8:25: note: to match this '{' 8 | for(int i=0;i<2*M;i++){ | ^ a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s491828751
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2*M),count(N); for(i=0;i<2*M;i++){ cin>>road.at(i); for(j=0;j<N;j++){ for(i=0;i<2*M;i++){ if(road.at(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<2*M;i++){ | ^ a.cc:11:7: error: 'j' was not declared in this scope 11 | for(j=0;j<N;j++){ | ^ a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:8:21: note: to match this '{' 8 | for(i=0;i<2*M;i++){ | ^ a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s709454762
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2*M)count(N); for(i=0;i<2*M;i++){ cin>>road.t(i); for(j=0;j<N;j++){ for(i=0;i<2*M;i++){ if(road.t(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:6:24: error: expected ',' or ';' before 'count' 6 | vector<int> road(2*M)count(N); | ^~~~~ a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<2*M;i++){ | ^ a.cc:9:17: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'? 9 | cin>>road.t(i); | ^ | at a.cc:11:7: error: 'j' was not declared in this scope 11 | for(j=0;j<N;j++){ | ^ a.cc:13:15: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'? 13 | if(road.t(i)==j) | ^ | at a.cc:14:15: error: overloaded function with no contextual type information 14 | count.at(j)++; | ^~ a.cc:16:17: error: overloaded function with no contextual type information 16 | cout<<count.at(j)<<endl; | ^~ a.cc:17:4: error: expected '}' at end of input 17 | } | ^ a.cc:8:21: note: to match this '{' 8 | for(i=0;i<2*M;i++){ | ^ a.cc:17:4: error: expected '}' at end of input 17 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s669351221
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2M)count(N); for(i=0;i<2M;i++){ cin>>road.t(i); for(j=0;j<N;j++){ for(i=0;i<2M;i++){ if(road.t(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:6:20: error: unable to find numeric literal operator 'operator""M' 6 | vector<int> road(2M)count(N); | ^~ a.cc:6:23: error: expected ',' or ';' before 'count' 6 | vector<int> road(2M)count(N); | ^~~~~ a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<2M;i++){ | ^ a.cc:8:13: error: unable to find numeric literal operator 'operator""M' 8 | for(i=0;i<2M;i++){ | ^~ a.cc:9:17: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'? 9 | cin>>road.t(i); | ^ | at a.cc:11:7: error: 'j' was not declared in this scope 11 | for(j=0;j<N;j++){ | ^ a.cc:12:15: error: unable to find numeric literal operator 'operator""M' 12 | for(i=0;i<2M;i++){ | ^~ a.cc:13:15: error: 'class std::vector<int>' has no member named 't'; did you mean 'at'? 13 | if(road.t(i)==j) | ^ | at a.cc:14:15: error: overloaded function with no contextual type information 14 | count.at(j)++; | ^~ a.cc:16:17: error: overloaded function with no contextual type information 16 | cout<<count.at(j)<<endl; | ^~ a.cc:17:4: error: expected '}' at end of input 17 | } | ^ a.cc:8:20: note: to match this '{' 8 | for(i=0;i<2M;i++){ | ^ a.cc:17:4: error: expected '}' at end of input 17 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s831691131
p03720
C++
#include <bits/stdc++.h> using namespace std; int main () { int N , M ; cin >> N >> M ; vector<int> vec(2M); for (int i = 0 ; i < 2M ; i++ ) { cin >> vec.at(i) ; } for ( int i = 0 ; i < M ; i++) { int sum = 0 ; for ( int k = 0 ; k < 2M ; k++){ if ( vec.at (k) == i ){ sum++ ; } } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:8:19: error: unable to find numeric literal operator 'operator""M' 8 | vector<int> vec(2M); | ^~ a.cc:10:24: error: unable to find numeric literal operator 'operator""M' 10 | for (int i = 0 ; i < 2M ; i++ ) { | ^~ a.cc:16:27: error: unable to find numeric literal operator 'operator""M' 16 | for ( int k = 0 ; k < 2M ; k++){ | ^~ a.cc:22:4: error: expected '}' at end of input 22 | } | ^ a.cc:4:13: note: to match this '{' 4 | int main () { | ^
s699065980
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> a(M); vector<int> b(M); for(int i=0;i<M;i++){ cin >> a.at(i) >> b.at(i); } int count = 0; for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ if(a.at(j) == i){ count++; } if(b.at(j) == i){ count++; } } cout << count << endl; } } }
a.cc:25:1: error: expected declaration before '}' token 25 | } | ^
s941319405
p03720
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } int gcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return f; } bool prime(int a){ if(a<2) return false; else if(a==2) return true; else if(a%2==0) return false; double b=sqrt(a); for(int i=3;i<=b;i+=2){ if(a%i==0){ return false; } } return true; } signed main(){ int n,m; cin>>n>>m; V<int> a(n,0); for(int i=0; i<m; i++){ int b,c; cin>>b>>c; a[b-1]++; a[c-1]++; } fo(i,n){ cout<<a[i]<<endl; } }
a.cc: In function 'int main()': a.cc:76:3: error: 'V' was not declared in this scope 76 | V<int> a(n,0); | ^ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:76:5: note: in expansion of macro 'int' 76 | V<int> a(n,0); | ^~~ a.cc:80:5: error: 'a' was not declared in this scope 80 | a[b-1]++; | ^ a.cc:85:11: error: 'a' was not declared in this scope 85 | cout<<a[i]<<endl; | ^
s776373672
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2*M); for(int i=0; i<2*M; i++){ cin >> vec.at(i); } vector<int> number(N); for(int i=0; i<2*M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl; }
a.cc: In function 'int main()': a.cc:21:4: error: expected '}' at end of input 21 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s360751137
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2*M); for(int i=0; i<2*M; i++){ cin >> vec.at(i); } int number(N); for(int i=0; i<2*M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl; }
a.cc: In function 'int main()': a.cc:15:12: error: request for member 'at' in 'number', which is of non-class type 'int' 15 | number.at(vec.at(i))++; | ^~ a.cc:19:20: error: request for member 'at' in 'number', which is of non-class type 'int' 19 | cout << number.at(i) << endl; | ^~ a.cc:20:4: error: expected '}' at end of input 20 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s763114276
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2M); for(int i=0; i<2M; i++){ cin >> vec.at(i); } int number(N); for(int i=0; i<2M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl; }
a.cc: In function 'int main()': a.cc:7:19: error: unable to find numeric literal operator 'operator""M' 7 | vector<int> vec(2M); | ^~ a.cc:9:18: error: unable to find numeric literal operator 'operator""M' 9 | for(int i=0; i<2M; i++){ | ^~ a.cc:14:18: error: unable to find numeric literal operator 'operator""M' 14 | for(int i=0; i<2M; i++){ | ^~ a.cc:15:12: error: request for member 'at' in 'number', which is of non-class type 'int' 15 | number.at(vec.at(i))++; | ^~ a.cc:19:20: error: request for member 'at' in 'number', which is of non-class type 'int' 19 | cout << number.at(i) << endl; | ^~ a.cc:20:4: error: expected '}' at end of input 20 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s644670690
p03720
C++
#include <bits/stdc++.h> using nameplace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2M); for(int i=0; i<2M; i++){ cin >> vec.at(i); } int number(N); for(int i=0; i<2M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl; }
a.cc:2:7: error: expected nested-name-specifier before 'nameplace' 2 | using nameplace 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 /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:7:3: error: 'vector' was not declared in this scope 7 | vector<int> vec(2M); | ^~~~~~ a.cc:7:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:7:10: error: expected primary-expression before 'int' 7 | vector<int> vec(2M); | ^~~ a.cc:9:18: error: unable to find numeric literal operator 'operator""M' 9 | for(int i=0; i<2M; i++){ | ^~ a.cc:10:12: error: 'vec' was not declared in this scope 10 | cin >> vec.at(i); | ^~~ a.cc:14:18: error: unable to find numeric literal operator 'operator""M' 14 | for(int i=0; i<2M; i++){ | ^~ a.cc:15:12: error: request for member 'at' in 'number', which is of non-class type 'int' 15 | number.at(vec.at(i))++; | ^~ a.cc:15:15: error: 'vec' was not declared in this scope 15 | number.at(vec.at(i))++; | ^~~ a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 19 | cout << number.at(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:19:20: error: request for member 'at' in 'number', which is of non-class type 'int' 19 | cout << number.at(i) << endl; | ^~ a.cc:19:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 19 | cout << number.at(i) << endl; | ^~~~ | std::endl 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:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:20:4: error: expected '}' at end of input 20 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s922830785
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a; cin >> N >> M; vector<int> vec(N, 0); for(int i=0;i<2*N;i++){ cin >> a; vec.at(a)++; } for(int i=0;i<N;i++){ cout << vec.at(i) << endl; }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s046871967
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a; cin >> N >> M; vector<int> vec(N, 0); for(i=0;i<2*N;i++){ cin >> a; vec.at(a)++; } for(i=0;i<N;i++){ cout << vec.at(i) << endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<2*N;i++){ | ^ a.cc:12:7: error: 'i' was not declared in this scope 12 | for(i=0;i<N;i++){ | ^ a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s167336981
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); int n, m; cin >> n >> m; vector<int> a(n+1, 0); for(int i = 0; i < m; i++) { cin >> x >> y; a[x]++; a[y]++; } for(int i = 1; i <= n; i++) { cout << a[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:12: error: 'x' was not declared in this scope 13 | cin >> x >> y; | ^ a.cc:13:17: error: 'y' was not declared in this scope 13 | cin >> x >> y; | ^
s304560959
p03720
C++
#include <bits/stdc++> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> road(N); for (int i=0; i < M;i++) { int a, b; cin >> a >> b; road.at(a)++; road.at(b)++; } for (int i=1; i<M; i++) { cout << road.at(i) << endl; } }
a.cc:1:10: fatal error: bits/stdc++: No such file or directory 1 | #include <bits/stdc++> | ^~~~~~~~~~~~~ compilation terminated.
s366315533
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >>M; vector<int> city(2*M); for (int i=0;i<2*M;i++) { cin >> city.at(i); } for (int i=0;i<N;i++) { cout << city.length(i+1) <<endl; } }
a.cc: In function 'int main()': a.cc:14:18: error: 'class std::vector<int>' has no member named 'length' 14 | cout << city.length(i+1) <<endl; | ^~~~~~
s613680522
p03720
Java
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int M = scanner.nextInt(); int[] a = new int[M]; int[] b = new int[M]; int[] ans = new int[N + 1]; for (int i = 0; i < M; i++) { a[i] = scanner.nextInt(); b[i] = scanner.nextInt(); ans[a[i]]++; ans[b[i]]++; } scanner.close(); for(int i = 1; i < ans.length; i++) { System.out.println(ans[i]); } } }
Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s178623835
p03720
C++
#include <stdio.h> int main(void){ int n = 0, m = 0; int a = 0, b = 0; int ans[51]; scanf("%d%d", &n, &m); for(int i = 1; i<= n; i++){ ans[i] = 0; }  for(int i = 0; i < m; i++){ scanf("%d%d", &a, &b); ans[a]++; ans[b]++; } for(int i = 1; i<= n; i++){ printf("%d\n", ans[i]); } return 0; }
a.cc:12:1: error: stray '\16' in program 12 | <U+000E> | ^~~~~~~~
s412880004
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (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 (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1; } for (inti=0;i<N;++i){ cout << road[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:14: error: 'inti' was not declared in this scope; did you mean 'int'? 19 | for (inti=0;i<M;++i){ | ^~~~ | int a.cc:19:21: error: 'i' was not declared in this scope 19 | for (inti=0;i<M;++i){ | ^ a.cc:23:14: error: 'inti' was not declared in this scope; did you mean 'int'? 23 | for (inti=0;i<N;++i){ | ^~~~ | int a.cc:23:21: error: 'i' was not declared in this scope 23 | for (inti=0;i<N;++i){ | ^
s251015123
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (inti=0;i<M;++i){ cin >> A[i] >> B[i]; } int road[NMMAX]; for (inti=0;i<N;++i){ road[i] = 0; } for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1; } for (inti=0;i<N;++i){ cout << road[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:14: error: 'inti' was not declared in this scope; did you mean 'int'? 10 | for (inti=0;i<M;++i){ | ^~~~ | int a.cc:10:21: error: 'i' was not declared in this scope 10 | for (inti=0;i<M;++i){ | ^ a.cc:15:14: error: 'inti' was not declared in this scope; did you mean 'int'? 15 | for (inti=0;i<N;++i){ | ^~~~ | int a.cc:15:21: error: 'i' was not declared in this scope 15 | for (inti=0;i<N;++i){ | ^ a.cc:19:14: error: 'inti' was not declared in this scope; did you mean 'int'? 19 | for (inti=0;i<M;++i){ | ^~~~ | int a.cc:19:21: error: 'i' was not declared in this scope 19 | for (inti=0;i<M;++i){ | ^ a.cc:23:14: error: 'inti' was not declared in this scope; did you mean 'int'? 23 | for (inti=0;i<N;++i){ | ^~~~ | int a.cc:23:21: error: 'i' was not declared in this scope 23 | for (inti=0;i<N;++i){ | ^
s382680564
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; vector<int> a(M),b(M); map<int,int> A; for(int i=0;i<M;i++){ cin>>a.at(i)>>b.at(i);} for(int i=0; i<M; i++){ if(!A.count(a.at(i))){A[a.at(i)]=1} else{A.at(a.at(i))++;} if(!A.count(b.at(i))){A[b.at(i)]=1} else{A.at(b.at(i))++;} } for(int i=0;i<N;i++){ cout<<A.at(i)<<endl;} }
a.cc: In function 'int main()': a.cc:13:39: error: expected ';' before '}' token 13 | if(!A.count(a.at(i))){A[a.at(i)]=1} | ^ | ; a.cc:15:39: error: expected ';' before '}' token 15 | if(!A.count(b.at(i))){A[b.at(i)]=1} | ^ | ;
s376359152
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int cities, roads; cin >> cities >> roads; vector<int> answers(cities); for(int i =0; i < roads; i++) { int a,b; cin >> a >> b; answers.at(a)++; answers.at(b)++; } for(int i = 0; i < cities; ii++) { cout << answers.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:14:30: error: 'ii' was not declared in this scope; did you mean 'i'? 14 | for(int i = 0; i < cities; ii++) { | ^~ | i
s157042721
p03720
C
#include <stdio.h> int main() { int n,m,i,c1,c2; scanf("%d%d",&n,&m); int c[n]; for(i=1;i<=n;i++) { c[i]=0; } for(i=0;i<m;i++){ scanf("%d%d",&c1,&c2); c[c1]+= 1; c[c2]+= 1; } for(i=1;i<=N;i++){ printf("%d\n",c[i]); } return 0; }
main.c: In function 'main': main.c:14:20: error: 'N' undeclared (first use in this function) 14 | for(i=1;i<=N;i++){ | ^ main.c:14:20: note: each undeclared identifier is reported only once for each function it appears in
s743501569
p03720
C++
#include<bits/stdc++.h> #define rep(i,a) for(int i=0;i<a;i++) using namespace std; int main(){ int n,m; cin>>n>>m; int a[n]; rep(i,m){ int ena,enb; cin>>ena>>enb; a[ena-1]++; b[enb-1]++; } rep(i,n){ cout<<a[i]<<endl; } }
a.cc: In function 'int main()': a.cc:12:9: error: 'b' was not declared in this scope 12 | b[enb-1]++; | ^
s154828175
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ vector<int> a,q; int s,d,f,g,y = 0; cin >> s >> d; for (int i= 0;i<d;i++){ cin >> f >> g; a.push_back(f); q.push_back(g); } for(int j =0;i<s;i++){ y=0; for(int i=0;i<d;i++){ if(i+1 == a.at(i)) y += 1; if(i+1 == q.at(i)) y += 1; } cout << y << endl; } }
a.cc: In function 'int main()': a.cc:12:16: error: 'i' was not declared in this scope 12 | for(int j =0;i<s;i++){ | ^
s862907070
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N , M , a , b; cin >> N >> M; vector <int> count(N , 0) for (int i = 0 ; i < M ; i ++){ cin >> a >> b; count.at(a-1) += 1; count.at(b-1) += 1; } for(int i = 0 ; i < M ; i ++){ cout << count.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:8:9: error: expected ',' or ';' before 'for' 8 | for (int i = 0 ; i < M ; i ++){ | ^~~ a.cc:8:26: error: 'i' was not declared in this scope 8 | for (int i = 0 ; i < M ; i ++){ | ^
s957107738
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> vector<int> ab(M * 2); for (int i = 0; i < M * 2; i++) { cin >> ab.at(i); } for (int i = 0; i < N; i++) { int cnt = 0; for (int j = 0; j < M * 2; j++) { if (i + 1 == ab.at(j)) { cnt++; } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:8:15: error: expected primary-expression before 'ab' 8 | vector<int> ab(M * 2); | ^~ a.cc:10:14: error: 'ab' was not declared in this scope; did you mean 'abs'? 10 | cin >> ab.at(i); | ^~ | abs a.cc:16:20: error: 'ab' was not declared in this scope; did you mean 'abs'? 16 | if (i + 1 == ab.at(j)) { | ^~ | abs a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s656159363
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(void) { 2 int N, M; 3 cin >> N >> M; 4 5 const int NMMAX = 50; 6 int A[NMMAX], B[NMMAX]; 7 8 for (int i = 0; i < M; ++i) { 9 cin >> A[i] >> B[i]; 10 } 11 12 int road[NMMAX]; 13 for (int i = 0; i < N; ++i) { 14 road[i] = 0; 15 } 16 17 for (int i = 0; i < M; ++i) { 18 road[A[i] - 1] += 1; 19 road[B[i] - 1] += 1; 20 } 21 22 for (int i = 0; i < N; ++i) { 23 cout << road[i] << endl; 24 } 25 26 return 0; 27 }
a.cc: In function 'int main()': a.cc:5:2: error: expected ';' before 'int' 5 | 2 int N, M; | ^~~~ | ; a.cc:6:2: error: expected ';' before 'cin' 6 | 3 cin >> N >> M; | ^~~~ | ; a.cc:7:2: error: expected ';' before numeric constant 7 | 4 | ^ | ; 8 | 5 const int NMMAX = 50; | ~ a.cc:9:2: error: expected ';' before 'int' 9 | 6 int A[NMMAX], B[NMMAX]; | ^~~~ | ; a.cc:10:2: error: expected ';' before numeric constant 10 | 7 | ^ | ; 11 | 8 for (int i = 0; i < M; ++i) { | ~ a.cc:11:19: error: 'i' was not declared in this scope 11 | 8 for (int i = 0; i < M; ++i) { | ^ a.cc:11:23: error: 'M' was not declared in this scope 11 | 8 for (int i = 0; i < M; ++i) { | ^ a.cc:14:3: error: expected ';' before numeric constant 14 | 11 | ^ | ; 15 | 12 int road[NMMAX]; | ~~ a.cc:16:3: error: expected ';' before 'for' 16 | 13 for (int i = 0; i < N; ++i) { | ^~~~ | ; a.cc:16:24: error: 'N' was not declared in this scope 16 | 13 for (int i = 0; i < N; ++i) { | ^ a.cc:19:3: error: expected ';' before numeric constant 19 | 16 | ^ | ; 20 | 17 for (int i = 0; i < M; ++i) { | ~~ a.cc:24:3: error: expected ';' before numeric constant 24 | 21 | ^ | ; 25 | 22 for (int i = 0; i < N; ++i) { | ~~ a.cc:28:3: error: expected ';' before numeric constant 28 | 25 | ^ | ; 29 | 26 return 0; | ~~ a.cc:30:3: error: expected ';' before '}' token 30 | 27 } | ^~ | ;
s599398011
p03720
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) #define ll long long using namespace std; int main(){ int n,m;cin>>n>>m; map<int, int> m; rep(i,m){ int a,b;cin>>a>>b; map[a]++; map[b]++; } rep(i,n){ cout<<m[i+1]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: conflicting declaration 'std::map<int, int> m' 11 | map<int, int> m; | ^ a.cc:9:9: note: previous declaration as 'int m' 9 | int n,m;cin>>n>>m; | ^ a.cc:14:9: error: conflicting declaration 'auto a' 14 | map[a]++; | ^ a.cc:13:9: note: previous declaration as 'int a' 13 | int a,b;cin>>a>>b; | ^ a.cc:14:11: error: expected initializer before '++' token 14 | map[a]++; | ^~ a.cc:15:9: error: conflicting declaration 'auto b' 15 | map[b]++; | ^ a.cc:13:11: note: previous declaration as 'int b' 13 | int a,b;cin>>a>>b; | ^ a.cc:15:11: error: expected initializer before '++' token 15 | map[b]++; | ^~ a.cc:19:12: error: invalid types 'int[int]' for array subscript 19 | cout<<m[i+1]<<endl; | ^
s263372171
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> a(M), b(M); for (int i = 0; i < M; i++) { cin >> a(M).at(i) >> b(M).at(i); } vector<int> c(N); for (int i = 0; i < M; i++) { c(N).at(a(M).at(i) -1)++; c(N).at(b(M).at(i) -1)++; } cout << c(N) << endl; }
a.cc: In function 'int main()': a.cc:11:13: error: no match for call to '(std::vector<int>) (int&)' 11 | cin >> a(M).at(i) >> b(M).at(i); | ~^~~ a.cc:11:27: error: no match for call to '(std::vector<int>) (int&)' 11 | cin >> a(M).at(i) >> b(M).at(i); | ~^~~ a.cc:16:6: error: no match for call to '(std::vector<int>) (int&)' 16 | c(N).at(a(M).at(i) -1)++; | ~^~~ a.cc:16:14: error: no match for call to '(std::vector<int>) (int&)' 16 | c(N).at(a(M).at(i) -1)++; | ~^~~ a.cc:17:6: error: no match for call to '(std::vector<int>) (int&)' 17 | c(N).at(b(M).at(i) -1)++; | ~^~~ a.cc:17:14: error: no match for call to '(std::vector<int>) (int&)' 17 | c(N).at(b(M).at(i) -1)++; | ~^~~ a.cc:19:12: error: no match for call to '(std::vector<int>) (int&)' 19 | cout << c(N) << endl; | ~^~~
s239858394
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> machi_a(M); vector<int> machi_b(M); vector<int> total(N); for(int i=0; i <M; i++){ cin >> machi_a.at(i) >> machi_b.at(i); int A =machi_a.at(i); int B =machi_b.at(i); for(int j =0, j<N; j++){ if(A == j){ total.at(j)++;} if(B == j){ total.at(j)++;}} } for(int i =0; i<N; i++){ cout << total.at(j) << endl;} }
a.cc: In function 'int main()': a.cc:17:20: error: expected ';' before '<' token 17 | for(int j =0, j<N; j++){ | ^ | ; a.cc:17:20: error: expected primary-expression before '<' token a.cc:24:22: error: 'j' was not declared in this scope 24 | cout << total.at(j) << endl;} | ^
s763409475
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> machi_a(M); vector<int> machi_b(M); vector<int> total(N); for(int i=0; i <M; i++){ cin >> machi_a(i) >> machi_b(i); int A =machi_a(i); int B =machi_b(i); for(int j =0, j<N; j++){ if(A == j){ total.at(j)++;} if(B == j){ total.at(j)++;}} } for(int i =0; i<N; i++){ cout << total.at(j) << endl;} }
a.cc: In function 'int main()': a.cc:14:19: error: no match for call to '(std::vector<int>) (int&)' 14 | cin >> machi_a(i) >> machi_b(i); | ~~~~~~~^~~ a.cc:14:33: error: no match for call to '(std::vector<int>) (int&)' 14 | cin >> machi_a(i) >> machi_b(i); | ~~~~~~~^~~ a.cc:15:19: error: no match for call to '(std::vector<int>) (int&)' 15 | int A =machi_a(i); | ~~~~~~~^~~ a.cc:16:19: error: no match for call to '(std::vector<int>) (int&)' 16 | int B =machi_b(i); | ~~~~~~~^~~ a.cc:17:20: error: expected ';' before '<' token 17 | for(int j =0, j<N; j++){ | ^ | ; a.cc:17:20: error: expected primary-expression before '<' token a.cc:24:22: error: 'j' was not declared in this scope 24 | cout << total.at(j) << endl;} | ^
s802983735
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,W; cin>>N>>W; vector<int> vec(N,0); for(int i=0;i<W;i++){ int a,b; cin>>a>>b; vec[a]++; vec[b]++; } for(int i=0;i<N;i++){ cout<<vec[a]<<endl; } }
a.cc: In function 'int main()': a.cc:15:15: error: 'a' was not declared in this scope 15 | cout<<vec[a]<<endl; | ^
s310415252
p03720
C++
#include <iostream> #include <fstream> #include <algorithm> // for next_permutation #include <vector> #include <bits/stl_numeric.h> #define DEBUG 0 #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll MOD = 1000000007; static const ll INF = 1000000000000000000LL; using namespace std; int main() { int N,M; cin >> N >> M; vector <int> do(N, 0); for(int i = 0; i < M: ++i) { int a,b; cin >> a >> b; --a;--b; ++do[a]; ++do[b]; } for(auto t:do) { cout << t << endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:18: error: expected unqualified-id before 'do' 19 | vector <int> do(N, 0); | ^~ a.cc:21:20: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] 21 | for(int i = 0; i < M: ++i) | ^ a.cc:21:25: error: expected ';' before ':' token 21 | for(int i = 0; i < M: ++i) | ^ | ; a.cc:30:5: error: expected primary-expression before 'for' 30 | for(auto t:do) | ^~~ a.cc:28:6: error: expected ';' before 'for' 28 | } | ^ | ; 29 | 30 | for(auto t:do) | ~~~ a.cc:30:5: error: expected primary-expression before 'for' 30 | for(auto t:do) | ^~~ a.cc:28:6: error: expected ')' before 'for' 28 | } | ^ | ) 29 | 30 | for(auto t:do) | ~~~ a.cc:21:8: note: to match this '(' 21 | for(int i = 0; i < M: ++i) | ^ a.cc:30:16: error: expected primary-expression before 'do' 30 | for(auto t:do) | ^~ a.cc:30:16: error: expected ')' before 'do' 30 | for(auto t:do) | ~ ^~ | ) a.cc:30:18: error: expected primary-expression before ')' token 30 | for(auto t:do) | ^ a.cc:35:12: error: expected 'while' before numeric constant 35 | return 0; | ^ a.cc:35:12: error: expected '(' before numeric constant 35 | return 0; | ^ | ( a.cc:35:13: error: expected ')' before ';' token 35 | return 0; | ~^ | )
s627570777
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> a(N); vector<int> b(N); for (int i = 0; i < N; i++){ cin >> a.at(i); cin >> b.at(i); } vector<int> c(M,0); for(int i = 0; i < M; i++){ c.at(A.at(i) - 1) += 1; c.at(B.at(i) - 1) += 1; } for(int i = 0; i < N; i++){ cout << c.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:16:10: error: 'A' was not declared in this scope 16 | c.at(A.at(i) - 1) += 1; | ^ a.cc:17:10: error: 'B' was not declared in this scope 17 | c.at(B.at(i) - 1) += 1; | ^
s533456389
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m,a; vector<int> vec(n); cin>>n>>m; for(int i=0;i<2m;i++){ cin>>a; vec.at(a-1)++; } for(int i=0;i<n;i++){ cout<<vec.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:8:17: error: unable to find numeric literal operator 'operator""m' 8 | for(int i=0;i<2m;i++){ | ^~
s318132402
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; int n,m; n=0; while(n<N){ m=0; while(m<2*M){ cin>>m; if(m==n){ x++; } m++; } cout<<m<<endl; n++; } }
a.cc: In function 'int main()': a.cc:13:9: error: 'x' was not declared in this scope 13 | x++; | ^
s869422422
p03720
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; } int gcd(int a,int b) { int r, tmp; /* 自然数 a > b を確認・入替 */ if(a<b){ tmp = a; a = b; b = tmp; } /* ユークリッドの互除法 */ r = a % b; while(r!=0){ a = b; b = r; r = a % b; } return b; } int fac(int n){ int m=1; while(n>=1) m*=n,n--; return m; } int vec_sum(vector<int> v){ int n=0; for(int i=0;i<v.size();i++) n+=v[i]; return n; } /////////////////////////// int main() { int n,m; cin>>n>>m; vector<int> v; map<int,int> mp; rep(i,2*m){ int a; cin>>a; v.push_back(a); } rep(i,2*m){ mp[v[i]-1]++; } for(i,n){ cout<<mp[i]<<endl; } } ///////////////////////////
a.cc: In function 'int main()': a.cc:83:7: error: 'i' was not declared in this scope 83 | for(i,n){ | ^ a.cc:87:1: error: expected primary-expression before '}' token 87 | } | ^ a.cc:85:4: error: expected ';' before '}' token 85 | } | ^ | ; 86 | 87 | } | ~ a.cc:87:1: error: expected primary-expression before '}' token 87 | } | ^ a.cc:85:4: error: expected ')' before '}' token 85 | } | ^ | ) 86 | 87 | } | ~ a.cc:83:6: note: to match this '(' 83 | for(i,n){ | ^ a.cc:87:1: error: expected primary-expression before '}' token 87 | } | ^
s978391474
p03720
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; } int gcd(int a,int b) { int r, tmp; /* 自然数 a > b を確認・入替 */ if(a<b){ tmp = a; a = b; b = tmp; } /* ユークリッドの互除法 */ r = a % b; while(r!=0){ a = b; b = r; r = a % b; } return b; } int fac(int n){ int m=1; while(n>=1) m*=n,n--; return m; } int vec_sum(vector<int> v){ int n=0; for(int i=0;i<v.size();i++) n+=v[i]; return n; } /////////////////////////// int main() { int n,m; cin>>n>>m; vector<int> v; map<int,int> mp; rep(i,2*m){ int a; cin>>a; v.push_back(a); } rep(i,2*m){ mp[v[i]]++; } sort(mp.begin(),mp.end()); for(auto c:mp){ cout<<c.second<<endl; } } ///////////////////////////
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = _Rb_tree_iterator<pair<const int, int> >; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = _Rb_tree_iterator<pair<const int, int> >]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:82:7: required from here 82 | sort(mp.begin(),mp.end()); | ~~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1906:50: error: no match for 'operator-' (operand types are 'std::_Rb_tree_iterator<std::pair<const int, int> >' and 'std::_Rb_tree_iterator<std::pair<const int, int> >') 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::reverse_iterator<_Iterator>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::move_iterator<_IteratorL>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::valarray<_Tp>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/valarray:605: /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_algo.h:1906:50: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)' 465 | operator-(const complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_T
s248469950
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) int main() { int N, M, x, y; string all; cin >> N >> M; vector<int> x(M); rep(i,M) { rep(j,2) { cin >> x >> y; all+='0'+x+y; } } rep(k,all.size()) { rep(l,N) { if(all.at(k)=='0'+l+1) x.at(l)++; } } rep(z,N){cout << x.at(z) << endl;} }
a.cc: In function 'int main()': a.cc:10:15: error: conflicting declaration 'std::vector<int> x' 10 | vector<int> x(M); | ^ a.cc:7:13: note: previous declaration as 'int x' 7 | int N, M, x, y; | ^ a.cc:24:9: error: request for member 'at' in 'x', which is of non-class type 'int' 24 | x.at(l)++; | ^~ a.cc:27:22: error: request for member 'at' in 'x', which is of non-class type 'int' 27 | rep(z,N){cout << x.at(z) << endl;} | ^~
s163575128
p03720
C++
#include<iostream> #include<vector> using namespace std; int main() { int n,m; cin>>n>>m; vector<int>N(n); for(int i=0;i<m;++i){ int a,b; cin>>a>>b; ++N[a] ++N[b] } for(int i=1;i<=n;++i){ cout<<N[i]<<endl; } }
a.cc: In function 'int main()': a.cc:13:17: error: lvalue required as increment operand 13 | ++N[b]
s276942411
p03720
C
#include<iostream> #include<vector> using namespace std; int main(){ int n ,m; cin >> n >> m; vector<int> ans(n); for(int i = 0;i < m;i++){ int a, b; cin >> a >> b; ans[a-1]++; ans[b-1]++; } for(int i = 0;i < n;i++){ cout << ans[i] << endl; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s643713999
p03720
C
#include<iostream> #include<vector> using namespace std; int main(){ int n ,m; cin >> n >> m; vector<int> ans(n); for(int i = 0;i < m;i++){ int a, b; cin >> a >> b; ans[a-1]++; ans[b-1]++; } for(int i = 0;i < n;i++){ cout << ans[i] << endl; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s493080799
p03720
C
c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);}
main.c:1:1: warning: data definition has no type or storage class 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:7: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:67: error: 'n' undeclared (first use in this function) 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^ main.c:1:67: note: each undeclared identifier is reported only once for each function it appears in main.c:1:72: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~~~ main.c:1:72: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:72: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:72: note: include '<stdio.h>' or provide a declaration of 'printf'
s713919616
p03720
C
c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);}
main.c:1:1: warning: data definition has no type or storage class 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:1:5: error: return type defaults to 'int' [-Wimplicit-int] 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~ main.c: In function 'main': main.c:1:5: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:5: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:19: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} main.c:1:19: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~~ main.c:1:19: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:65: error: 'n' undeclared (first use in this function) 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^ main.c:1:65: note: each undeclared identifier is reported only once for each function it appears in main.c:1:70: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^~~~~~ main.c:1:70: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:70: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:70: note: include '<stdio.h>' or provide a declaration of 'printf' main.c: At top level: main.c:1:1: warning: array 'c' assumed to have one element 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^
s303403868
p03720
C
b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);}
main.c:1:1: warning: data definition has no type or storage class 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:19: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} main.c:1:19: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^~~~~ main.c:1:19: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:69: error: 'n' undeclared (first use in this function) 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^ main.c:1:69: note: each undeclared identifier is reported only once for each function it appears in main.c:1:72: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^~~~~~ main.c:1:72: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:72: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:72: note: include '<stdio.h>' or provide a declaration of 'printf' main.c: At top level: main.c:1:3: warning: array 'c' assumed to have one element 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^
s834462318
p03720
C
r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);}
main.c:1:1: warning: data definition has no type or storage class 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:7: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:7: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:19: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} main.c:1:19: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} | ^~~~~ main.c:1:19: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:86: error: 'm' undeclared (first use in this function) 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} | ^ main.c:1:86: note: each undeclared identifier is reported only once for each function it appears in main.c:1:93: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} | ^~~~~~ main.c:1:93: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:93: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:93: note: include '<stdio.h>' or provide a declaration of 'printf'
s243718674
p03720
C
r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);}
main.c:1:1: warning: data definition has no type or storage class 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:7: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:7: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} | ^~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:98: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} | ^~~~~~ main.c:1:98: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:98: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:98: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:113: error: lvalue required as increment operand 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} | ^~
s724559551
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } int e[50]; for(int i=1; i<=a ;i++){ e[i] =0; } for(int j =1; j<=b;j++){ e[c[j]-1] += 1; e[d[j]-1] += 1; } for(int i =1 ;i<=a;j++){ cout << e[i] <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:26: error: 'j' was not declared in this scope 20 | for(int i =1 ;i<=a;j++){ | ^
s995505076
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } int e[50],f[50]; for(int i=1; i<=a ;i++){ int e[i] = 0,f[i] = 0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } cout << e[i]+f[i] <<endl; } }
a.cc: In function 'int main()': a.cc:14:19: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] = 0,f[i] = 0; | ^ a.cc:14:28: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] = 0,f[i] = 0; | ^
s522213479
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } int e[50],f[50]; for(int i=1; i<=a ;i++){ int e[i] =0,f[i] =0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } cout << e[i]+f[i] <<endl; } }
a.cc: In function 'int main()': a.cc:14:18: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] =0,f[i] =0; | ^ a.cc:14:26: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] =0,f[i] =0; | ^
s135268978
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } for(int i=1; i<=a ;i++){ int e[50] ,f[50]; int e[i] =0,f[i] =0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } cout << e[i]+f[i] <<endl; } }
a.cc: In function 'int main()': a.cc:15:9: error: conflicting declaration 'int e [i]' 15 | int e[i] =0,f[i] =0; | ^ a.cc:13:9: note: previous declaration as 'int e [50]' 13 | int e[50] ,f[50]; | ^ a.cc:15:17: error: conflicting declaration 'int f [i]' 15 | int e[i] =0,f[i] =0; | ^ a.cc:13:16: note: previous declaration as 'int f [50]' 13 | int e[50] ,f[50]; | ^
s894159662
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } for(int i=1; i<=a ;i++){ int e[50] = 0; int f[50] = 0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } cout << e[i]+f[i] <<endl; } }
a.cc: In function 'int main()': a.cc:13:17: error: array must be initialized with a brace-enclosed initializer 13 | int e[50] = 0; | ^ a.cc:14:17: error: array must be initialized with a brace-enclosed initializer 14 | int f[50] = 0; | ^
s484149483
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } for(int i=0; i<a ;i++){ int e = 0; for(int j =0; j<b;j++){ if(a[j] == i){ e++; } if(b[j] == i){ e++; } } cout << e <<endl; } }
a.cc: In function 'int main()': a.cc:15:11: error: invalid types 'int[int]' for array subscript 15 | if(a[j] == i){ | ^ a.cc:18:11: error: invalid types 'int[int]' for array subscript 18 | if(b[j] == i){ | ^
s281838796
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,c; int main(){ cin>>a>>b; vector<int>d(a,0); for(int i=0;i<b*2;i++){ cin>>c; d[c-1]++; } for(int i=0;i<a;i++)cout<<a[i]<<endl; }
a.cc: In function 'int main()': a.cc:11:30: error: invalid types 'int[int]' for array subscript 11 | for(int i=0;i<a;i++)cout<<a[i]<<endl; | ^
s700924404
p03720
C++
#include <bits/stdc++.h> using namespace std; int main{ int N, M, a, b, i; cin >> N >> M; vector<int> road(N); for(i=0; i<M; i++){ cin >> a >> b; road.at(a-1)++; road.at(b-1)++; } for (i=0; i<N; i++){ cout << road.at(i) << endl; } }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N, M, a, b, i; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:5: error: 'cin' does not name a type 6 | cin >> N >> M; | ^~~ a.cc:7:20: error: 'N' was not declared in this scope 7 | vector<int> road(N); | ^ a.cc:8:5: error: expected unqualified-id before 'for' 8 | for(i=0; i<M; i++){ | ^~~ a.cc:8:14: error: 'i' does not name a type 8 | for(i=0; i<M; i++){ | ^ a.cc:8:19: error: 'i' does not name a type 8 | for(i=0; i<M; i++){ | ^ a.cc:14:3: error: expected unqualified-id before 'for' 14 | for (i=0; i<N; i++){ | ^~~ a.cc:14:13: error: 'i' does not name a type 14 | for (i=0; i<N; i++){ | ^ a.cc:14:18: error: 'i' does not name a type 14 | for (i=0; i<N; i++){ | ^ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s393606012
p03720
C++
#include <bits/stdc++.h> using namespace std; int main{ int N, M, a, b, i; cin >> N >> M; vector<int> road(N) for(i=0; i<M; i++){ cin >> a >> b; road.at(a-1)++; road.at(b-1)++; } for (i=0; i<N; i++){ cout << road.at(i) << endl; } }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N, M, a, b, i; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:5: error: 'cin' does not name a type 6 | cin >> N >> M; | ^~~ a.cc:7:20: error: 'N' was not declared in this scope 7 | vector<int> road(N) | ^ a.cc:8:5: error: expected ',' or ';' before 'for' 8 | for(i=0; i<M; i++){ | ^~~ a.cc:8:14: error: 'i' does not name a type 8 | for(i=0; i<M; i++){ | ^ a.cc:8:19: error: 'i' does not name a type 8 | for(i=0; i<M; i++){ | ^ a.cc:14:3: error: expected unqualified-id before 'for' 14 | for (i=0; i<N; i++){ | ^~~ a.cc:14:13: error: 'i' does not name a type 14 | for (i=0; i<N; i++){ | ^ a.cc:14:18: error: 'i' does not name a type 14 | for (i=0; i<N; i++){ | ^ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s516341974
p03720
C++
int main(void) { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (inti=0;i<M;++i){ cin >> A[i] >> B[i]; } int road[NMMAX]; for (inti=0;i<N;++i){ road[i] = 0; } for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1; } for (inti=0;i<N;++i){ cout << road[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> N >> M; | ^~~ a.cc:6:6: error: 'inti' was not declared in this scope; did you mean 'int'? 6 | for (inti=0;i<M;++i){ cin >> A[i] >> B[i]; | ^~~~ | int a.cc:6:13: error: 'i' was not declared in this scope 6 | for (inti=0;i<M;++i){ cin >> A[i] >> B[i]; | ^ a.cc:9:6: error: 'inti' was not declared in this scope; did you mean 'int'? 9 | for (inti=0;i<N;++i){ | ^~~~ | int a.cc:9:13: error: 'i' was not declared in this scope 9 | for (inti=0;i<N;++i){ | ^ a.cc:11:6: error: 'inti' was not declared in this scope; did you mean 'int'? 11 | for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1; | ^~~~ | int a.cc:11:13: error: 'i' was not declared in this scope 11 | for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1; | ^ a.cc:13:6: error: 'inti' was not declared in this scope; did you mean 'int'? 13 | for (inti=0;i<N;++i){ cout << road[i] << endl; | ^~~~ | int a.cc:13:13: error: 'i' was not declared in this scope 13 | for (inti=0;i<N;++i){ cout << road[i] << endl; | ^ a.cc:13:23: error: 'cout' was not declared in this scope 13 | for (inti=0;i<N;++i){ cout << road[i] << endl; | ^~~~ a.cc:13:42: error: 'endl' was not declared in this scope 13 | for (inti=0;i<N;++i){ cout << road[i] << endl; | ^~~~
s096446017
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a, b; int vector<int> bridge(n); for(int i=0; i<n; i++){ cin >> a >> b; bridge.at(a) += 1; bridge.at(b) += 1; } for(int i=0; i<n; i++){ cout << bridge.at(i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: invalid declarator before 'bridge' 9 | int vector<int> bridge(n); | ^~~~~~ a.cc:12:5: error: 'bridge' was not declared in this scope 12 | bridge.at(a) += 1; | ^~~~~~ a.cc:17:13: error: 'bridge' was not declared in this scope 17 | cout << bridge.at(i) << endl; | ^~~~~~
s992782093
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; /* vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; c[e-1]++; }*/ for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:13:29: error: 'c' was not declared in this scope 13 | for(int i=0;i<a;i++)cout<<c[i]<<endl; | ^
s393727826
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ // e=d[i]; c[e-1]++; } for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | std::vector<int> | 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>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file
s344534108
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; // vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; // c[e-1]++; } // for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | std::vector<int> | 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>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file
s554740110
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; // vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; // c[e-1]++; } for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | std::vector<int> | 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>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file
s465763791
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; c[e-1]++; } for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | std::vector<int> | 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>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 'std::vector<int>' 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 argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file
s149009596
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> list(2 * m); for (int i = 0; i < 2 * m; i++) cin >> list.at(i); for (int j = 1; j <= n; j++) { int x = 0; for (int k = 0; k < 2 * m; k++) { if (list.at(k) == j) x++; } cout << x << endl; }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s007255293
p03720
C++
#include <bits/stdc++.h> using namespace std; int main( ){ int N,M; cin>>N>>M; vector<int>A(M),B(M); for(int i=0;i<M;i++) { cin>>A.at(i),B.at(i); } for(int i =1;i<N+1;i+=1) { for(int j=1;j<N+1;j+=1) { int countj = 0; if(A.at(i-1)==j || B.at(i-1)==j) { countj +=1; } } } for(int j=1; j<N+1;j+=1) { count<< countj <<endl; } }
a.cc: In function 'int main()': a.cc:8:22: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result] 8 | cin>>A.at(i),B.at(i); | ~~~~^~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1180:7: note: declared here 1180 | at(size_type __n) | ^~ a.cc:19:13: error: 'countj' was not declared in this scope 19 | count<< countj <<endl; | ^~~~~~
s645848064
p03720
C++
#include <bits/stdc++.h> using namespace std; int main( ){ int N,M; cin>>N>>M; vector<int>A(M),B(M); for(int i=0;i<M;i++) { cin>>A.at(i),B.at(i); } for(int i =1;i<N+1;i+=1) { for(int j=1;j<N+1;j+=1) { int count int j = 0 if(A.at(i-1)==j || B.at(i-1)==j) { count j +=1; } } } for(int j=1; j<N+1;j+=1) { count<< countj <<endl; } }
a.cc: In function 'int main()': a.cc:8:22: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result] 8 | cin>>A.at(i),B.at(i); | ~~~~^~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1180:7: note: declared here 1180 | at(size_type __n) | ^~ a.cc:12:17: error: expected initializer before 'int' 12 | int count int j = 0 | ^~~ a.cc:19:13: error: 'countj' was not declared in this scope 19 | count<< countj <<endl; | ^~~~~~