submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s310958138
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 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 'j' 12 | int count j = 0 | ^ a.cc:19:13: error: 'countj' was not declared in this scope 19 | count<< countj <<endl; | ^~~~~~
s902306082
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) { 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 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:7:18: error: expected ';' before ')' token 7 | for(int i=0;i<M) { | ^ | ; 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 'j' 12 | int count j = 0 | ^ a.cc:19:13: error: 'countj' was not declared in this scope 19 | count<< countj <<endl; | ^~~~~~
s637850402
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) { 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 j = 0 if(A.at(i-1)==j || B.at(i-1)==j) { count j +=1; } } } for(int j=0; j<N+1;j+=1) { count<< countj <<endl; } }
a.cc: In function 'int main()': a.cc:7:18: error: expected ';' before ')' token 7 | for(int i=0;i<M) { | ^ | ; 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 'j' 12 | int count j = 0 | ^ a.cc:19:13: error: 'countj' was not declared in this scope 19 | count<< countj <<endl; | ^~~~~~
s312552322
p03720
C++
#include<iostream> using namespace std; int main(void){ int N, M, A, B; cin >> N >> M; int count[N]; for(int i = 0; i < N; i++){ count.at(i) = 0; } for(int i = 0; i < M; i++){ cin >> A >> B; count.at(A)++; count.at(B)++; } for(int i = 0; i < N; i++){ cout << count.at(i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:11: error: request for member 'at' in 'count', which is of non-class type 'int [N]' 11 | count.at(i) = 0; | ^~ a.cc:16:11: error: request for member 'at' in 'count', which is of non-class type 'int [N]' 16 | count.at(A)++; | ^~ a.cc:17:11: error: request for member 'at' in 'count', which is of non-class type 'int [N]' 17 | count.at(B)++; | ^~ a.cc:21:19: error: request for member 'at' in 'count', which is of non-class type 'int [N]' 21 | cout << count.at(i) << endl; | ^~
s451364941
p03720
C++
#include<iostream> using namespace std; int main(void){ int N, M, A, B; vector<int> count; cin >> N >> M; vector<int> count = vector<int>(N, 0); for(int i = 0; i < M; i++){ cin >> A >> B; count.at(A)++; count.at(B)++; } for(int i = 0; i < N; i++){ cout << count.at(i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int> count; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:6:10: error: expected primary-expression before 'int' 6 | vector<int> count; | ^~~ a.cc:10:10: error: expected primary-expression before 'int' 10 | vector<int> count = vector<int>(N, 0); | ^~~ a.cc:14:5: error: 'count' was not declared in this scope 14 | count.at(A)++; | ^~~~~ a.cc:19:13: error: 'count' was not declared in this scope 19 | cout << count.at(i) << endl; | ^~~~~
s618361254
p03720
C++
#include<iostream> using namespace std; int main(void){ int N, M, A, B; int count; cin >> N >> M; vector<int> count = vector<int>(N, 0); for(int i = 0; i < M; i++){ cin >> A >> B; count.at(A)++; count.at(B)++; } for(int i = 0; i < N; i++){ cout << count.at(i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:3: error: 'vector' was not declared in this scope 10 | vector<int> count = vector<int>(N, 0); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:10:10: error: expected primary-expression before 'int' 10 | vector<int> count = vector<int>(N, 0); | ^~~ a.cc:14:11: error: request for member 'at' in 'count', which is of non-class type 'int' 14 | count.at(A)++; | ^~ a.cc:15:11: error: request for member 'at' in 'count', which is of non-class type 'int' 15 | count.at(B)++; | ^~ a.cc:19:19: error: request for member 'at' in 'count', which is of non-class type 'int' 19 | cout << count.at(i) << endl; | ^~
s510570774
p03720
C++
#include<iostream> using namespace std; int main(void){ int N, M, A, B; cin >> N >> M; vector<int> count = vector<int>(N, 0); for(int i = 0; i < M; i++){ cin >> A >> B; count.at(A)++; count.at(B)++; } for(int i = 0; i < N; i++){ cout << count.at(i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<int> count = vector<int>(N, 0); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:9:10: error: expected primary-expression before 'int' 9 | vector<int> count = vector<int>(N, 0); | ^~~ a.cc:13:5: error: 'count' was not declared in this scope 13 | count.at(A)++; | ^~~~~ a.cc:18:13: error: 'count' was not declared in this scope 18 | cout << count.at(i) << endl; | ^~~~~
s568358879
p03720
C++
#include<iostream> using namespace std; int main(void){ 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)++; count.at(B)++; } for(int i = 0; i < N; i++){ cout << count.at(i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<int> count(N, 0); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:9:10: error: expected primary-expression before 'int' 9 | vector<int> count(N, 0); | ^~~ a.cc:13:5: error: 'count' was not declared in this scope 13 | count.at(A)++; | ^~~~~ a.cc:18:13: error: 'count' was not declared in this scope 18 | cout << count.at(i) << endl; | ^~~~~
s537645685
p03720
C++
#include<ioatream> using namespace std; int main(void){ 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)++; count.at(B)++; } for(int i = 0; i < N; i++){ cout << count.at(i) << endl; } return 0; }
a.cc:1:9: fatal error: ioatream: No such file or directory 1 | #include<ioatream> | ^~~~~~~~~~ compilation terminated.
s042464957
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> v(N); int j; 0 < j < N; for(int i = 0;i < M;i++){ int X; cin >> x; if(x = j){ v.at(j)++; } } for(int i = 0;i < M;i++){ cout << v.at(j) << endl; } }
a.cc: In function 'int main()': a.cc:13:12: error: 'x' was not declared in this scope 13 | cin >> x; | ^
s718771362
p03720
C++
#include<bits/stdc++.h> using namespace std; int m, n; int buckets[50]; int main(){ cin>>n>>m; int city[2*m];for(int i=0;i<m;i++)cin>>city[i]>>city[m+i]; for(int i=0;city[i];i++){buckets[city[i]]++;} for(int i=1;i<=n;i++){cout<<buckets[i]<<"\n"}; }
a.cc: In function 'int main()': a.cc:9:47: error: expected ';' before '}' token 9 | for(int i=1;i<=n;i++){cout<<buckets[i]<<"\n"}; | ^ | ;
s783955657
p03720
C++
#include<bits/stdc++.h> using namespace std; int m, n; int buckets[50]; int main(){ cin>>n>>m; int city[2*m];for(int i=0;i<2*m;i++)cin>>city[i]; for(int i=0;city[i];i++){buckets[city[i]]++;} for(int i=0;i<N;i++)cout<<buckets[i]<<endl; }
a.cc: In function 'int main()': a.cc:9:17: error: 'N' was not declared in this scope 9 | for(int i=0;i<N;i++)cout<<buckets[i]<<endl; | ^
s871576381
p03720
C++
#include<bits/stdc++.h> using namespace std; int m, n; int buckets[50]; int main(){ cin>>n>>m; int city[2*m];for(int i=0;i<2*m;i++)cin>>city[i]; for(int i=0;city[i];i++){bucket[city[i]]++;} for(int i=0;i<N;i++)cout<<bucket[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: 'bucket' was not declared in this scope; did you mean 'buckets'? 8 | for(int i=0;city[i];i++){bucket[city[i]]++;} | ^~~~~~ | buckets a.cc:9:17: error: 'N' was not declared in this scope 9 | for(int i=0;i<N;i++)cout<<bucket[i]<<endl; | ^ a.cc:9:29: error: 'bucket' was not declared in this scope; did you mean 'buckets'? 9 | for(int i=0;i<N;i++)cout<<bucket[i]<<endl; | ^~~~~~ | buckets
s875406066
p03720
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N, M; cin >> N >> M; vector<vector<int>> V(N,vector<int>(N,0)); for(int i = 0; i < M; i++){ int a, b; cin >> a >> b; a--, b--; V[a][b]++; V[b][a]++; } for(int i = 0; i < N; i++){ int t = 0; for(int j = 0; j < N; j++){ t += V[i][j] } cout << t << endl; } }
a.cc: In function 'int main()': a.cc:22:19: error: expected ';' before '}' token 22 | t += V[i][j] | ^ | ; 23 | } | ~
s469453483
p03720
C++
#include <isotream> #include <vector> using namespace std; int main(){ int N, M; cin >> N >> M; vector<vector<int>> V(N,vector<int>(N,0)); for(int i = 0; i < M; i++){ int a, b; cin >> a >> b; a--, b--; V[a][b]++; V[b][a]++; } for(int i = 0; i < N; i++){ int t = 0; for(int j = 0; j < N; j++){ t += V[i][j] } cout << t << endl; } }
a.cc:1:10: fatal error: isotream: No such file or directory 1 | #include <isotream> | ^~~~~~~~~~ compilation terminated.
s732954700
p03720
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; signed main(){ int a,b; cin>>a>>b; vector<vector<int>> c(2,vector<int>(b)); rep(i,2){ rep(j,b) cin>>c.at(i).at(j); } for(int i=1;i<=a;i++){ int e=0; rep(i,2){ rep(j,b){ if(c.at(i).at(j)==k) e++; } } cout<<e<<endl; } }
a.cc: In function 'int main()': a.cc:20:25: error: 'k' was not declared in this scope 20 | if(c.at(i).at(j)==k) | ^
s216007985
p03720
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; signed main(){ int a,b; cin>>a>>b; vector<vector<int>> c(2,vector<int>(b)); rep(i,2){ rep(j,b) cin>>c.at(i).at(j); } rep(k,a){ int e=0; rep(i,2){ rep(j,b){ if(a.at(i).at(j)==k) e++; } } cout<<e<<endl; } }
a.cc: In function 'int main()': a.cc:20:12: error: request for member 'at' in 'a', which is of non-class type 'long long int' 20 | if(a.at(i).at(j)==k) | ^~
s763970201
p03720
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; typedef double db; typedef string str; typedef pair<ll, ll> p; constexpr int MOD = 1000000007; using ll = long long; 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; } void print(const std::vector<int> &v) { std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; }); std::cout << std::endl; } int main() { int N, M; cin >> N >> M; vector<int> a(M); vector<int> b(M); vector<vector<int>> edge(M); REP(i, M) { cin >> a[i] >> b[i]; a[i]--; b[i]--; edge[a[i]].push_back(b[i]); edge[b[i]].push_back(a[i]); } REP(i, M) { cout << edge[i].resize() << endl; } return 0; }
a.cc: In function 'int main()': a.cc:47:39: error: no matching function for call to 'std::vector<int>::resize()' 47 | REP(i, M) { cout << edge[i].resize() << endl; } | ~~~~~~~~~~~~~~^~ 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:1013:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' 1013 | resize(size_type __new_size) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:1013:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:1034:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int; value_type = int]' 1034 | resize(size_type __new_size, const value_type& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:1034:7: note: candidate expects 2 arguments, 0 provided
s976936521
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(0) >> vec(1); int count = 0; for(int j = 0; j < N; j++) { if(vec.at(0) == j || vec.at(1) == j) { count ++ ; } cout << count << endl; } } }
a.cc: In function 'int main()': a.cc:10:15: error: no match for call to '(std::vector<int>) (int)' 10 | cin >> vec(0) >> vec(1); | ~~~^~~ a.cc:10:25: error: no match for call to '(std::vector<int>) (int)' 10 | cin >> vec(0) >> vec(1); | ~~~^~~
s472604674
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(0) >> vec(1); int count = 0; for(int j = 0; j < N; j++) { if(vec(0) == j || vec(1) == j) { count ++ ; } cout << count << endl; } } }
a.cc: In function 'int main()': a.cc:10:15: error: no match for call to '(std::vector<int>) (int)' 10 | cin >> vec(0) >> vec(1); | ~~~^~~ a.cc:10:25: error: no match for call to '(std::vector<int>) (int)' 10 | cin >> vec(0) >> vec(1); | ~~~^~~ a.cc:14:13: error: no match for call to '(std::vector<int>) (int)' 14 | if(vec(0) == j || vec(1) == j) { | ~~~^~~ a.cc:14:28: error: no match for call to '(std::vector<int>) (int)' 14 | if(vec(0) == j || vec(1) == j) { | ~~~^~~
s118724496
p03720
C++
#include<iostream> using namespace std; int main(){ int n,m; cin >> n >> m; int c[n]; memset(c,0,n); for(int i=0;i<m;i++){ int a,b; cin >> a >> b; c[a-1] ++; c[b-1] ++; } for(int i=0;i<n;i++){ cout << c[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'memset' was not declared in this scope 8 | memset(c,0,n); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | using namespace std;
s596057007
p03720
C
import java.util.* ; class Main { public static void main(String[] args) { Scanner scan = new Scanner (System.in); int x = scan.nextInt() ; int y = scan.nextInt() ; int a[] = new int[y]; int b[] =new int[y]; for(int i = 0 ; i< y ;i++){ a[i] = scan.nextInt(); b[i] =scan.nextInt() ; } for(int i = 1 ; i<= x ; i++){ int count = 0; for(int j = 0 ; j<y ;j++){ if(a[j] == i || b[j] == i){ count++; } } if(count>0){ System.out.println(count); } } } }
main.c:1:1: error: unknown type name 'import' 1 | import java.util.* ; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.* ; | ^ main.c:2:1: error: unknown type name 'class' 2 | class Main { | ^~~~~ main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 2 | class Main { | ^
s074540199
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, i; cin >> N >> M; vector<int> count(N, 0); for (i = 0; i < M; i++) { int a, b; cin >> a >> b; if (i == a || i == b) { count.at(i)++; } } for (i = 0; i < N; i++) { cout << count.at(i); } }
a.cc: In function 'int main()': a.cc:6:15: error: 'M' was not declared in this scope 6 | cin >> N >> M; | ^
s042278362
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N >> M; vector<int> count(N, 0); for (i = 0; i < M; i++) { int a, b; cin >> a >> b; if (i == a || i == b) { count.at(i)++; } } for (i = 0; i < N; i++) { cout << count.at(i); } }
a.cc: In function 'int main()': a.cc:6:15: error: 'M' was not declared in this scope 6 | cin >> N >> M; | ^ a.cc:10:8: error: 'i' was not declared in this scope 10 | for (i = 0; i < M; i++) { | ^ a.cc:19:8: error: 'i' was not declared in this scope 19 | for (i = 0; i < N; i++) { | ^
s621736040
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; // 都市の数 int M; // 道の数 vector<int> road(N); // 都市Nに接続している道の数 vector<int> city(2); // ある道がつなぐ2都市 cin >> N >> M; int i,j,k; //カウンタ変数 for (i=0; i<M; i++) { cin >> city.at(0) >> city.at(1); for (j=0; j<N; j++){ if(city.at(0)==N){ road.at(N) ++; } if(city.at(1)==N){ road.at(N) ++; } } } for (k=0; k<N; k++) { cin >> road.at(k) >> endl; } }
a.cc: In function 'int main()': a.cc:27:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 27 | cin >> road.at(k) >> endl; | ~~~~~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1
s771286185
p03720
C
#include<stdio.h> int main(){ int a[50],b[50],n,m,ans[50]; for(int i=1; i<=50; i++){ ans[i]=0; } scanf("%d%d",&n, &m); for(i=1; i<m; i++){ scanf("%d%d", &a[i],&b[i]); ans[a[i]]++; ans[b[i]]++; } for(i=1; i<=n; i++){ printf("%d\n",ans[i]); } return 0; }
main.c: In function 'main': main.c:10:7: error: 'i' undeclared (first use in this function) 10 | for(i=1; i<m; i++){ | ^ main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
s365872734
p03720
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, n) for (int i = n; i > 0; i--) #define rep3(i, s, e) for (int i = (s); i < (int)(e); i++) #define rep4(i, s, e) for (int i = (e); i < (int)(s); i--) int main() { int n, m; int a, b; cin >> n >> m; vector<int> road_num(n, 0); rep(i, m){ cin >> a >> b; road_num.at(a - 1)++; } rep(i, n){ cout << road_num(i) << endl; } }
a.cc: In function 'int main()': a.cc:21:25: error: no match for call to '(std::vector<int>) (int&)' 21 | cout << road_num(i) << endl; | ~~~~~~~~^~~
s097702249
p03720
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <iomanip> #include <string> #include <sstream> #include <list> //#include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; /* int cmp(shi a,shi b) { return a.x<b.x; } long long cmd(long long a, long long b) { return a > b; }*/ int cmd(int a, int b) { return a>b; } int loda[n+1][n+1]={0}; int main() { int n,m; cin >>n>>m; for(int i=1;i<=m;i++){ int a, b; cin >>a >>b; loda[a][b]++; loda[b][a]++; }int sum=0; for(int i=1;i<=n;i++){ sum=0; for(int j=1;j<=n;j++){ if(loda[i][j]) sum += loda[i][j]; } cout<<sum<<endl; } return 0; }
a.cc:27:10: error: 'n' was not declared in this scope; did you mean 'yn'? 27 | int loda[n+1][n+1]={0}; | ^ | yn a.cc:27:15: error: 'n' was not declared in this scope; did you mean 'yn'? 27 | int loda[n+1][n+1]={0}; | ^ | yn a.cc: In function 'int main()': a.cc:36:9: error: 'loda' was not declared in this scope 36 | loda[a][b]++; | ^~~~ a.cc:42:16: error: 'loda' was not declared in this scope 42 | if(loda[i][j]) | ^~~~
s804094491
p03720
C++
#include"bits/stdc++.h" using namespace std; int main(){ int N,M; cin>>N>>M; vector<int> S(M); int X,Y; for(int i=0;i<M){ cin >> X >> Y >> endl; }
a.cc: In function 'int main()': a.cc:8:18: error: expected ';' before ')' token 8 | for(int i=0;i<M){ | ^ | ; a.cc:9:19: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 9 | cin >> X >> Y >> endl; | ~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__str
s636354586
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, a, b, x[50] = {} cin >> n >> m; rep(i, m) { cin >> a >> b; x[a]++; x[b]++; } rep(i, n) cout << x[i] << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: expected ',' or ';' before 'cin' 7 | cin >> n >> m; | ^~~
s589274298
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N>> M; // N要素の配列 // 入力処理 for (int i = 0; i < N; i++) { int sum=0; for (int j = 0; j < M; j++) { vector<int> A(2); cin >> A.at(0)>>A.at(1); if(i+1==A.at(0) || i+1==A.at(1)) sum+=1; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s961268007
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 j = 0 ; j < N ; j++){ int sum = 0; for(int k = 0 ; k < 2M ; k++ ){ if(vec.at(k) == j){ sum += 1; } } 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:23: error: unable to find numeric literal operator 'operator""M' 10 | for(int i = 0 ; i < 2M ; i++){ | ^~ a.cc:16:25: error: unable to find numeric literal operator 'operator""M' 16 | for(int k = 0 ; k < 2M ; k++ ){ | ^~
s647005992
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; int jk=0; vector<int>vec(m*2); for(int i=0;i <m*2;i++){ cin >> vec.at(i); } for(int a=0;a < n;a++){ for(int i =0;i < vec.size();i++){ if(vec.at(i) == a){ jk++; } } cout << jk << endl; jk = 0; }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s345166117
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; vector<int> D(N); vector<int> A(2); for(int i=0;i<M;i++){ cin>>A.at(o)>>A.at(1); D.at(A.at(0))++; D.at(A.at(1))++; } for(int i=0;i<N;i++){ cout<<.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:10:15: error: 'o' was not declared in this scope 10 | cin>>A.at(o)>>A.at(1); | ^ a.cc:15:11: error: expected primary-expression before '.' token 15 | cout<<.at(i)<<endl; | ^
s224900358
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; vector<int> D(N); vector<int> A(2); for(int i=0;i<M;i++){ cin>>A.at(o)>>A.at(1); D.at(A.at(0))++; D.at(A.at(1))++; } for(iny i=0;i<N;i++){ cout<<.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:10:15: error: 'o' was not declared in this scope 10 | cin>>A.at(o)>>A.at(1); | ^ a.cc:14:7: error: 'iny' was not declared in this scope; did you mean 'int'? 14 | for(iny i=0;i<N;i++){ | ^~~ | int a.cc:14:15: error: 'i' was not declared in this scope 14 | for(iny i=0;i<N;i++){ | ^ a.cc:15:11: error: expected primary-expression before '.' token 15 | cout<<.at(i)<<endl; | ^
s010417681
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(ans.at(j)==a||ans.at(j)==a) ans.at(j)++; } } for(int i=0;i<N;i++) cout << ans.at(i) << endl; }
a.cc: In function 'int main()': a.cc:5:9: error: expected initializer before 'M' 5 | int N M; | ^ a.cc:6:10: error: 'N' was not declared in this scope 6 | cin >> N >> M; | ^ a.cc:6:15: error: 'M' was not declared in this scope 6 | cin >> N >> M; | ^
s146280864
p03720
C++
#include <iostream> #include <vector> using namespace std; int main() { int n,m; cin>>n>>m; vector<int>v[n+2]; for(int i=0;i<m;i++) { int x,y; cin>>x>>y; v[x].push_back(y); v[y].push_back(x); } for(int i=1;i<n+1;i++)cout<<v[i].size();<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:45: error: expected primary-expression before '<<' token 15 | for(int i=1;i<n+1;i++)cout<<v[i].size();<<endl; | ^~
s732966837
p03720
C++
// In His Name #include <Bits/stdc++.h> #define pb push_back #define F first #define S second #define ll long long #define gcd __gcd using namespace std; typedef pair<int, int> pii; const int MAX = 100; int n, m, deg[MAX]; int main(){ ios_base::sync_with_stdio(0); cin >> n >> m; for (int i = 0 ; i < m ; i++){ int u, v; cin >> u >> v; deg[u]++; deg[v]++; } for (int i = 1 ; i <= n ; i++) cout << deg[i] << endl; }
a.cc:3:10: fatal error: Bits/stdc++.h: No such file or directory 3 | #include <Bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s505590516
p03720
C++
// In His Name #include <Bits/stdc++.h> #define pb push_back #define F first #define S second #define ll long long #define gcd __gcd using namespace std; typedef pair<int, int> pii; const int MAX = 100; int n, m, deg[MAX]; int main(){ ios_base::sync_with_stdio(0); cin >> n >> m; for (int i = 0 ; i < m ; i++){ int u, v; cin >> u >> v; deg[u]++; deg[v]++; } for (int i = 1 ; i <= n ; i++) cout << deg[i] << endl; }
a.cc:3:10: fatal error: Bits/stdc++.h: No such file or directory 3 | #include <Bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s882544834
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; int a[M*2]; for(int i=0;i<M*2; ++i) cin >> a[i]; int tmp = {0}; for(int i=0;i<M*2;++i) { tmp[a[i]]++; } for(int i=1;i<=N;++i) { cout << tmp[i] << endl; } }
a.cc: In function 'int main()': a.cc:11:12: error: invalid types 'int[int]' for array subscript 11 | tmp[a[i]]++; | ^ a.cc:14:20: error: invalid types 'int[int]' for array subscript 14 | cout << tmp[i] << endl; | ^
s264566569
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, a; cin >> n >> m; vector<int> x(n); for(i = 0; i < 2 * m; i++){ cin >> a; x.at(a - 1)++; } printf(x); }
a.cc: In function 'int main()': a.cc:14:10: error: cannot convert 'std::vector<int>' to 'const char*' 14 | printf(x); | ^ | | | std::vector<int> In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s747470247
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, a; cin >> n >> m; vector<int> x(n); for(i = 0; i < 2 * m; i++){ cin >> a; x.at(a - 1)++; } print(x); }
a.cc: In function 'int main()': a.cc:14:3: error: 'print' was not declared in this scope; did you mean 'rint'? 14 | print(x); | ^~~~~ | rint
s004278388
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,m,sub; cin >> n >> m; vector<int> t(n); for(int i = 0; i < m; i++){ cin >> sub; t(sub - 1)++; cin >> sub; t(sub - 1)++; } for(int i = 0; i < n; i++){ cout << t(i) << endl; } }
a.cc: In function 'int main()': a.cc:10:6: error: no match for call to '(std::vector<int>) (int)' 10 | t(sub - 1)++; | ~^~~~~~~~~ a.cc:12:6: error: no match for call to '(std::vector<int>) (int)' 12 | t(sub - 1)++; | ~^~~~~~~~~ a.cc:15:14: error: no match for call to '(std::vector<int>) (int&)' 15 | cout << t(i) << endl; | ~^~~
s072032877
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int M,N; int i; cin >> N >> M; vector<int> a(M); vector<int> b(M); for(i=0; i<M; i++){ cin >> a.at(i); cin >> b.at(i); } int count; for(i=0; i<M; i++){ if(a.at(i)==i+1) count++; if(b.at(i)==i+1) count++; cout << count << endl; count=0 } }
a.cc: In function 'int main()': a.cc:22:12: error: expected ';' before '}' token 22 | count=0 | ^ | ; 23 | } | ~
s656874737
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int M,N; cin >> N >> M; vector<int> a(M); vector<int> b(M); for(i=0; i<M; i++){ cin >> a.at(i); cin >> b.at(i); } int count; for(i=0; i<M; i++){ if(a.at(i)==i+1) count++; if(b.at(i)==i+1) count++; cout << count << endl; count=0 } }
a.cc: In function 'int main()': a.cc:10:7: error: 'i' was not declared in this scope 10 | for(i=0; i<M; i++){ | ^ a.cc:15:7: error: 'i' was not declared in this scope 15 | for(i=0; i<M; i++){ | ^ a.cc:21:12: error: expected ';' before '}' token 21 | count=0 | ^ | ; 22 | } | ~
s676790444
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; const int NMAMX = 50; int A[NMMAX], B[NMMAX]; for (int i = 0; i < M; ++i) { cin >> A[i] >> B[i]; } int road[NMMAX]; for (int i = 0; i < N; ++i) { road[i] = 0; } for (int i = 0; i < M; ++i) { road[A[i] - 1]++; road[B[i] - 1]++; } for (int i = 0; i < N; ++i) { cout << road[i] << endl; } }
a.cc: In function 'int main()': a.cc:9:9: error: 'NMMAX' was not declared in this scope; did you mean 'NMAMX'? 9 | int A[NMMAX], B[NMMAX]; | ^~~~~ | NMAMX a.cc:12:12: error: 'A' was not declared in this scope 12 | cin >> A[i] >> B[i]; | ^ a.cc:12:20: error: 'B' was not declared in this scope 12 | cin >> A[i] >> B[i]; | ^ a.cc:17:5: error: 'road' was not declared in this scope; did you mean 'read'? 17 | road[i] = 0; | ^~~~ | read a.cc:21:5: error: 'road' was not declared in this scope; did you mean 'read'? 21 | road[A[i] - 1]++; | ^~~~ | read a.cc:21:10: error: 'A' was not declared in this scope 21 | road[A[i] - 1]++; | ^ a.cc:22:10: error: 'B' was not declared in this scope 22 | road[B[i] - 1]++; | ^ a.cc:26:13: error: 'road' was not declared in this scope; did you mean 'read'? 26 | cout << road[i] << endl; | ^~~~ | read
s372251748
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; int a[N]={}; for(int i=0;i<M;i++){ int a,b; cin >> a >> b; a[a]++; a[b]++; } for(int i=0;i<N;i++){ cout << a[i] << endl; } }
a.cc: In function 'int main()': a.cc:11:6: error: invalid types 'int[int]' for array subscript 11 | a[a]++; | ^ a.cc:12:6: error: invalid types 'int[int]' for array subscript 12 | a[b]++; | ^
s986283395
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vector<vector<int>> city(m, vector(2)); for(int i=0; i<m; i++){ for(int j=0; j<2; j++){ cin >> city.at(i).at(j); } } vector<int> num(n) = {0}; for (int i=0; i<m; i++){ for (int j=0; j<2; j++){ num.at(city.at(i).at(j)-1)++; } } for (int i=0; i<n; i++){ cout << num.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:8:39: error: class template argument deduction failed: 8 | vector<vector<int>> city(m, vector(2)); | ^ a.cc:8:39: error: no matching function for call to 'vector(int)' 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:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:7: note: template argument deduction/substitution failed: a.cc:8:39: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 8 | vector<vector<int>> city(m, vector(2)); | ^ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: template argument deduction/substitution failed: a.cc:8:39: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> city(m, vector(2)); | ^ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: template argument deduction/substitution failed: a.cc:8:39: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> city(m, vector(2)); | ^ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: template argument deduction/substitution failed: a.cc:8:39: note: couldn't deduce template parameter '_Tp' 8 | vector<vector<int>> city(m, vector(2)); | ^ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: template argument deduction/substitution failed: a.cc:8:39: note: couldn't deduce template parameter '_Tp' 8 | vector<vector<int>> city(m, vector(2)); | ^ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:428:11: note: template argument deduction/substitution failed: a.cc:8:39: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int' 8 | vector<vector<int>> city(m, vector(2)); | ^ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>' 2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 1 provided a.cc:15:22: error: expected ',' or ';' before '=' token 15 | vector<int> num(n) = {0}; | ^
s096180879
p03720
C++
#include <iostream> using namespace std; int a[51] int main(){ int n,m;cin>>n>>m; for(int i = 0; m > i; i++){ int c,d;cin>>c>>d; a[c-1]++; a[d-1]++; } for(int i = 0; m > i; i++){ cout << a[i] << endl; } }
a.cc:4:1: error: expected initializer before 'int' 4 | int main(){ | ^~~
s403425851
p03720
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; //都市の数,Nを定義 int M; //道路の数,Mを定義 cin >> N >> M; //N,Mの順で標準入力 vector <int> num(N); for (int i = 0; i < M; i++){ int Na; //他の都市Na int Nb; //他の都市Nb //それぞれの都市が他の都市に繋がる道路を何本もっているか保持する配列(Num)を用意する cin >> Na >> Nb; //道路の本数分入力を受け取る num [Na-1]++; num [Nb-1]++; //受け取った入力の道路に繋がっている都市の配列(Num)へカウント+1する } for (int i = 0; i < num.length(); i++){ cout << num[i] << endl; //Numの要素を書き出す } }
a.cc: In function 'int main()': a.cc:26:29: error: 'class std::vector<int>' has no member named 'length' 26 | for (int i = 0; i < num.length(); i++){ | ^~~~~~
s916613768
p03720
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; //都市の数,Nを定義 int M; //道路の数,Mを定義 cin >> N >> M; //N,Mの順で標準入力 vector <int> num(N); for (int i = 0; i < M; i++){ int Na; //他の都市Na int Nb; //他の都市Nb //それぞれの都市が他の都市に繋がる道路を何本もっているか保持する配列(Num)を用意する cin >> Na >> Nb; //道路の本数分入力を受け取る num [Na-1]++; num [Mb-1]++; //受け取った入力の道路に繋がっている都市の配列(Num)へカウント+1する } for (int i = 0; i < num.length(); i++){ cout << num[i] << endl; //Numの要素を書き出す } }
a.cc: In function 'int main()': a.cc:23:14: error: 'Mb' was not declared in this scope; did you mean 'Nb'? 23 | num [Mb-1]++; | ^~ | Nb a.cc:26:29: error: 'class std::vector<int>' has no member named 'length' 26 | for (int i = 0; i < num.length(); i++){ | ^~~~~~
s860671515
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> city(N); for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; ++city.at(a - 1); ++city.at(b - 1); } cor (int i = 0; i < N; i++) { cout << city.at(i) << endl; }
a.cc: In function 'int main()': a.cc:18:8: error: expected primary-expression before 'int' 18 | cor (int i = 0; i < N; i++) { | ^~~ a.cc:18:19: error: 'i' was not declared in this scope 18 | cor (int i = 0; i < N; i++) { | ^ a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s604674756
p03720
C++
#include<iostream> using namespace::std; int main(){ int n,m; cin>>n>>m; vector<int> v[n+5]; for(int i=0,l,r;i<m;i++) cin>>l>>r,v[l].push_back(r),v[r].push_back(l); for(int i=1;i<=n;i++) cout<<v[i].size()<<'\n'; }
a.cc: In function 'int main()': a.cc:8:3: error: 'vector' was not declared in this scope 8 | vector<int> v[n+5]; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | a.cc:8:10: error: expected primary-expression before 'int' 8 | vector<int> v[n+5]; | ^~~ a.cc:11:15: error: 'v' was not declared in this scope 11 | cin>>l>>r,v[l].push_back(r),v[r].push_back(l); | ^ a.cc:14:11: error: 'v' was not declared in this scope 14 | cout<<v[i].size()<<'\n'; | ^
s495413253
p03720
C++
int main() { int N, M; cin >> N >> M; vector<int> vec(M*2); for(int i = 0; i < M*2; i++){ int c; cin >> c; vec.at(i) = c; } vector<int> veca(M); for(int i = 0; i< M; i++){ veca.at(i) = vec.at(i*2); } vector<int> vecb(M); for(int i = 0; i< M; i++){ vecb.at(i) = vec.at(i*2 + 1); } for(int j = 0; j < N; j++){ int c = 0; int d = 0; for(int i = 0; i < M; i++){ if(veca.at(i) == j + 1 ){ c++; } if(vecb.at(i) == j + 1 ){ d++; } } cout << c + d << endl; } }
a.cc: In function 'int main()': a.cc:4:3: error: 'cin' was not declared in this scope 4 | cin >> N >> M; | ^~~ a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int> vec(M*2); | ^~~~~~ a.cc:6:10: error: expected primary-expression before 'int' 6 | vector<int> vec(M*2); | ^~~ a.cc:11:3: error: 'vec' was not declared in this scope 11 | vec.at(i) = c; | ^~~ a.cc:16:10: error: expected primary-expression before 'int' 16 | vector<int> veca(M); | ^~~ a.cc:19:5: error: 'veca' was not declared in this scope 19 | veca.at(i) = vec.at(i*2); | ^~~~ a.cc:19:18: error: 'vec' was not declared in this scope 19 | veca.at(i) = vec.at(i*2); | ^~~ a.cc:24:12: error: expected primary-expression before 'int' 24 | vector<int> vecb(M); | ^~~ a.cc:27:5: error: 'vecb' was not declared in this scope 27 | vecb.at(i) = vec.at(i*2 + 1); | ^~~~ a.cc:27:18: error: 'vec' was not declared in this scope 27 | vecb.at(i) = vec.at(i*2 + 1); | ^~~ a.cc:37:10: error: 'veca' was not declared in this scope 37 | if(veca.at(i) == j + 1 ){ | ^~~~ a.cc:40:10: error: 'vecb' was not declared in this scope 40 | if(vecb.at(i) == j + 1 ){ | ^~~~ a.cc:44:5: error: 'cout' was not declared in this scope 44 | cout << c + d << endl; | ^~~~ a.cc:44:22: error: 'endl' was not declared in this scope 44 | cout << c + d << endl; | ^~~~
s642831067
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); vector<int>ans(N); for(int i=0;i<M;i++){ cin>>a.at(i)>>b.at(i); for(int j==0;j<N;j++){ if(a.at(i)==j+1){ ans.at(j)++; } } for(int k=0;k<N;k++){ if(b.at(i)==k+1){ ans.at(k)++; } } } } for(int i=0;i<N;i++){ cout<<ans.at(i)+1<<endl; } }
a.cc: In function 'int main()': a.cc:12:14: error: expected ';' before '==' token 12 | for(int j==0;j<N;j++){ | ^~ | ; a.cc:12:14: error: expected primary-expression before '==' token 12 | for(int j==0;j<N;j++){ | ^~ a.cc:12:21: error: expected ')' before ';' token 12 | for(int j==0;j<N;j++){ | ~ ^ | ) a.cc:12:22: error: 'j' was not declared in this scope 12 | for(int j==0;j<N;j++){ | ^ a.cc: At global scope: a.cc:25:1: error: expected unqualified-id before 'for' 25 | for(int i=0;i<N;i++){ | ^~~ a.cc:25:13: error: 'i' does not name a type 25 | for(int i=0;i<N;i++){ | ^ a.cc:25:17: error: 'i' does not name a type 25 | for(int i=0;i<N;i++){ | ^ a.cc:28:1: error: expected declaration before '}' token 28 | } | ^
s384958186
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int aab; cin >> a >> b; vector<int> A(2*b); for (int i=1;i<=a;i++) { int c=0; for(int j=0;j<2*b;j++) { cin >> A[j]; if (A[j]==i) c++; } cout << c << endl; } }
a.cc: In function 'int main()': a.cc:5:10: error: 'a' was not declared in this scope 5 | cin >> a >> b; | ^ a.cc:5:15: error: 'b' was not declared in this scope 5 | cin >> a >> b; | ^
s042358100
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int a、b; cin >> a >> b; vector<int> A(2*b); for (int i=1;i<=a;i++) { int c=0; for(int j=0;j<2*b;j++) { cin >> A[j]; if (A[j]==i) c++; } cout << c << endl; } }
a.cc:4:7: error: extended character 、 is not valid in an identifier 4 | int a、b; | ^ a.cc: In function 'int main()': a.cc:5:10: error: 'a' was not declared in this scope 5 | cin >> a >> b; | ^ a.cc:5:15: error: 'b' was not declared in this scope 5 | cin >> a >> b; | ^
s243023137
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n、m; cin >> n >> m; int a[2*m]; for (int i=1;i<=n;i++) { int c=0; for(int j=0;j<2*m;j++) { cin >> a[j]; if (a[j]==i) c++; } cout << c << endl; } }
a.cc:4:7: error: extended character 、 is not valid in an identifier 4 | int n、m; | ^ a.cc: In function 'int main()': a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | cin >> n >> m; | ^ | yn a.cc:5:15: error: 'm' was not declared in this scope; did you mean 'tm'? 5 | cin >> n >> m; | ^ | tm a.cc:10:14: error: 'a' was not declared in this scope 10 | cin >> a[j]; | ^
s282156348
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n、m; cin >> n >> m; int a[2*m]; for (int i=0;i<=n;i++) { int c=0 for(int j=0;j<2*m;j++) { cin >> a; if (a[j]==i) c++; } cout << c << endl; } }
a.cc:4:7: error: extended character 、 is not valid in an identifier 4 | int n、m; | ^ a.cc: In function 'int main()': a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | cin >> n >> m; | ^ | yn a.cc:5:15: error: 'm' was not declared in this scope; did you mean 'tm'? 5 | cin >> n >> m; | ^ | tm a.cc:9:5: error: expected ',' or ';' before 'for' 9 | for(int j=0;j<2*m;j++) { | ^~~ a.cc:9:17: error: 'j' was not declared in this scope 9 | for(int j=0;j<2*m;j++) { | ^
s226779121
p03720
C++
#include <iostream> #include <vector> using namespace std; int main() { int n、m; cin >> n >> m; vector<int> a(2*m); for (int i=0;i<m;i++) { int c=0 for(int j=0;j<2*m;j++) { cin >> a; if (a.at(j)==i) c++; } cout << c << endl; } }
a.cc:5:7: error: extended character 、 is not valid in an identifier 5 | int n、m; cin >> n >> m; | ^ a.cc: In function 'int main()': a.cc:5:20: error: 'n' was not declared in this scope 5 | int n、m; cin >> n >> m; | ^ a.cc:5:25: error: 'm' was not declared in this scope; did you mean 'tm'? 5 | int n、m; cin >> n >> m; | ^ | tm a.cc:9:5: error: expected ',' or ';' before 'for' 9 | for(int j=0;j<2*m;j++) { | ^~~ a.cc:9:17: error: 'j' was not declared in this scope 9 | for(int j=0;j<2*m;j++) { | ^
s226002053
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> A(2*M); for(int i=0;i<2*M;i++){ cin >> A.at(i); } vector<int> B(N); for(int i=1;i<N+1;i++){ int count=0; for(int j=0;j<N;j++){ if(A.at(j)==i){ count++ } } B.at(i-1)=count; } }
a.cc: In function 'int main()': a.cc:15:16: error: expected ';' before '}' token 15 | count++ | ^ | ; 16 | } | ~
s494596438
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M;cin>>N>>M; int a; vector<int> t(N); for(int i=0;i<2*M;i++){ cin>>a; for(int j=0;k<N;j++){ if(j==a){ t.at(j)++; break; } } } for(int i=0;i<N;i++)cout<<t.at(i)<<endl; }
a.cc: In function 'int main()': a.cc:9:17: error: 'k' was not declared in this scope 9 | for(int j=0;k<N;j++){ | ^
s370574201
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M;cin>>N>>M; int a; ventor<int> t(N); for(int i=0;i<M;i++){ cin>>a; for(int j=0;k<N;j++){ if(j==a){ t.at(j)++; break; } } } for(int i=0;i<N;i++)cout<<t.at(i)<<endl; }
a.cc: In function 'int main()': a.cc:6:3: error: 'ventor' was not declared in this scope 6 | ventor<int> t(N); | ^~~~~~ a.cc:6:10: error: expected primary-expression before 'int' 6 | ventor<int> t(N); | ^~~ a.cc:9:17: error: 'k' was not declared in this scope 9 | for(int j=0;k<N;j++){ | ^ a.cc:11:9: error: 't' was not declared in this scope 11 | t.at(j)++; | ^ a.cc:16:29: error: 't' was not declared in this scope 16 | for(int i=0;i<N;i++)cout<<t.at(i)<<endl; | ^
s885285368
p03720
C++
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <cstdlib> #include <cmath> #include <numeric> #include <tuple> #include <stack> #define rep(i,n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define print(s) cout << s << endl typedef long long ll; using namespace std; int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } int main() { int n,m; cin >> n >> m; vector<int> a(m), b(m); rep(i,m) cin >> a[i] >> b[i]; sort(all(a)); sort(all(b)); rep(i,n){ int count = 0; rep(j,n){ if (a[j] == i+1){ count++ } if (b[j] == i+1){ count++ } } cout << count << endl; } }
a.cc: In function 'int main()': a.cc:35:40: error: expected ';' before '}' token 35 | count++ | ^ | ; 36 | } | ~ a.cc:38:40: error: expected ';' before '}' token 38 | count++ | ^ | ; 39 | } | ~
s210562535
p03720
C++
#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; int c[n]; for(int i=0;i<m*2;i++){ int a; cin>>a; c[a-1]++; } for(int j=0;j<n;j++) cout<<c[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:32: error: 'i' was not declared in this scope 15 | for(int j=0;j<n;j++) cout<<c[i]<<endl; | ^
s228626692
p03720
C++
#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; int c[n]; for(int i=0;i<m*2;i++){ int a; cin>>a; s[a-1]++; } for(int j=0;j<n;j++) cout<<c[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 's' was not declared in this scope 12 | s[a-1]++; | ^ a.cc:15:32: error: 'i' was not declared in this scope 15 | for(int j=0;j<n;j++) cout<<c[i]<<endl; | ^
s386908788
p03720
C++
#include<iostream> using namespace std; int main(){ int n,m; cin>>n>>m; int c[n]; for(int i=0;i<m*2;i++){ int a; cin>>a; s[a-1]++; } for(int j=0;j<n;j++) cout<<s[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 's' was not declared in this scope 12 | s[a-1]++; | ^ a.cc:15:30: error: 's' was not declared in this scope 15 | for(int j=0;j<n;j++) cout<<s[i]<<endl; | ^ a.cc:15:32: error: 'i' was not declared in this scope 15 | for(int j=0;j<n;j++) cout<<s[i]<<endl; | ^
s232787542
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> L(2M); for(int i=0; i<M; i++) { cin >> L[2i] >> L[2i+1]; } for(int i=1; i<=N; i++) { int X=0; for(int j=0; j<M; j++) { if(L[2j] == i || L[2j+1] == i) { X++; } } cout << X << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: unable to find numeric literal operator 'operator""M' 7 | vector<int> L(2M); | ^~ a.cc:9:13: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'std::complex<double>') 9 | cin >> L[2i] >> L[2i+1]; | ^ 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:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]' 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1128:28: note: no known conversion for argument 1 from 'std::complex<double>' to 'std::vector<int>::size_type' {aka 'long unsigned int'} 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]' 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1147:28: note: no known conversion for argument 1 from 'std::complex<double>' to 'std::vector<int>::size_type' {aka 'long unsigned int'} 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ a.cc:9:25: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 9 | cin >> L[2i] >> L[2i+1]; | ~~^~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:9:26: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:9:26: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 9 | cin >> L[2i] >> L[2i+1]; | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:9:26: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:9:26: note: mismatched types 'const _CharT*' and 'std::complex<double>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:9:26: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:9:26: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:9:26: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:9:26: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:9:26: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:9:26: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:9:26: note: mismatched types 'const _CharT*' and 'std::complex<double>' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:9:26: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 9 | cin >> L[2i] >> L[2i+1]; | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: '
s967186884
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int n[50], m[50]; for(int i = 0; i < m; i++) { cin >> a[i] >> b[i]; } int road[50]; for(int i = 0; i < n; i++) { road[i] = 0; } for(int i = 0; i < m; i++) { road[a[i] - 1] = 1; road[b[i] - 1] = 1; } for(int i = 0; i < n; i++) { cout << road[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: conflicting declaration 'int n [50]' 7 | int n[50], m[50]; | ^ a.cc:5:7: note: previous declaration as 'int n' 5 | int n, m; | ^ a.cc:7:14: error: conflicting declaration 'int m [50]' 7 | int n[50], m[50]; | ^ a.cc:5:10: note: previous declaration as 'int m' 5 | int n, m; | ^ a.cc:9:12: error: 'a' was not declared in this scope 9 | cin >> a[i] >> b[i]; | ^ a.cc:9:20: error: 'b' was not declared in this scope 9 | cin >> a[i] >> b[i]; | ^ a.cc:16:10: error: 'a' was not declared in this scope 16 | road[a[i] - 1] = 1; | ^ a.cc:17:10: error: 'b' was not declared in this scope 17 | road[b[i] - 1] = 1; | ^
s700602614
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> num(N); for (int i=0; i<M; i++) { cin >> a >> b; num[a-1]++; num[b-1]++; } for (int i=0; i<N; i++) { cout << num[i] << endl; } }
a.cc: In function 'int main()': a.cc:9:12: error: 'a' was not declared in this scope 9 | cin >> a >> b; | ^ a.cc:9:17: error: 'b' was not declared in this scope 9 | cin >> a >> b; | ^
s856279903
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; int i; int path; cin >> N >> M; vector<int> town(N,0); for(i=0;i<M;i++){ cin >> path; town.at(path) += 1; cin >> path; town.at(path) += 1; } for(i=0;i<N;i++){ cout << town.at(i); } } }
a.cc:30:1: error: expected declaration before '}' token 30 | } | ^
s998540556
p03720
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> #include <cstdalign> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <typeindex> #include <type_traits> #include <unordered_map> #include <unordered_set> #endif #define y0 qvya13579 #define y1 qvyb24680 #define j0 qvja13579 #define j1 qvjb24680 #define next qvne13579xt #define prev qvpr13579ev #define INF 1000000007 #define MOD 1000000007 #define PI acos(-1.0) #define endl "\n" #define IOS cin.tie(0);ios::sync_with_stdio(false) #define M_P make_pair #define PU_B push_back #define PU_F push_front #define PO_B pop_back #define PO_F pop_front #define U_B upper_bound #define L_B lower_bound #define B_S binary_search #define PR_Q priority_queue #define FIR first #define SEC second #if __cplusplus < 201103L #define stoi(argument_string) atoi((argument_string).c_str()) #endif #define REP(i,n) for(int i=0;i<(int)(n);++i) #define REP_R(i,n) for(int i=((int)(n)-1);i>=0;--i) #define FOR(i,m,n) for(int i=((int)(m));i<(int)(n);++i) #define FOR_R(i,m,n) for(int i=((int)(m)-1);i>=(int)(n);--i) #define ALL(v) (v).begin(),(v).end() #define RALL(v) (v).rbegin(),(v).rend() #define SIZ(x) ((int)(x).size()) #define COUT(x) cout<<(x)<<endl #define CIN(x) cin>>(x) #define CIN2(x,y) cin>>(x)>>(y) #define CIN3(x,y,z) cin>>(x)>>(y)>>(z) #define CIN4(x,y,z,w) cin>>(x)>>(y)>>(z)>>(w) #define SCAND(x) scanf("%d",&(x)) #define SCAND2(x,y) scanf("%d%d",&(x),&(y)) #define SCAND3(x,y,z) scanf("%d%d%d",&(x),&(y),&(z)) #define SCAND4(x,y,z,w) scanf("%d%d%d%d",&(x),&(y),&(z),&(w)) #define SCANLLD(x) scanf("%lld",&(x)) #define SCANLLD2(x,y) scanf("%lld%lld",&(x),&(y)) #define SCANLLD3(x,y,z) scanf("%lld%lld%lld",&(x),&(y),&(z)) #define SCANLLD4(x,y,z,w) scanf("%lld%lld%lld%lld",&(x),&(y),&(z),&(w)) #define PRINTD(x) printf("%d\n",(x)) #define PRINTLLD(x) printf("%lld\n",(x)) typedef long long int lli; using namespace std; bool compare_by_2nd(pair<int,int> a, pair<int,int> b) { if( a.second != b.second ) { return a.second < b.second; } else { return a.first < b.first; } } int ctoi(char c) { if( c >= '0' and c <= '9' ) { return (int)(c-'0'); } return -1; } int alphabet_pos(char c) { if( c >= 'a' and c <= 'z' ) { return (int)(c-'a'); } return -1; } int alphabet_pos_capital(char c) { if( c >= 'A' and c <= 'Z' ) { return (int)(c-'A'); } return -1; } vector<string> split(string str, char ch) { int first = 0; int last = str.find_first_of(ch); if(last == string::npos) { last = SIZ(str); } vector<string> result; while( first < SIZ(str) ) { string Ssubstr(str, first, last - first); result.push_back(Ssubstr); first = last + 1; last = str.find_first_of(ch, first); if(last == string::npos) { last = SIZ(str); } } return result; } int gcd( int a , int b ) // assuming a,b >= 1 { if( a < b ) { return gcd( b , a ); } if( a % b == 0 ) { return b; } return gcd( b , a % b ); } int lcm( int a , int b ) // assuming a,b >= 1 { return a * b / gcd( a , b ); } /*------------------ the end of the template -----------------------*/ int main() { //IOS; /* making cin faster */ int N,M; SCAND2(N,M); vector<int> a, b; vector<vector<int> > m(M,vector<int>(M,0)); REP(i,M) { SCAND2(a,b); -- a; -- b; m[a][b] = 1; m[b][a] = 1; } REP(i,N) { int cnt = 0; REP(j,N) { if( m[i][j] ) { ++ cnt; } } PRINTD(cnt); } }
a.cc: In function 'int main()': a.cc:256:7: error: no match for 'operator--' (operand type is 'std::vector<int>') 256 | -- a; | ^~~~ a.cc:257:7: error: no match for 'operator--' (operand type is 'std::vector<int>') 257 | -- b; | ^~~~ a.cc:259:8: error: no match for 'operator[]' (operand types are 'std::vector<std::vector<int> >' and 'std::vector<int>') 259 | m[a][b] = 1; | ^ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from a.cc:36: /usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&; size_type = long unsigned int]' 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1128:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; const_reference = const std::vector<int>&; size_type = long unsigned int]' 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1147:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ a.cc:260:8: error: no match for 'operator[]' (operand types are 'std::vector<std::vector<int> >' and 'std::vector<int>') 260 | m[b][a] = 1; | ^ /usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&; size_type = long unsigned int]' 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1128:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; const_reference = const std::vector<int>&; size_type = long unsigned int]' 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1147:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~
s722769733
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> a(M*2); vector<int> b(N); for (int i = 0; i < M*2; i++) { cin >> a.at(i); for (int j = 0; j < N; j++) { if (a.at(i) = j + 1) { b.at(j)++; } } } for (int k = 0); k < N; k++) { cout << b.at(k) << endl; } }
a.cc: In function 'int main()': a.cc:20:17: error: expected ';' before ')' token 20 | for (int k = 0); k < N; k++) { | ^ | ; a.cc:20:17: error: expected primary-expression before ')' token a.cc:20:17: error: expected ';' before ')' token 20 | for (int k = 0); k < N; k++) { | ^ | ; a.cc:20:20: error: 'k' was not declared in this scope 20 | for (int k = 0); k < N; k++) { | ^
s980145378
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> a(M*2); vector<int> b(N); for (int i = 0; i < M*2; i++) { cin >> a.at(i); for (int j = 0; j < N; j++) { if (a.at(i) = j + 1) { b.at(j)++ } } } for (int k = 0); k < N; k++) { cout << b.at(k) << endl; } }
a.cc: In function 'int main()': a.cc:16:18: error: expected ';' before '}' token 16 | b.at(j)++ | ^ | ; 17 | } | ~ a.cc:20:17: error: expected ';' before ')' token 20 | for (int k = 0); k < N; k++) { | ^ | ; a.cc:20:17: error: expected primary-expression before ')' token a.cc:20:17: error: expected ';' before ')' token 20 | for (int k = 0); k < N; k++) { | ^ | ; a.cc:20:20: error: 'k' was not declared in this scope 20 | for (int k = 0); k < N; k++) { | ^
s913154674
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector(int) a(M*2); vector(int) b(N); for (int i = 0; i < M*2; i++) { cin >> a.at(i); for (int j = 0; j < N; j++) { if (a.at(i) = j + 1) { b.at(j)++ } } } for (int k = 0); k < N; k++) { cout << b.at(k) << endl; } }
a.cc: In function 'int main()': a.cc:8:9: error: missing template arguments before '(' token 8 | vector(int) a(M*2); | ^ a.cc:8:10: error: expected primary-expression before 'int' 8 | vector(int) a(M*2); | ^~~ a.cc:9:9: error: missing template arguments before '(' token 9 | vector(int) b(N); | ^ a.cc:9:10: error: expected primary-expression before 'int' 9 | vector(int) b(N); | ^~~ a.cc:11:12: error: 'a' was not declared in this scope 11 | cin >> a.at(i); | ^ a.cc:16:9: error: 'b' was not declared in this scope 16 | b.at(j)++ | ^ a.cc:20:17: error: expected ';' before ')' token 20 | for (int k = 0); k < N; k++) { | ^ | ; a.cc:20:17: error: expected primary-expression before ')' token a.cc:20:17: error: expected ';' before ')' token 20 | for (int k = 0); k < N; k++) { | ^ | ; a.cc:20:20: error: 'k' was not declared in this scope 20 | for (int k = 0); k < N; k++) { | ^
s795672950
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vector<int> u(m*2); int s =0; for(int i =0; i <m*2 ;i++){ cin >> u.at(i); } for(int j =0; j <n; j++) { if(j == u.at(i) ) { s++; cout << s << endl; } } }
a.cc: In function 'int main()': a.cc:14:20: error: 'i' was not declared in this scope 14 | if(j == u.at(i) ) { | ^
s719401782
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vector<int> u(m*2); int s =0; for(int i =0; i <m*2 ;i++){ cin >> u.at(i); for(int j =0; j <n; j++) { if(j == u.at(i) ) { s++ } cout << s << endl; } } }
a.cc: In function 'int main()': a.cc:14:12: error: expected ';' before '}' token 14 | s++ | ^ | ; 15 | } | ~
s867998610
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vector<int> u(n); for(int i = 0; i<n; i++) { u.at(i) = 0; } for(int i =0; i < m; i++) { vector<int> v(2); cin >> v.at(0) >> v.at(2); for(int j =0; j < n; j++) { if ( j == v.at(0) ) { u.at(j)++ } else if ( j == v.at(1) ) { u.at(j)++ } } } for(int i = 0; i < n; i++) { cout << u.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:17:18: error: expected ';' before '}' token 17 | u.at(j)++ | ^ | ; 18 | } | ~ a.cc:20:18: error: expected ';' before '}' token 20 | u.at(j)++ | ^ | ; 21 | } | ~
s194966803
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; vecort<int> u(n); for(int i = 0; i<n; i++) { u.at(i) = 0; } for(int i =0; i < m; i++) { vector<int> v(2); cin >> v.at(0) >> v.at(2); for(int j =0; j < n; j++) { if ( j == v.at(0) ) { u.at(j)++ } else if ( j == v.at(1) ) { u.at(j)++ } } } for(int i = 0; i < n; i++) { cout << u.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:7:3: error: 'vecort' was not declared in this scope 7 | vecort<int> u(n); | ^~~~~~ a.cc:7:10: error: expected primary-expression before 'int' 7 | vecort<int> u(n); | ^~~ a.cc:9:5: error: 'u' was not declared in this scope 9 | u.at(i) = 0; | ^ a.cc:17:9: error: 'u' was not declared in this scope 17 | u.at(j)++ | ^ a.cc:20:9: error: 'u' was not declared in this scope 20 | u.at(j)++ | ^ a.cc:25:13: error: 'u' was not declared in this scope 25 | cout << u.at(i) << endl; | ^
s883824233
p03720
C++
#include<iostream> #include<stdio.h> #include<string.h> #include<algorithm> #include<vector> #include<queue> #include<map> #include<set> #include<iomanip> #include<cmath> #define REP(i,n) for (int i = 0; (i) < (n); ++ (i)) using namespace std; int n; int a[200000]; int main(){ cin >> n >> m; REP(i,m){ int m1,m2; cin >> m1 >> m2; a[m1-1]++; a[m2-1]++; } REP(i,n){ cout << a[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:15: error: 'm' was not declared in this scope; did you mean 'tm'? 21 | cin >> n >> m; | ^ | tm
s056369217
p03720
C++
#include<algorithm> #include<cmath> #include<cstdio> #include<iostream> #include<map> #include<numeric> #include<queue> #include<sstream> #include<stack> #include<string> #include<unordered_set> #include<vector> #define ll long long #define P pair<int,int> #define FOR(i,N) for(int i=0;i<(int)N;i++) #define FORIN(i,a,b) for(int i=a;i<(int)b;i++) #define ALL(x) (x).begin(),(x).end() #define LAST(x) (x)[(x).size()-1] #define GI(name) int (name);scanf("%d",&(name)) #define GI2(name1,name2) int (name1),(name2);scanf("%d %d",&(name1),&(name2)) #define GI3(name1,name2,name3) int (name1),(name2),(name3);scanf("%d %d %d",&(name1),&(name2),&(name3)) #define GVI(name,size) vector<int> (name)(size);FOR(i,(size))scanf("%d",&(name)[i]) #define MOD 1000000007 using namespace std; string to_hex(int x){ stringstream ss; ss<<hex<<x; return ss.str(); } inline int get_int(){ int ret; scanf("%d",&ret); return ret; } inline vector<int> get_ints(int n){ vector<int> ret(n); FOR(i,n){ scanf("%d",&ret[i]); } return ret; } inline string get_str(){ string ret; cin>>ret; return ret; } bool is_prime(int n){ int s=sqrt(n)+1; for(int i=2;i<=s;++i){ if(n%i==0){ return 0; } } return 1; } vector<P> prime_division(int n){ vector<P> ret; int s=sqrt(n)+1; int c=0; for(int i=2;i<=n;++i){ if(n%i==0){ c=0; do{ ++c; n/=i; }while(n%i==0); ret.push_back(P(i,c)); } } return ret; } string to_string(string s){ return s; } template<class T> string to_string(vector<T> v){ string ret="{"; FOR(i,v.size()-1){ ret+=to_string(v[i])+","; } if(v.size()>0){ ret+=to_string(LAST(v)); } ret+="}"; return ret; } void debug_print(){ cerr<<endl; } template<class Head,class... Tail> void debug_print(Head head,Tail... tail){ cerr<<to_string(head)<<" "; debug_print(tail...); } template<class... T> void debug(T... args){ cerr<<"["<<__LINE__<<"]: "; debug_print(args...); } void print(){ cout<<endl; } template<class Head,class... Tail> void print(Head head,Tail... tail){ cout<<to_string(head); print(tail...); } int main(){ GI(N,M); vector<int> list(N,0); FOR(i,M){ GI2(a,b); list[a-1]++; list[b-1]++; } FOR(i,N){ print(list[i]); } return 0; }
a.cc:125:11: error: macro "GI" passed 2 arguments, but takes just 1 125 | GI(N,M); | ^ a.cc:20:9: note: macro "GI" defined here 20 | #define GI(name) int (name);scanf("%d",&(name)) | ^~ a.cc: In function 'int main()': a.cc:125:5: error: 'GI' was not declared in this scope 125 | GI(N,M); | ^~ a.cc:126:22: error: 'N' was not declared in this scope 126 | vector<int> list(N,0); | ^ a.cc:127:11: error: 'M' was not declared in this scope 127 | FOR(i,M){ | ^ a.cc:16:37: note: in definition of macro 'FOR' 16 | #define FOR(i,N) for(int i=0;i<(int)N;i++) | ^
s579191433
p03720
C++
#include <iostream> #include <string> using namespace std; int main(){ int N, M, a, b; cin >> N >> M; int counter[55] = {0};//バケット for (int i = 0; i < M; i++){ cin >> a >> b; counter[a]++; counter[b]++; //cout << endl; } for (int i = 1; i < N + 1; i++){ cout << counter[i] << endl; }
a.cc: In function 'int main()': a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s902691330
p03720
C++
#include <iostream> #include <string> using namespace std; int main(){ int N, M, a, b; cin >> N >> M; int counter[55] = {0];//バケット for (int i = 0; i < M; i++){ cin >> a >> b; counter[a]++; counter[b]++; //cout << endl; } for (int i = 1; i < N + 1; i++){ cout << counter[i] << endl; }
a.cc: In function 'int main()': a.cc:7:23: error: expected '}' before ']' token 7 | int counter[55] = {0];//バケット | ~ ^ a.cc:7:23: error: expected ',' or ';' before ']' token a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s984630979
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); vector<int>c(N); for(int i = 0;i < M; i++){ cin>>a.at(i)>>b.at(i); } //上下の文字列 for(int i = 0;i < N; i++){ for(int j=0;j < M; j++){ if (i + 1== a[j]|| i+1==b[j]) c[i]++; } } for(int i =0;i<N;i++) cout<<c.at[i]<<endl; }
a.cc: In function 'int main()': a.cc:22:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 22 | cout<<c.at[i]<<endl; | ^
s160607094
p03720
C++
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> st(m*2); for (int i = 0; i < m*2; i++) { cin >> st.at(i); } for (int i = 1; i <= n; i++) { cout << std::count(st.begin(),st.end(),i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:30: error: 'count' is not a member of 'std'; did you mean 'cout'? 17 | cout << std::count(st.begin(),st.end(),i) << endl; | ^~~~~ | cout
s490326753
p03720
C++
4 3 1 2 2 3 1 4
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 4 3 | ^
s466287424
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; vector<int> vec(N;0); for (int i=0;i<M;i++){ int a,b; cin>>a>>b; vec.at(a+1)++; vec.at(b+1)++; } for (int i=0;i<M;i++){ cout<<vec.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:7:20: error: expected ')' before ';' token 7 | vector<int> vec(N;0); | ~ ^ | ) a.cc:7:22: error: expected ';' before ')' token 7 | vector<int> vec(N;0); | ^ | ;
s563864090
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); for(int i=0; i<N; i++){ int x=0; for(int j=0; j<M; j++){ if(a.at(j)==(i+1)||b.at(j)==(i+1)) x++; } cout <<x <<<endl; } }
a.cc: In function 'int main()': a.cc:17:16: error: expected primary-expression before '<' token 17 | cout <<x <<<endl; | ^
s796822129
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >>N >>M; vecter<int> a(M); vector<int> b(M); for(int i=0; i<M; i++) cin >>a.at(i) >>b.at(i); for(int i=0; i<N; i++){ int x=0; for(int j=0; j<M; j++){ if(a.at(j)=='i') x++; } cout <<x <<endl; } }
a.cc: In function 'int main()': a.cc:7:3: error: 'vecter' was not declared in this scope 7 | vecter<int> a(M); | ^~~~~~ a.cc:7:10: error: expected primary-expression before 'int' 7 | vecter<int> a(M); | ^~~ a.cc:10:11: error: 'a' was not declared in this scope 10 | cin >>a.at(i) >>b.at(i); | ^ a.cc:14:10: error: 'a' was not declared in this scope 14 | if(a.at(j)=='i') | ^
s067734063
p03720
C++
#include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<algorithm> using namespace std; int main(){ int a,b; int n,m; cin>>n>>m; vector<int> c(55) for(int i=0;i<m;i++){ cin>>a>>b; c.at(a)++; c.at(b)++; } for(int i=0;i<n;i++){ cout<<c.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:13:3: error: 'vector' was not declared in this scope 13 | vector<int> c(55) | ^~~~~~ a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 5 | #include<algorithm> +++ |+#include <vector> 6 | a.cc:13:10: error: expected primary-expression before 'int' 13 | vector<int> c(55) | ^~~ a.cc:14:21: error: 'i' was not declared in this scope 14 | for(int i=0;i<m;i++){ | ^ a.cc:20:23: error: 'c' was not declared in this scope 20 | cout<<c.at(i)<<endl; | ^
s096674631
p03720
C++
#include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<algorithm> using namespace std; vector<int> c; int main(){ int a,b; int n,m; cin>>n>>m; for(int i=0;i<m;i++){ cin>>a>>b; c.at(a)++; c.at(b)++; } for(int i=0;i<n;i++){ cout<<c.at(i)<<endl; } }
a.cc:9:1: error: 'vector' does not name a type 9 | vector<int> c; | ^~~~~~ a.cc: In function 'int main()': a.cc:17:17: error: 'c' was not declared in this scope 17 | c.at(a)++; | ^ a.cc:21:23: error: 'c' was not declared in this scope 21 | cout<<c.at(i)<<endl; | ^
s184083213
p03720
C++
#include <bits/stdc++.h> using namespace std; #include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ int n,m; cin >> n >> m; vector<int> r(m) for(int i=0;i<2*m;i++){ cin >> r.at(i); } for(int i=0;i<n;i++){ int x=0; for(int j=0;j<2*m;j++){ if(r.at(j)==i){ x++; } } cout << x << endl; } }
a.cc: In function 'int main()': a.cc:11:3: error: expected ',' or ';' before 'for' 11 | for(int i=0;i<2*m;i++){ | ^~~ a.cc:11:15: error: 'i' was not declared in this scope 11 | for(int i=0;i<2*m;i++){ | ^
s811098797
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vetor<int> r(2*M); for(int i=0; i<2*M; i++){ cin >> r.at(i); } for(int j=1; j<=N; j++){ int a=0; for(int i=0; i<2*M; i++){ if(r.at(i)==j){ a++; } } cout << a << endl; } }
a.cc: In function 'int main()': a.cc:7:3: error: 'vetor' was not declared in this scope 7 | vetor<int> r(2*M); | ^~~~~ a.cc:7:9: error: expected primary-expression before 'int' 7 | vetor<int> r(2*M); | ^~~ a.cc:9:12: error: 'r' was not declared in this scope 9 | cin >> r.at(i); | ^ a.cc:14:10: error: 'r' was not declared in this scope 14 | if(r.at(i)==j){ | ^
s833239704
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a[]={}; int b[]={}; int c[]={}; int d[]={}; int N,M; cin >> N >> M; a[M] = {}; for(int i = 0;i<M;i++){ cin >> a[i] >> b[i]; c[a[i]]++; c[b[i]]++ } for(int i = 0;i<N;i++){ cout << c[i]<<endl; } }
a.cc: In function 'int main()': a.cc:16:18: error: expected ';' before '}' token 16 | c[b[i]]++ | ^ | ; 17 | } | ~
s448750131
p03720
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int a[] = new int[M]; int b[] = new int[M]; for(int i=0; i<M; i++){ a = sc.nextInt(); b = sc.nextInt(); } HashMap<String, Integer> cnt = new HashMap<String, Integer>(); for(int i=0; i<M; i++){ cnt.put(a[i], 0); cnt.put(b[i], 0); } for(int i=0; i<M; i++){ cnt.put(a[i], cnt.get(a[i])+1); cnt.put(b[i], cnt.get(b[i])+1); } for(int i=0; i<M; i++){ System.out.println(cnt.get[i]); } } }
Main.java:11: error: incompatible types: int cannot be converted to int[] a = sc.nextInt(); ^ Main.java:12: error: incompatible types: int cannot be converted to int[] b = sc.nextInt(); ^ Main.java:17: error: incompatible types: int cannot be converted to String cnt.put(a[i], 0); ^ Main.java:18: error: incompatible types: int cannot be converted to String cnt.put(b[i], 0); ^ Main.java:22: error: incompatible types: int cannot be converted to String cnt.put(a[i], cnt.get(a[i])+1); ^ Main.java:23: error: incompatible types: int cannot be converted to String cnt.put(b[i], cnt.get(b[i])+1); ^ Main.java:27: error: cannot find symbol System.out.println(cnt.get[i]); ^ symbol: variable get location: variable cnt of type HashMap<String,Integer> Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 7 errors
s224265725
p03720
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int a[] = new int[M]; int b[] = new int[M]; for(int i=0; i<M; i++){ a = sc.nextInt(); b = sc.nextInt(); } HashMap<String, Integer> cnt = new HashMap<String, Integer>(); for(int i=0; i<M; i++){ cnt.put(a[i], 0); cnt.put(b[i], 0); } for(int i=0; i<M; i++){ cnt.put(a[i], cnt.get(a[i])+1); cnt.put(b[i], cnt.get(b[i])+1); } for(int i=0; i<; i++){ System.out.println(cnt.get[i]); } } }
Main.java:26: error: illegal start of expression for(int i=0; i<; i++){ ^ 1 error
s504510348
p03720
Java
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int a[] = new int[M]; int b[] = new int[M]; for(int i=0; i<M; i++){ a[] = sc.nextInt(); b[] = sc.nextInt(); } HashMap<String, Integer> cnt = new HashMap<String, Integer>(); for(int i=0; i<M; i++){ cnt.put(a[i], 0); cnt.put(b[i], 0); } for(int i=0; i<M; i++){ cnt.put(a[i], cnt.get([i])+1); cnt.put(b[i], cnt.get([i])+1); } for(int i=0; i<; i++){ System.out.println(cnt.get[i]); } } }
Main.java:11: error: not a statement a[] = sc.nextInt(); ^ Main.java:11: error: ';' expected a[] = sc.nextInt(); ^ Main.java:12: error: not a statement b[] = sc.nextInt(); ^ Main.java:12: error: ';' expected b[] = sc.nextInt(); ^ Main.java:22: error: illegal start of expression cnt.put(a[i], cnt.get([i])+1); ^ Main.java:22: error: not a statement cnt.put(a[i], cnt.get([i])+1); ^ Main.java:22: error: ';' expected cnt.put(a[i], cnt.get([i])+1); ^ Main.java:23: error: illegal start of expression cnt.put(b[i], cnt.get([i])+1); ^ Main.java:23: error: not a statement cnt.put(b[i], cnt.get([i])+1); ^ Main.java:23: error: ';' expected cnt.put(b[i], cnt.get([i])+1); ^ Main.java:26: error: illegal start of expression for(int i=0; i<; i++){ ^ 11 errors
s670609567
p03720
C++
#include<iostream> using namespace std; int main() { int n,m,a,b,v[50]={0}; cin >> n >> m; for(int i=0; i<m; i++) { cin >> a >> b; v[a]++; v[b]++; } for(int i=0; i<n; i++) { cout << v[i] << endl; }
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() { | ^
s219867250
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N[60] ={0}; int M; int t; cin >> t >> M; for (int i = 0; i < M; i++) { int a,b; cin >> a >> b; N[a]++; N[b]++; } for each (int var in N) { if(var){ cout << var << endl; } } }
a.cc: In function 'int main()': a.cc:18:13: error: expected '(' before 'each' 18 | for each (int var in N) | ^~~~ | ( a.cc:18:19: error: expected primary-expression before 'int' 18 | for each (int var in N) | ^~~ a.cc:18:13: error: 'each' was not declared in this scope 18 | for each (int var in N) | ^~~~ a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^ a.cc:23:10: error: expected ';' before '}' token 23 | } | ^ | ; 24 | } | ~ a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^ a.cc:23:10: error: expected ')' before '}' token 23 | } | ^ | ) 24 | } | ~ a.cc:18:13: note: to match this '(' 18 | for each (int var in N) | ^~~~ a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^
s157783854
p03720
C++
#include <iostream> #include <algorithm> #include <set> using namespace std; int main() { int N[60] ={0}; int M; int t; cin >> t >> M; for (int i = 0; i < M; i++) { int a,b; cin >> a >> b; N[a]++; N[b]++; } for each (int var in N) { if(var){ cout << var << endl; } } }
a.cc: In function 'int main()': a.cc:20:13: error: expected '(' before 'each' 20 | for each (int var in N) | ^~~~ | ( a.cc:20:19: error: expected primary-expression before 'int' 20 | for each (int var in N) | ^~~ a.cc:20:13: error: 'each' was not declared in this scope 20 | for each (int var in N) | ^~~~ a.cc:26:1: error: expected primary-expression before '}' token 26 | } | ^ a.cc:25:10: error: expected ';' before '}' token 25 | } | ^ | ; 26 | } | ~ a.cc:26:1: error: expected primary-expression before '}' token 26 | } | ^ a.cc:25:10: error: expected ')' before '}' token 25 | } | ^ | ) 26 | } | ~ a.cc:20:13: note: to match this '(' 20 | for each (int var in N) | ^~~~ a.cc:26:1: error: expected primary-expression before '}' token 26 | } | ^