submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s110709766
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } for(int i=0;i<N;i++) { int sum=0; for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { ...
a.cc: In function 'int main()': a.cc:18:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 18 | cout << sum+=1 << endl; | ~~^~~~~~~
s756322409
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { co...
a.cc: In function 'int main()': a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 17 | cout << sum+=1 << endl; | ~~^~~~~~~
s774860622
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { co...
a.cc: In function 'int main()': a.cc:17:20: error: no match for 'operator+=' (operand types are 'std::basic_ostream<char>' and 'int') 17 | cout << sum+=1; | ~~~~~~~~~~~^~~
s665213754
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { if(a.at(i)==b.at(j)>0) { co...
a.cc: In function 'int main()': a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 17 | cout << sum+=1 << endl; | ~~^~~~~~~
s896660003
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int>a(M),b(M); for(int i=0;i<M;i++) { cin >> a.at(M); } for(int i=0;i<M;i++) { cin >> b.at(M); } int sum=0; for(int i=0;i<N;i++) { for(int j=0;j<M;j++) { if(a.at(i)==b.at(j)>0) { co...
a.cc: In function 'int main()': a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 17 | cout << sum+=1 << endl; | ~~^~~~~~~
s483219609
p03720
C++
int main(){ int n,m; cin >>n>>m; int a[m][2]; rep(i,m){ rep(j,2){ cin>>a[i][j]; } } int bucket[n]={0}; rep(i,m){ rep(j,2){ bucket[a[i][j]-1]++; } } rep(i,n) cout<<bucket[i]<<endl; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin >>n>>m; | ^~~ a.cc:5:7: error: 'i' was not declared in this scope 5 | rep(i,m){ | ^ a.cc:5:3: error: 'rep' was not declared in this scope 5 | rep(i,m){ | ^~~
s746181746
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) int main(){ int n,m; cin >>n>>m; int a[m][2]; rep(i,m){ rep(j,2){ cin>>a[i][j]; } } int bucket[n]={0}; rep(i,m){2){ rep(j, bucket[a[i][j]-1]++; } } rep(i,n) cout<<bucket[i]<<endl;...
a.cc:21:2: error: unterminated argument list invoking macro "rep" 21 | } | ^ a.cc: In function 'int main()': a.cc:15:13: error: expected ';' before ')' token 15 | rep(i,m){2){ | ^ | ; a.cc:16:8: error: expected '}' at end of input 16 | rep(j, | ^ a....
s441722084
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> count(n); for(int i = 0; i < m*2; i++){ int x; cin >> x; count[x-1]++; } for(int i = 0; i < N; i++) cout << count[i] << endl; }
a.cc: In function 'int main()': a.cc:15:22: error: 'N' was not declared in this scope 15 | for(int i = 0; i < N; i++) | ^
s081409230
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int N,M; cin >> N >> M; vector <int> a(M), vector <int> b(M); rep(i,M) cin >> a.at(i) >> b.at(i); rep(i,N){ int x=0; rep(j,M){ if(a.at(j) == i+1 || b.at(j) == i+1) x+...
a.cc: In function 'int main()': a.cc:9:16: error: invalid declarator before 'b' 9 | vector <int> b(M); | ^ a.cc:12:23: error: 'b' was not declared in this scope 12 | cin >> a.at(i) >> b.at(i); | ^ a.cc:16:28: error: 'b' was not declared in this scope 16 |...
s283560963
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int N,M; cin >> N >> M; vector <int> a,b(N); rep(i,M) cin >> a.at(i) >> b.at(i); rep(i,N){ int x=0; rep(j,N){ if(a.at(j) == j+1 || b.at(j) == j+1) x++; } cout <<...
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s780626682
p03720
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; vector<int> city(n, 0); for (int i=0; i<m; i++) { int a, b; cin >> a >> b; city.at(a-1)++; city.at(b-1)++ } for (int i=0; i<n; i++) { cout << city.at...
a.cc: In function 'int main()': a.cc:13:23: error: expected ';' before '}' token 13 | city.at(b-1)++ | ^ | ; 14 | } | ~
s850029116
p03720
C
#include<limits.h> #define NUM 51 int main(){ int n, m, a, b; int r[NUM]; scanf("%d%d\n", &n, &m); for(int i=1; i<=n; i++){ p[i] = 0; } for(int i=0; i<m; i++){ scanf("%d%d\n", &a, &b); p[a]++; p[b]++; } for(int i=1; i<=n; i++){ printf("%d\n", r[i]); } return 0; }
main.c: In function 'main': main.c:8:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | scanf("%d%d\n", &n, &m); | ^~~~~ main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 1 | #include<limits.h> +++ |+#include <stdio.h> 2 |...
s028778672
p03720
C++
#include<iostream> using namespace std; int main(){ int N,M; cin>>N>>M; int a[M],b[M]; int i; for(i=0;i<M;i++){ cin>>a[i]>>b[i]; } int backet[N]; for(i=0;i<N;i++){ backet[a[i]]++; backet[b[i]]++; } for(i=0;i<N;i++){ cout>>backet[i];} }
a.cc: In function 'int main()': a.cc:17:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 17 | cout>>backet[i];} | ~~~~^~~~~~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc...
s556697868
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m; vector<int> ans(N,0); for(int i = 0; i < m; i++) { int a,b; cin >> a >> b; ans[a-1]++; ans[b-1]++; } for(int i=0;i < n;i++) cout << ans.at(i) << endl; }
a.cc: In function 'int main()': a.cc:7:19: error: 'N' was not declared in this scope 7 | vector<int> ans(N,0); | ^
s973249418
p03720
C
#include<stdio.h> int main(void){ int n,m,i,a,b; scanf("%d %d",&n,&m); int r[n]={0}; for(i=0;i<m;i++){ scanf("%d %d",&a,&b); r[a]++; r[b]++; } for(i=0;i<n;i++){ printf("%d",r[i]); } return 0; }
main.c: In function 'main': main.c:5:12: error: variable-sized object may not be initialized except with an empty initializer 5 | int r[n]={0}; | ^
s649971432
p03720
C
#include<stdio.h> int main(void){ int n,m,i,a,b; scanf("%d %d",&n,&m); int road[n]={0}; for(i=0;i<m;i++){ scanf("%d %d",&a,&b); road[a]++; road[b]++; } for(i=0;i<n;i++){ printf("%d",road[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int road[n]={0}; | ^
s550650954
p03720
C
#include<stdio.h> int main(void){ int n,m,i,a,b; scanf("%d %d",&n,&m); int road[n]={0}; for(i=0;i<m;i++){ scanf("%d %d",&a,&b); road[a]++; road[b]++; } for(i=0;i<n;i++){ printf("%d",road[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int road[n]={0}; | ^
s011594906
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> c(N,0); int a,b; for(int i=0;i<M;i++){ cin >> a >> b; c.at(a-1)++; c.at(b-1)++; } for(int i=0;i<N;i++) cout << N.at(i) << endl; }
a.cc: In function 'int main()': a.cc:16:15: error: request for member 'at' in 'N', which is of non-class type 'int' 16 | cout << N.at(i) << endl; | ^~
s900583551
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> c(N,0); int a,b; for(int i=0;i<M;i++){ cin >> a >> b; N.at(a) +=1; N.at(b) +=1; } for(int i=0;i<N;i++) cout << N.at(i) << endl; }
a.cc: In function 'int main()': a.cc:12:7: error: request for member 'at' in 'N', which is of non-class type 'int' 12 | N.at(a) +=1; | ^~ a.cc:13:7: error: request for member 'at' in 'N', which is of non-class type 'int' 13 | N.at(b) +=1; | ^~ a.cc:16:15: error: request for member ...
s742379212
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> c(N,0); int a,b; for(int i=0;i<M;i++){ cin >> a >> b; N.at(a)++; N,at(b)++; } for(int i=0;i<N;i++) cout << N(i) << endl; }
a.cc: In function 'int main()': a.cc:12:7: error: request for member 'at' in 'N', which is of non-class type 'int' 12 | N.at(a)++; | ^~ a.cc:13:7: error: 'at' was not declared in this scope; did you mean 'a'? 13 | N,at(b)++; | ^~ | a a.cc:16:14: error: 'N' cannot be use...
s443563264
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> k(2*M); for(int i=0;i<2*M;i=i+1){ cin >> k.at(i); } sort(k.begin(),k.end()) map<int,int> unti; for(int x:k){ if(unti.count(x)){ unti.at(x)=unti.at(x)+1; } else{ unti.at(x)=1; } ...
a.cc: In function 'int main()': a.cc:11:26: error: expected ';' before 'map' 11 | sort(k.begin(),k.end()) | ^ | ; 12 | map<int,int> unti; | ~~~ a.cc:14:8: error: 'unti' was not declared in this scope 14 | if(unti...
s306066498
p03720
C++
#include<iostream> #include <bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m ; int a[m],b[m] int c[n] = {0} ; for(int i=0;i<m;i++){ cin >> a[i] >> b[i] ; } for(int i=0;i<m;i++){ c[a[i]-1]++; c[b[i]-1]++; } for(int i=0;i<n;i++){ cout << c[i] << end...
a.cc: In function 'int main()': a.cc:11:3: error: expected initializer before 'int' 11 | int c[n] = {0} ; | ^~~ a.cc:13:20: error: 'b' was not declared in this scope 13 | cin >> a[i] >> b[i] ; | ^ a.cc:17:5: error: 'c' was not declared in this scope 17 | c[a[i]-1]++; ...
s753255721
p03720
C++
#include <iostream> int main() { int n,m; scanf("%d%d",&n,&m); int i,a,b; int h[n+1],i; for(i=1;i<=m;++i) { scanf("%d",&a); scanf("%d",&b); h[a]++; h[b]++; } for(i=1;i<n;++i) { if(h[i]!=0) printf("%d\n",h[i]); } }
a.cc: In function 'int main()': a.cc:8:15: error: redeclaration of 'int i' 8 | int h[n+1],i; | ^ a.cc:7:8: note: 'int i' previously declared here 7 | int i,a,b; | ^
s414675504
p03720
C++
#include <bits/stdc++.h>// using namespace std; int main() { int N, M; cin >> N >> M; vector<int> ans(N); for (int i=0;i<M;i++){ int a,b; cin >> a >> b; for (int j=0;j<N;j++){ if(j+1 == a || j+1 == b) ans.at(j) +=1 } } for (int i=0;i<N;i++){ cout << ans.at(i) <<endl; } }
a.cc: In function 'int main()': a.cc:13:20: error: expected ';' before '}' token 13 | ans.at(j) +=1 | ^ | ; 14 | } | ~
s449664772
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; vector<int> vec(2); for(int i=0;i<M;i++){ cin >> vec.at(0) >> vec.at(1); for(int j=1;j<N+1;j++){ int f=0; if(vec.at(0)==j||vec.at(1)==j) f++; } cout << f << endl; }...
a.cc: In function 'int main()': a.cc:16:17: error: 'f' was not declared in this scope 16 | cout << f << endl; | ^
s902927572
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; vector<int> vec(2); for(int i=0;i<M;i++){ cin >> vec.at(0) >> vec.at(1); } for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } cout...
a.cc: In function 'int main()': a.cc:16:21: error: lvalue required as left operand of assignment 16 | if(vec.at(0)=j||vec.at(1)=j) | ~^~~~~~~~~~~
s619744430
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; for(int i=0;i<M;i++){ vector<int> vec(2); cin >> vec.at(0) >> vec.at(1); } for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } co...
a.cc: In function 'int main()': a.cc:16:10: error: 'vec' was not declared in this scope 16 | if(vec.at(0)=j||vec.at(1)=j) | ^~~
s927497078
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; for(int i=0;i<M;i++) vector<int> vec(2); cin >> vec.at(0) >> vec.at(1); for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } cout <<...
a.cc: In function 'int main()': a.cc:10:12: error: 'vec' was not declared in this scope 10 | cin >> vec.at(0) >> vec.at(1); | ^~~
s907471644
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() {//それぞれの数字の数を出力したい int N,M; cin >> N >> M; for(int i=0;i<M;i++) cin >> vector<int> vec(2); for(int j=1;j<N+1;j++){ int f=0; for(int i=0;i<M;i++){ if(vec.at(0)=j||vec.at(1)=j) f++; } cout << f << endl; }
a.cc: In function 'int main()': a.cc:9:24: error: expected primary-expression before 'vec' 9 | cin >> vector<int> vec(2); | ^~~ a.cc:14:10: error: 'vec' was not declared in this scope 14 | if(vec.at(0)=j||vec.at(1)=j) | ^~~ a.cc:18:2: error: expected '}' at e...
s164504544
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> a(N); for (int i = 0;i < M;i++) { int a,b; cin >> a >> b; a.at(a-1)++; a.at(b-1)++; } for (int i = 0;i < N;i++) { cout << a.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:12:7: error: request for member 'at' in 'a', which is of non-class type 'int' 12 | a.at(a-1)++; | ^~ a.cc:13:7: error: request for member 'at' in 'a', which is of non-class type 'int' 13 | a.at(b-1)++; | ^~
s250301161
p03720
C++
#include <bits/stdc++.h> int n, m; int main() { std::cin >> n >> m; std::vector<int> a(m), b(m); for (int i = 0; i < m; ++i) { std::cin >> a[i] >> b[i]; } std::vector<int> road(n); for (int i = 0; i < n; ++i) { road[i] = 0; } for (int i = 0; i < M; ++i) { road[a[i]-1] += 1; road[b[i]-1] += ...
a.cc: In function 'int main()': a.cc:19:23: error: 'M' was not declared in this scope 19 | for (int i = 0; i < M; ++i) { | ^ a.cc:24:23: error: 'N' was not declared in this scope 24 | for (int i = 0; i < N; ++i) { | ^
s202348671
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n, m; cin >> n >> m; vi deg(n); for(int i = 0; i < m; i++){ int a, b; cin >> a >> b; --a, --b; deg[a]++;deg[b]++; } for(auto i : deg) ...
a.cc: In function 'int main()': a.cc:8:5: error: 'vi' was not declared in this scope 8 | vi deg(n); | ^~ a.cc:13:9: error: 'deg' was not declared in this scope 13 | deg[a]++;deg[b]++; | ^~~ a.cc:15:18: error: 'deg' was not declared in this scope 15 | for(auto i : deg) ...
s478309134
p03720
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) typedef long long ll; template <class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return fa...
a.cc: In function 'int main()': a.cc:45:12: error: expected '}' at end of input 45 | return 0; | ^ a.cc:25:12: note: to match this '{' 25 | int main() { | ^
s001328402
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2*M),count(N); for(int i=0;i<2*M;i++){ cin>>road.at(i); for(int j=0;j<N;j++){ for(int i=0;i<2*M;i++){ if(road.at(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:8:25: note: to match this '{' 8 | for(int i=0;i<2*M;i++){ | ^ a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:4:12: note: to match this '{' 4 ...
s491828751
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2*M),count(N); for(i=0;i<2*M;i++){ cin>>road.at(i); for(j=0;j<N;j++){ for(i=0;i<2*M;i++){ if(road.at(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<2*M;i++){ | ^ a.cc:11:7: error: 'j' was not declared in this scope 11 | for(j=0;j<N;j++){ | ^ a.cc:18:4: error: expected '}' at end of input 18 | } | ^ a.cc:8:21: note: to m...
s709454762
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2*M)count(N); for(i=0;i<2*M;i++){ cin>>road.t(i); for(j=0;j<N;j++){ for(i=0;i<2*M;i++){ if(road.t(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:6:24: error: expected ',' or ';' before 'count' 6 | vector<int> road(2*M)count(N); | ^~~~~ a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<2*M;i++){ | ^ a.cc:9:17: error: 'class std::vector<int>' has no member na...
s669351221
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; vector<int> road(2M)count(N); for(i=0;i<2M;i++){ cin>>road.t(i); for(j=0;j<N;j++){ for(i=0;i<2M;i++){ if(road.t(i)==j) count.at(j)++; } cout<<count.at(j)<<endl; }
a.cc: In function 'int main()': a.cc:6:20: error: unable to find numeric literal operator 'operator""M' 6 | vector<int> road(2M)count(N); | ^~ a.cc:6:23: error: expected ',' or ';' before 'count' 6 | vector<int> road(2M)count(N); | ^~~~~ a.cc:8:7: error: ...
s831691131
p03720
C++
#include <bits/stdc++.h> using namespace std; int main () { int N , M ; cin >> N >> M ; vector<int> vec(2M); for (int i = 0 ; i < 2M ; i++ ) { cin >> vec.at(i) ; } for ( int i = 0 ; i < M ; i++) { int sum = 0 ; for ( int k = 0 ; k < 2M ; k++){ if ( vec.at (k) == i ){ sum+...
a.cc: In function 'int main()': a.cc:8:19: error: unable to find numeric literal operator 'operator""M' 8 | vector<int> vec(2M); | ^~ a.cc:10:24: error: unable to find numeric literal operator 'operator""M' 10 | for (int i = 0 ; i < 2M ; i++ ) { | ^~ a.cc:...
s699065980
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> a(M); vector<int> b(M); for(int i=0;i<M;i++){ cin >> a.at(i) >> b.at(i); } int count = 0; for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ if(a.at(j) == i){ count++; } if(b.at(j) ...
a.cc:25:1: error: expected declaration before '}' token 25 | } | ^
s941319405
p03720
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); ...
a.cc: In function 'int main()': a.cc:76:3: error: 'V' was not declared in this scope 76 | V<int> a(n,0); | ^ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:76:5: note: in expansion of macro 'int' 76 | V<int> a(n,0); | ^...
s776373672
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2*M); for(int i=0; i<2*M; i++){ cin >> vec.at(i); } vector<int> number(N); for(int i=0; i<2*M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl...
a.cc: In function 'int main()': a.cc:21:4: error: expected '}' at end of input 21 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s360751137
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2*M); for(int i=0; i<2*M; i++){ cin >> vec.at(i); } int number(N); for(int i=0; i<2*M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl; }
a.cc: In function 'int main()': a.cc:15:12: error: request for member 'at' in 'number', which is of non-class type 'int' 15 | number.at(vec.at(i))++; | ^~ a.cc:19:20: error: request for member 'at' in 'number', which is of non-class type 'int' 19 | cout << number.at(i) << endl; | ...
s763114276
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2M); for(int i=0; i<2M; i++){ cin >> vec.at(i); } int number(N); for(int i=0; i<2M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl; }
a.cc: In function 'int main()': a.cc:7:19: error: unable to find numeric literal operator 'operator""M' 7 | vector<int> vec(2M); | ^~ a.cc:9:18: error: unable to find numeric literal operator 'operator""M' 9 | for(int i=0; i<2M; i++){ | ^~ a.cc:14:18: error: un...
s644670690
p03720
C++
#include <bits/stdc++.h> using nameplace std; int main(){ int N,M; cin >> N >> M; vector<int> vec(2M); for(int i=0; i<2M; i++){ cin >> vec.at(i); } int number(N); for(int i=0; i<2M; i++){ number.at(vec.at(i))++; } for(int i=0; i<N; i++){ cout << number.at(i) << endl; }
a.cc:2:7: error: expected nested-name-specifier before 'nameplace' 2 | using nameplace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> N >> M; | ^~~ | std::cin In file included from /usr/inc...
s922830785
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a; cin >> N >> M; vector<int> vec(N, 0); for(int i=0;i<2*N;i++){ cin >> a; vec.at(a)++; } for(int i=0;i<N;i++){ cout << vec.at(i) << endl; }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s046871967
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a; cin >> N >> M; vector<int> vec(N, 0); for(i=0;i<2*N;i++){ cin >> a; vec.at(a)++; } for(i=0;i<N;i++){ cout << vec.at(i) << endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<2*N;i++){ | ^ a.cc:12:7: error: 'i' was not declared in this scope 12 | for(i=0;i<N;i++){ | ^ a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match...
s167336981
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); int n, m; cin >> n >> m; vector<int> a(n+1, 0); for(int i = 0; i < m; i++) { cin >> x >> y; a[x]++; a[y]++; } for(int i = 1; i <= n; i++) { cout << a[i] << endl; } ...
a.cc: In function 'int main()': a.cc:13:12: error: 'x' was not declared in this scope 13 | cin >> x >> y; | ^ a.cc:13:17: error: 'y' was not declared in this scope 13 | cin >> x >> y; | ^
s304560959
p03720
C++
#include <bits/stdc++> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> road(N); for (int i=0; i < M;i++) { int a, b; cin >> a >> b; road.at(a)++; road.at(b)++; } for (int i=1; i<M; i++) { cout << road.at(i) << endl; } }
a.cc:1:10: fatal error: bits/stdc++: No such file or directory 1 | #include <bits/stdc++> | ^~~~~~~~~~~~~ compilation terminated.
s366315533
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >>M; vector<int> city(2*M); for (int i=0;i<2*M;i++) { cin >> city.at(i); } for (int i=0;i<N;i++) { cout << city.length(i+1) <<endl; } }
a.cc: In function 'int main()': a.cc:14:18: error: 'class std::vector<int>' has no member named 'length' 14 | cout << city.length(i+1) <<endl; | ^~~~~~
s613680522
p03720
Java
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int M = scanner.nextInt(); int[] a = new int[M]; int[] b = new int[M]; int[] ans = new int[N + 1]; for (int i = 0; i < M; i++) { a[i] = scanner.nextInt(); b[i] = scanne...
Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s178623835
p03720
C++
#include <stdio.h> int main(void){ int n = 0, m = 0; int a = 0, b = 0; int ans[51]; scanf("%d%d", &n, &m); for(int i = 1; i<= n; i++){ ans[i] = 0; }  for(int i = 0; i < m; i++){ scanf("%d%d", &a, &b); ans[a]++; ans[b]++; } for(int i = 1; i<= n; i++...
a.cc:12:1: error: stray '\16' in program 12 | <U+000E> | ^~~~~~~~
s412880004
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (int i = 0; i < M; ++i){ cin >> A[i] >> B[i]; } int road[NMMAX]; for (int i = 0;i < N; ++i){ road[i] = 0; } for (inti=0;i<M;++i){ road[A[i] - 1] += 1; ...
a.cc: In function 'int main()': a.cc:19:14: error: 'inti' was not declared in this scope; did you mean 'int'? 19 | for (inti=0;i<M;++i){ | ^~~~ | int a.cc:19:21: error: 'i' was not declared in this scope 19 | for (inti=0;i<M;++i){ | ^...
s251015123
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (inti=0;i<M;++i){ cin >> A[i] >> B[i]; } int road[NMMAX]; for (inti=0;i<N;++i){ road[i] = 0; } for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i...
a.cc: In function 'int main()': a.cc:10:14: error: 'inti' was not declared in this scope; did you mean 'int'? 10 | for (inti=0;i<M;++i){ | ^~~~ | int a.cc:10:21: error: 'i' was not declared in this scope 10 | for (inti=0;i<M;++i){ | ^...
s382680564
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; vector<int> a(M),b(M); map<int,int> A; for(int i=0;i<M;i++){ cin>>a.at(i)>>b.at(i);} for(int i=0; i<M; i++){ if(!A.count(a.at(i))){A[a.at(i)]=1} else{A.at(a.at(i))++;} if(!A.count(b.at(i))){A[b.at(i)]=1} else...
a.cc: In function 'int main()': a.cc:13:39: error: expected ';' before '}' token 13 | if(!A.count(a.at(i))){A[a.at(i)]=1} | ^ | ; a.cc:15:39: error: expected ';' before '}' token 15 | if(!A.count(b.at(i))){A[b.at(i)]=1...
s376359152
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int cities, roads; cin >> cities >> roads; vector<int> answers(cities); for(int i =0; i < roads; i++) { int a,b; cin >> a >> b; answers.at(a)++; answers.at(b)++; } for(int i = 0; i < cities; ii++) { cout << answers.at(i) << endl;...
a.cc: In function 'int main()': a.cc:14:30: error: 'ii' was not declared in this scope; did you mean 'i'? 14 | for(int i = 0; i < cities; ii++) { | ^~ | i
s157042721
p03720
C
#include <stdio.h> int main() { int n,m,i,c1,c2; scanf("%d%d",&n,&m); int c[n]; for(i=1;i<=n;i++) { c[i]=0; } for(i=0;i<m;i++){ scanf("%d%d",&c1,&c2); c[c1]+= 1; c[c2]+= 1; } for(i=1;i<=N;i++){ printf("%d\n",c[i]); } return 0; }
main.c: In function 'main': main.c:14:20: error: 'N' undeclared (first use in this function) 14 | for(i=1;i<=N;i++){ | ^ main.c:14:20: note: each undeclared identifier is reported only once for each function it appears in
s743501569
p03720
C++
#include<bits/stdc++.h> #define rep(i,a) for(int i=0;i<a;i++) using namespace std; int main(){ int n,m; cin>>n>>m; int a[n]; rep(i,m){ int ena,enb; cin>>ena>>enb; a[ena-1]++; b[enb-1]++; } rep(i,n){ cout<<a[i]<<endl; } }
a.cc: In function 'int main()': a.cc:12:9: error: 'b' was not declared in this scope 12 | b[enb-1]++; | ^
s154828175
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ vector<int> a,q; int s,d,f,g,y = 0; cin >> s >> d; for (int i= 0;i<d;i++){ cin >> f >> g; a.push_back(f); q.push_back(g); } for(int j =0;i<s;i++){ y=0; for(int i=0;i<d;i++){ if(i+1 == a.at(i)) y += 1; if(i+1 == q.at...
a.cc: In function 'int main()': a.cc:12:16: error: 'i' was not declared in this scope 12 | for(int j =0;i<s;i++){ | ^
s862907070
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N , M , a , b; cin >> N >> M; vector <int> count(N , 0) for (int i = 0 ; i < M ; i ++){ cin >> a >> b; count.at(a-1) += 1; count.at(b-1) += 1; } for(int i = 0 ; i < M ; i ++){ cout << count.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:8:9: error: expected ',' or ';' before 'for' 8 | for (int i = 0 ; i < M ; i ++){ | ^~~ a.cc:8:26: error: 'i' was not declared in this scope 8 | for (int i = 0 ; i < M ; i ++){ | ^
s957107738
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> vector<int> ab(M * 2); for (int i = 0; i < M * 2; i++) { cin >> ab.at(i); } for (int i = 0; i < N; i++) { int cnt = 0; for (int j = 0; j < M * 2; j++) { if (i + 1 == ab.at(j)) { cnt++; ...
a.cc: In function 'int main()': a.cc:8:15: error: expected primary-expression before 'ab' 8 | vector<int> ab(M * 2); | ^~ a.cc:10:14: error: 'ab' was not declared in this scope; did you mean 'abs'? 10 | cin >> ab.at(i); | ^~ | abs a.cc:16:20: erro...
s656159363
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(void) { 2 int N, M; 3 cin >> N >> M; 4 5 const int NMMAX = 50; 6 int A[NMMAX], B[NMMAX]; 7 8 for (int i = 0; i < M; ++i) { 9 cin >> A[i] >> B[i]; 10 } 11 12 int road[NMMAX]; 13 for (int i = 0; i < N; ++i) { 14 road[i] = 0; 15 } 16 17 for (int i = 0; i < M; ++i) { ...
a.cc: In function 'int main()': a.cc:5:2: error: expected ';' before 'int' 5 | 2 int N, M; | ^~~~ | ; a.cc:6:2: error: expected ';' before 'cin' 6 | 3 cin >> N >> M; | ^~~~ | ; a.cc:7:2: error: expected ';' before numeric constant 7 | 4 | ^ | ; 8 | 5 const int N...
s599398011
p03720
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) #define ll long long using namespace std; int main(){ int n,m;cin>>n>>m; map<int, int> m; rep(i,m){ int a,b;cin>>a>>b; map[a]++; map[b]++; } rep(i,n){ cout<<m[i+1]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: conflicting declaration 'std::map<int, int> m' 11 | map<int, int> m; | ^ a.cc:9:9: note: previous declaration as 'int m' 9 | int n,m;cin>>n>>m; | ^ a.cc:14:9: error: conflicting declaration 'auto a' 14 | map[a]++; ...
s263372171
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> a(M), b(M); for (int i = 0; i < M; i++) { cin >> a(M).at(i) >> b(M).at(i); } vector<int> c(N); for (int i = 0; i < M; i++) { c(N).at(a(M).at(i) -1)++; c(N).at(b(M).at(i) -1)++; } cout ...
a.cc: In function 'int main()': a.cc:11:13: error: no match for call to '(std::vector<int>) (int&)' 11 | cin >> a(M).at(i) >> b(M).at(i); | ~^~~ a.cc:11:27: error: no match for call to '(std::vector<int>) (int&)' 11 | cin >> a(M).at(i) >> b(M).at(i); | ~^~~ ...
s239858394
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> machi_a(M); vector<int> machi_b(M); vector<int> total(N); for(int i=0; i <M; i++){ cin >> machi_a.at(i) >> machi_b.at(i); int A =machi_a.at(i); int B =machi_b.at(i); for(int j =0, j<N; j++)...
a.cc: In function 'int main()': a.cc:17:20: error: expected ';' before '<' token 17 | for(int j =0, j<N; j++){ | ^ | ; a.cc:17:20: error: expected primary-expression before '<' token a.cc:24:22: error: 'j' was not declared in this scope 24 | cout << total....
s763409475
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector<int> machi_a(M); vector<int> machi_b(M); vector<int> total(N); for(int i=0; i <M; i++){ cin >> machi_a(i) >> machi_b(i); int A =machi_a(i); int B =machi_b(i); for(int j =0, j<N; j++){ if(A...
a.cc: In function 'int main()': a.cc:14:19: error: no match for call to '(std::vector<int>) (int&)' 14 | cin >> machi_a(i) >> machi_b(i); | ~~~~~~~^~~ a.cc:14:33: error: no match for call to '(std::vector<int>) (int&)' 14 | cin >> machi_a(i) >> machi_b(i); | ...
s802983735
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,W; cin>>N>>W; vector<int> vec(N,0); for(int i=0;i<W;i++){ int a,b; cin>>a>>b; vec[a]++; vec[b]++; } for(int i=0;i<N;i++){ cout<<vec[a]<<endl; } }
a.cc: In function 'int main()': a.cc:15:15: error: 'a' was not declared in this scope 15 | cout<<vec[a]<<endl; | ^
s310415252
p03720
C++
#include <iostream> #include <fstream> #include <algorithm> // for next_permutation #include <vector> #include <bits/stl_numeric.h> #define DEBUG 0 #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll MOD = 1000000007; static const ll INF = 1000000000000000000LL; using nam...
a.cc: In function 'int main()': a.cc:19:18: error: expected unqualified-id before 'do' 19 | vector <int> do(N, 0); | ^~ a.cc:21:20: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] 21 | for(int i = 0; i < M: ++...
s627570777
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> a(N); vector<int> b(N); for (int i = 0; i < N; i++){ cin >> a.at(i); cin >> b.at(i); } vector<int> c(M,0); for(int i = 0; i < M; i++){ c.at(A.at(i) - 1) += 1; c.at(B.at(i) - 1) += 1; } fo...
a.cc: In function 'int main()': a.cc:16:10: error: 'A' was not declared in this scope 16 | c.at(A.at(i) - 1) += 1; | ^ a.cc:17:10: error: 'B' was not declared in this scope 17 | c.at(B.at(i) - 1) += 1; | ^
s533456389
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m,a; vector<int> vec(n); cin>>n>>m; for(int i=0;i<2m;i++){ cin>>a; vec.at(a-1)++; } for(int i=0;i<n;i++){ cout<<vec.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:8:17: error: unable to find numeric literal operator 'operator""m' 8 | for(int i=0;i<2m;i++){ | ^~
s318132402
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; int n,m; n=0; while(n<N){ m=0; while(m<2*M){ cin>>m; if(m==n){ x++; } m++; } cout<<m<<endl; n++; } }
a.cc: In function 'int main()': a.cc:13:9: error: 'x' was not declared in this scope 13 | x++; | ^
s869422422
p03720
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow...
a.cc: In function 'int main()': a.cc:83:7: error: 'i' was not declared in this scope 83 | for(i,n){ | ^ a.cc:87:1: error: expected primary-expression before '}' token 87 | } | ^ a.cc:85:4: error: expected ';' before '}' token 85 | } | ^ | ; 86 | 87 | } | ~ ...
s978391474
p03720
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow...
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterato...
s248469950
p03720
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) int main() { int N, M, x, y; string all; cin >> N >> M; vector<int> x(M); rep(i,M) { rep(j,2) { cin >> x >> y; all+='0'+x+y; } } rep(k,all.size()) { rep(l,N) { if(all.at(k)=...
a.cc: In function 'int main()': a.cc:10:15: error: conflicting declaration 'std::vector<int> x' 10 | vector<int> x(M); | ^ a.cc:7:13: note: previous declaration as 'int x' 7 | int N, M, x, y; | ^ a.cc:24:9: error: request for member 'at' in 'x', which is of non-class typ...
s163575128
p03720
C++
#include<iostream> #include<vector> using namespace std; int main() { int n,m; cin>>n>>m; vector<int>N(n); for(int i=0;i<m;++i){ int a,b; cin>>a>>b; ++N[a] ++N[b] } for(int i=1;i<=n;++i){ cout<<N[i]<<endl; } }
a.cc: In function 'int main()': a.cc:13:17: error: lvalue required as increment operand 13 | ++N[b]
s276942411
p03720
C
#include<iostream> #include<vector> using namespace std; int main(){ int n ,m; cin >> n >> m; vector<int> ans(n); for(int i = 0;i < m;i++){ int a, b; cin >> a >> b; ans[a-1]++; ans[b-1]++; } for(int i = 0;i < n;i++){ cout << ans[i] << endl; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s643713999
p03720
C
#include<iostream> #include<vector> using namespace std; int main(){ int n ,m; cin >> n >> m; vector<int> ans(n); for(int i = 0;i < m;i++){ int a, b; cin >> a >> b; ans[a-1]++; ans[b-1]++; } for(int i = 0;i < n;i++){ cout << ans[i] << endl; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s493080799
p03720
C
c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);}
main.c:1:1: warning: data definition has no type or storage class 1 | c[51];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:1:7: error: return type defaults to 'int' [-Wimplicit...
s713919616
p03720
C
c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);}
main.c:1:1: warning: data definition has no type or storage class 1 | c[];main(b,a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;n/b;)printf("%d\n",c[b++]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:1:5: error: return type defaults to 'int' [-Wimplicit-i...
s303403868
p03720
C
b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);}
main.c:1:1: warning: data definition has no type or storage class 1 | b,c[];main(a){for(scanf("%d%*d",c);~scanf("%d",&a);)c[a]++;for(;b++<n;)printf("%d\n",c[b]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'c...
s834462318
p03720
C
r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);}
main.c:1:1: warning: data definition has no type or storage class 1 | r[99];main(n,a,b){scanf("%d%d",&n,&a);while(~scanf("%d%d",&a,&b))r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r[++m]);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:1:7: error: return type defaults...
s243718674
p03720
C
r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);}
main.c:1:1: warning: data definition has no type or storage class 1 | r[99];main(n,m,a,b){scanf("%d%d",&n,&m);while(m--)scanf("%d%d",&a,&b),r[a]++,r[b]++;for(++m;m<n;)printf("%d\n",r+++m);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:1:7: error: return type defa...
s724559551
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } int e[50]; for(int i=1; i<=a ;i++){ e[i] =0; } for(int j =1; j<=b;j++){ e[c[j]-1] += 1; e[d[j]-1] += 1; } for(int i =1 ...
a.cc: In function 'int main()': a.cc:20:26: error: 'j' was not declared in this scope 20 | for(int i =1 ;i<=a;j++){ | ^
s995505076
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } int e[50],f[50]; for(int i=1; i<=a ;i++){ int e[i] = 0,f[i] = 0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } ...
a.cc: In function 'int main()': a.cc:14:19: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] = 0,f[i] = 0; | ^ a.cc:14:28: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] = 0,f[i] = 0; | ...
s522213479
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } int e[50],f[50]; for(int i=1; i<=a ;i++){ int e[i] =0,f[i] =0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } ...
a.cc: In function 'int main()': a.cc:14:18: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] =0,f[i] =0; | ^ a.cc:14:26: error: array must be initialized with a brace-enclosed initializer 14 | int e[i] =0,f[i] =0; | ...
s135268978
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } for(int i=1; i<=a ;i++){ int e[50] ,f[50]; int e[i] =0,f[i] =0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } ...
a.cc: In function 'int main()': a.cc:15:9: error: conflicting declaration 'int e [i]' 15 | int e[i] =0,f[i] =0; | ^ a.cc:13:9: note: previous declaration as 'int e [50]' 13 | int e[50] ,f[50]; | ^ a.cc:15:17: error: conflicting declaration 'int f [i]' 15 | int e[i] =0,f[...
s894159662
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } for(int i=1; i<=a ;i++){ int e[50] = 0; int f[50] = 0; for(int j =1; j<=b;j++){ e[c[j]-1] += 1; f[d[j]-1] += 1; } cou...
a.cc: In function 'int main()': a.cc:13:17: error: array must be initialized with a brace-enclosed initializer 13 | int e[50] = 0; | ^ a.cc:14:17: error: array must be initialized with a brace-enclosed initializer 14 | int f[50] = 0; | ^
s484149483
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c[50],d[50]; cin>> a >>b; for(int i=0; i<b;i++){ cin >> c[i] >>d[i]; } for(int i=0; i<a ;i++){ int e = 0; for(int j =0; j<b;j++){ if(a[j] == i){ e++; } if(b[j] == i){ e++; } } ...
a.cc: In function 'int main()': a.cc:15:11: error: invalid types 'int[int]' for array subscript 15 | if(a[j] == i){ | ^ a.cc:18:11: error: invalid types 'int[int]' for array subscript 18 | if(b[j] == i){ | ^
s281838796
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,c; int main(){ cin>>a>>b; vector<int>d(a,0); for(int i=0;i<b*2;i++){ cin>>c; d[c-1]++; } for(int i=0;i<a;i++)cout<<a[i]<<endl; }
a.cc: In function 'int main()': a.cc:11:30: error: invalid types 'int[int]' for array subscript 11 | for(int i=0;i<a;i++)cout<<a[i]<<endl; | ^
s700924404
p03720
C++
#include <bits/stdc++.h> using namespace std; int main{ int N, M, a, b, i; cin >> N >> M; vector<int> road(N); for(i=0; i<M; i++){ cin >> a >> b; road.at(a-1)++; road.at(b-1)++; } for (i=0; i<N; i++){ cout << road.at(i) << endl; } }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N, M, a, b, i; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6...
s393606012
p03720
C++
#include <bits/stdc++.h> using namespace std; int main{ int N, M, a, b, i; cin >> N >> M; vector<int> road(N) for(i=0; i<M; i++){ cin >> a >> b; road.at(a-1)++; road.at(b-1)++; } for (i=0; i<N; i++){ cout << road.at(i) << endl; } }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int N, M, a, b, i; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6...
s516341974
p03720
C++
int main(void) { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (inti=0;i<M;++i){ cin >> A[i] >> B[i]; } int road[NMMAX]; for (inti=0;i<N;++i){ road[i] = 0; } for (inti=0;i<M;++i){ road[A[i] - 1] += 1; road[B[i] - 1] += 1; } for (inti=0;i<N;++i){ cout << road[i] << endl; } re...
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> N >> M; | ^~~ a.cc:6:6: error: 'inti' was not declared in this scope; did you mean 'int'? 6 | for (inti=0;i<M;++i){ cin >> A[i] >> B[i]; | ^~~~ | int a.cc:6:13: error: 'i' was not...
s096446017
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a, b; int vector<int> bridge(n); for(int i=0; i<n; i++){ cin >> a >> b; bridge.at(a) += 1; bridge.at(b) += 1; } for(int i=0; i<n; i++){ cout << bridge.at(i) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: invalid declarator before 'bridge' 9 | int vector<int> bridge(n); | ^~~~~~ a.cc:12:5: error: 'bridge' was not declared in this scope 12 | bridge.at(a) += 1; | ^~~~~~ a.cc:17:13: error: 'bridge' was not declared in this scop...
s992782093
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; /* vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; c[e-1]++; }*/ for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:13:29: error: 'c' was not declared in this scope 13 | for(int i=0;i<a;i++)cout<<c[i]<<endl; | ^
s393727826
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ // e=d[i]; c[e-1]++; } for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | ...
s344534108
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; // vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; // c[e-1]++; } // for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | ...
s554740110
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; // vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; // c[e-1]++; } for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | ...
s465763791
p03720
C++
#include<bits/stdc++.h> using namespace std; int a,b,e; int main(){ cin>>a>>b; vector<int> c(a,0); vector<int> d(b*2); for(int i=0;i<b*2;i++)cin>>d; for(int i=0;i<b*2;i++){ e=d[i]; c[e-1]++; } for(int i=0;i<a;i++)cout<<c[i]<<endl; }
a.cc: In function 'int main()': a.cc:8:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<b*2;i++)cin>>d; | ~~~^~~ | | | | | ...
s149009596
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> list(2 * m); for (int i = 0; i < 2 * m; i++) cin >> list.at(i); for (int j = 1; j <= n; j++) { int x = 0; for (int k = 0; k < 2 * m; k++) { if (list.at(k) == j) x++; } cout << x <...
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s007255293
p03720
C++
#include <bits/stdc++.h> using namespace std; int main( ){ int N,M; cin>>N>>M; vector<int>A(M),B(M); for(int i=0;i<M;i++) { cin>>A.at(i),B.at(i); } for(int i =1;i<N+1;i+=1) { for(int j=1;j<N+1;j+=1) { int countj = 0; if(A.at(i-1)==j || B.at(i-1)==j) { countj +=1; } } ...
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 | ci...
s645848064
p03720
C++
#include <bits/stdc++.h> using namespace std; int main( ){ int N,M; cin>>N>>M; vector<int>A(M),B(M); for(int i=0;i<M;i++) { cin>>A.at(i),B.at(i); } for(int i =1;i<N+1;i+=1) { for(int j=1;j<N+1;j+=1) { int count int j = 0 if(A.at(i-1)==j || B.at(i-1)==j) { count j +=1; } ...
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 | ci...