submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s608371025
p03720
C++
#include <iostream> #include <algorithm> #include <set> using namespace std; int main() { int N[60] ={0}; int M; int t; cin >> t >> M; for (int i = 0; i < M; i++) { int a,b; cin >> a >> b; N[a]++; N[b]++; } for each (int var in N) { if(var){ cout << var << endl; } } }
a.cc: In function 'int main()': a.cc:21:13: error: expected '(' before 'each' 21 | for each (int var in N) | ^~~~ | ( a.cc:21:19: error: expected primary-expression before 'int' 21 | for each (int var in N) | ^~~ a.cc:21:13: error: 'each'...
s794747631
p03720
C++
import collections N, M = map(int, input().split()) a, b = [0] * M, [0] * M for i in range(M): a[i], b[i] = map(int, input().split()) c = collections.Counter(a + b) for i in range(1, N + 1): print(c[i])
a.cc:1:1: error: 'import' does not name a type 1 | import collections | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s248857338
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int N,M; cin>>N>>M; int cnt[N]; for(int i=0;i<N;i++) cnt[[i=0; for(int i=0;i<M;i++){ int a,b; cin>>a>>b; cnt[a-1]++; cnt[b-1]++; } for(int i=0;i<N;i++) cout<<cnt[i]<<endl; ret...
a.cc: In function 'int main()': a.cc:9:12: error: two consecutive '[' shall only introduce an attribute before '[' token 9 | cnt[[i=0; | ^
s986731917
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int N,M; cin>>N>>M; int cnt[N]; for(int i=0;i<M;i++){{ int a,b; cin>>a>>b; cnt[a-1]++; cnt[b-1]++; } for(int i=0;i<N;i++) cout<<cnt[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s026943492
p03720
C++
#Include<bits/stdc++.h> using namespace std; int main(void){ int N,M; cin>>N>>M; int cnt[N]; for(int i=0;i<M;i++){{ int a,b; cin>>a>>b; cnt[a-1]++; cnt[b-1]++; } for(int i=0;i<N;i++) cout<<cnt[i]<<endl; return 0; }
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include? 1 | #Include<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin>>N>>M; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header...
s029276172
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, r, c; cin >> N >> M; int matrix[N][N]; for (int i = 0; i < M; i++) { cin >> r >> c; matrix[r][c] = 1; matrix[c][r] = 1; } for (int i = 0; i < N; i++) { int num = 0 for (int j = 0; j < N; j++) { num += matrix[i][j...
a.cc: In function 'int main()': a.cc:15:5: error: expected ',' or ';' before 'for' 15 | for (int j = 0; j < N; j++) { | ^~~ a.cc:15:21: error: 'j' was not declared in this scope 15 | for (int j = 0; j < N; j++) { | ^
s604188230
p03720
C++
#include <iostream> using namespae std; int main(){ int n,m; cin >> n >> m; int a[m],b[m]; for(int i=0;i<m;i++){ cin >> a[i] >> b[i]; } int ans[n]; for(int i=0;i<n;i++){ ans[i]=0; } for(int i=0;i<m;i++){ ans[a[i]-1]++; ans[b[i]-1]++; } for(int i=0;i<n;i++){ cout << ans[i] << e...
a.cc:2:7: error: expected nested-name-specifier before 'namespae' 2 | using namespae std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n >> m; | ^~~ | std::cin In file included from a.cc:1: /us...
s507724631
p03720
C++
#include <bits/stdc++.h> using namespace std; /* REPmacro */ #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) #define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i) #define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i) /*alias*/ #define ALL(x) (x).begin(),(x).end() #define SZ(x) ((int)(x).size()) #define F first #...
a.cc: In function 'int main()': a.cc:63:9: error: unable to find numeric literal operator 'operator""m' 63 | REP(i,2m){ | ^~ a.cc:5:39: note: in definition of macro 'REP' 5 | #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) | ^ a.cc:68:9: error: ...
s333032112
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> L(N); for (int i = 0; i < M, i++) { int a, b; cin >> a >> b; L.at(a) += 1; L.at(b) += 1; } for (int i = 0; i < N, i++) { cout << L.at(i) << endl; } }
a.cc: In function 'int main()': a.cc:9:29: error: expected ';' before ')' token 9 | for (int i = 0; i < M, i++) { | ^ | ; a.cc:16:29: error: expected ';' before ')' token 16 | for (int i = 0; i < N, i++) { | ...
s077946425
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> A(N); for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; A.at(a-1)++; A.at(b-1)++; } for (int i = 0; i < N; i++) { cout << A.(i) << endl; } }
a.cc: In function 'int main()': a.cc:17:15: error: expected unqualified-id before '(' token 17 | cout << A.(i) << endl; | ^
s035980406
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector <int> road_city(2*m); vector <int> road_count(n); for (int i=0; i<2*m; i++) { cin >> road_city.at(i); } for (int i=0; i<2*m; i++) { road_count.at(road_city.(i)-1)++; } for (int i=0; i<n; i++) { ...
a.cc: In function 'int main()': a.cc:16:29: error: expected unqualified-id before '(' token 16 | road_count.at(road_city.(i)-1)++; | ^
s860922580
p03720
C++
#include <stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector <int> road_city(2*m); vector <int> road_count(n); for (int i=0; i<2*m; i++) { cin >> road_city.at(i); } for (int i=0; i<2*m; i++) { road_count.at(road_city.(i)-1)++; } for (int i=0; i<n; i++) { cou...
a.cc:1:10: fatal error: stdc++.h: No such file or directory 1 | #include <stdc++.h> | ^~~~~~~~~~ compilation terminated.
s384835953
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; vector <int> road_num(N); vector <int> road(2*M); for (int i=0; i<2*M; i++) { cin >> road.at(i); } for (int i=0; i<2*M; i++) { road_num.at(road.at(i))++ } for (int i=0; i<N; i++) { cout << road_num.a...
a.cc: In function 'int main()': a.cc:16:30: error: expected ';' before '}' token 16 | road_num.at(road.at(i))++ | ^ | ; 17 | } | ~
s395092329
p03720
C
#include<stdio.h> int main(){ int i,j,k; int N,M; scanf("%d %d",&N,&M); int A[2*M]; for(i=0;i<2*M;i+=2) scanf("%d %d",&A[i],&A[i+1]); int B[N] = {0}; for(i=0;i<2*M;i++){ B[A[i]]++; } for(i=0;i<N;i++){ printf("%d\n",B[i]); } return 0; }
main.c: In function 'main': main.c:14:14: error: variable-sized object may not be initialized except with an empty initializer 14 | int B[N] = {0}; | ^
s078329598
p03720
C++
#include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; int a[M], b[M], c[N]; for(int i=0; i<M; i++){ cin >> a[i] >> b[i]; } for(int i=0 i<N; i++){ c[i] = 0; } for(int i=0; i<M; i++){ c[a[i]]++; c[b[i]]++; } for(int i=0; i<N; i++){ cout << c[i] << endl;...
a.cc: In function 'int main()': a.cc:13:14: error: expected ';' before 'i' 13 | for(int i=0 i<N; i++){ | ^~ | ;
s411854624
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int city, load; int go, back; cin >> city >> load; vector<int> cities(city); for (int i = 0; i < load; i++){ cin >> go >> back; cities.at(go) = cities.at(go) + 1 cities.at(back) = cities.at(back) + 1 } for (int i = 0; i < cities.s...
a.cc: In function 'int main()': a.cc:11:38: error: expected ';' before 'cities' 11 | cities.at(go) = cities.at(go) + 1 | ^ | ; 12 | cities.at(back) = cities.at(back) + 1 | ~~~~~~
s076919686
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int city, load; int go, back; cin >> city >> load; vector<int> cities(city); for (int i = 0; i < load; i++){ cin >> go >> back; city.at(go) = cities.at(go) + 1 city.at(back) = cities.at(back) + 1 } for (int i = 0; i < cities.size(...
a.cc: In function 'int main()': a.cc:11:10: error: request for member 'at' in 'city', which is of non-class type 'int' 11 | city.at(go) = cities.at(go) + 1 | ^~
s730708922
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int city, load; int go, back; cin >> city >> load; vector<int> cities(city); for (int i = 0; i < load; i++){ cin >> go >> back; city.at(go) = city.at(go) + 1 city.at(back) = city.at(back) + 1 } for (int i = 0; i < len(cities); i++...
a.cc: In function 'int main()': a.cc:11:10: error: request for member 'at' in 'city', which is of non-class type 'int' 11 | city.at(go) = city.at(go) + 1 | ^~ a.cc:11:24: error: request for member 'at' in 'city', which is of non-class type 'int' 11 | city.at(go) = city.at(go) + 1 | ...
s469827606
p03720
C
#include <stdio.h> int main(){ int n,m; scanf("%d%d",&n,&m); int a[m],b[m],road[n]; for (int i=0;i<m;i++){ scanf("%d%d",&a[i],&b[i]); } for (int i=0;i<n;i++){ for (int j=0;j<m;j++){ if (i==a[j]){ road[i]++; } if (i==b[j]){ ...
main.c: In function 'main': main.c:18:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 18 | print("%d\n",road[i]); | ^~~~~ | printf
s661149903
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int number, city, load, num,load_go, load_back; cin >> number; city = number[0]; load = number[1]; vector<int> cities(city) = {}; vector<int> loads(load) = {}; for (int i = 0; i < city; i++){ cities.at[i] = 0; } for (int i = 0; i <...
a.cc: In function 'int main()': a.cc:7:16: error: invalid types 'int[int]' for array subscript 7 | city = number[0]; | ^ a.cc:8:16: error: invalid types 'int[int]' for array subscript 8 | load = number[1]; | ^ a.cc:9:28: error: expected ',' or ';' before '=' token ...
s530883617
p03720
C++
#include <bits/stdc++.h> using namespace std; int count[55]; int main () { int N,M; cin >> N >> M; for (int i = 0; i < M; ++i) { int tmp1 = 0; int tmp2 = 0; cin >> tmp1 >> tmp2; count[tmp1]++; count[tmp2]++; } for (int i = 0; i < N; ++i) { cout << count[i] << endl; } }
a.cc: In function 'int main()': a.cc:12:17: error: reference to 'count' is ambiguous 12 | count[tmp1]++; | ^~~~~ In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /us...
s326714303
p03720
C++
#include<bits/stdc++.h> using namespace std; int a[1001],b[1001]; int main(){ int i,j,n; cin>>a>>b; for(i=1;i<=n;i++){ a[i]++; b[i]++; } cout<<a<<b; return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1001]') 6 | cin>>a>>b; | ~~~^~~ | | | | | int [1001] | std::istream {aka std::basic_istream<c...
s452931085
p03720
C++
#include<bits/stdc++.h> using namespace std; int a[1001],b[1001]; int main(){ int i,j,n; cin>>a>>b; for(i=1;i<=n;i++){ a[i]++; b[i]++; } return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1001]') 6 | cin>>a>>b; | ~~~^~~ | | | | | int [1001] | std::istream {aka std::basic_istream<c...
s825586090
p03720
C++
#include <iostream> using ll = long long; const int AMAX = (int)1e5; ll cnt[AMAX + 1]; int main() { int N; ll K; cin >> N >> K; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; cnt[a] += b; } for (int ans = 1; ans <= AMAX; ++ans) { if (K <= cnt[ans]) { ...
a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin >> N >> K; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Li...
s251294270
p03720
C
#include <iostream> using namespace std; int main() { cin.tie(0); ios_base::sync_with_stdio(false); int N, M; int n[50]; cin >> N >> M; for (int i=0; i<M; ++i) { int a, b; cin >> a >> b; ++n[a-1]; ++n[b-1]; } for (int i=0; i<N; ++i) { cout << n[i] << "\n"; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s218061200
p03720
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int a[m], b[m]; int c[m] = 0; for(int i = 0; i < m; i++){ cin >> a[i] >> b[i]; c[a[i]]++; c[b[i]]++; } for(int i = 0; i < m; i++){ cout << c[i] << endl; } }
a.cc: In function 'int main()': a.cc:6:14: error: array must be initialized with a brace-enclosed initializer 6 | int c[m] = 0; | ^
s153422394
p03720
C++
int main(void) { int N, M; cin >> N >> M; const int NMMAX = 50; int A[NMMAX], B[NMMAX]; for (int i = 0; i < M; ++i) { cin >> A[i] >> B[i]; } int road[NMMAX]; for (int i = 0; i < N; ++i) { road[i] = 0; } for (int i = 0; i < M; ++i) { road[A[i] - 1] += 1; road[B[i] - 1] += 1; } for (int i = 0; i < N;...
a.cc: In function 'int main()': a.cc:3:2: error: 'cin' was not declared in this scope 3 | cin >> N >> M; | ^~~ a.cc:23:2: error: 'cout' was not declared in this scope 23 | cout << road[i] << endl; | ^~~~ a.cc:23:21: error: 'endl' was not declared in this scope 23 | cout << road[i] << endl; ...
s435657524
p03720
C++
#include<iostream> using namespace std; int main() { int N, M, A[N], road1[M], road2[M]; cin >> N >> M; for (int i = 0; i < M; i++) { cin >> road1[i] >> raod2[i]; } for (int i = 0; i++; i < N) { A[i] = 0; } for (int i = 0; i < M; i++) { A[road1[i] - 1]++; A[road2[i] - 1]++; } for (int i = 0; i < N; i+...
a.cc: In function 'int main()': a.cc:7:36: error: 'raod2' was not declared in this scope; did you mean 'road2'? 7 | cin >> road1[i] >> raod2[i]; | ^~~~~ | road2
s382662596
p03720
C++
#include<iostream> using namespace std; int main() { int N, M, A[N], road1[M], raod2[M]; cin >> N >> M; for (int i = 0; i < M; i++) { cin >> road1[i] >> raod2[i]; } for (int i = 0; i++; i < N) { A[i] = 0; } for (int i = 0; i < M; i++) { A[road1[i] - 1]++; A[road2[i] - 1]++; } for (int i = 0; i < N; i+...
a.cc: In function 'int main()': a.cc:14:19: error: 'road2' was not declared in this scope; did you mean 'raod2'? 14 | A[road2[i] - 1]++; | ^~~~~ | raod2
s793092522
p03720
C
#include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<int>> v(N); for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; a--; b--; v[a].push_back(b); v[b].push_back(a); } for (int i = 0; i < N; i++) { cout << v[i].size(...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s427117985
p03720
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <climits> using namespace std; int main(){ int N, M, a[51], b[51], ans[51] = {0}; cin >> N >> M; for(int i = 0; i < M; i++) cin >> a[i] >> b[i]; for(int i = 0; i < M; i++){ ans[a[i]]++; ans[b[i]]++: } for (int...
a.cc: In function 'int main()': a.cc:17:16: error: expected ';' before ':' token 17 | ans[b[i]]++: | ^ | ;
s071026488
p03720
C++
#include<iostream> using namespace std; int main() { int n, m, ab[51] = {0}, a, b; cin >> n >> m; for(int i = 0; i < m; i++){ cin >> a >> b; ab[a] += 1; ab[b] += 1; } for(int i = 1; i <= n; i++){ cout << ab[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:12: error: '\U0000ff10' was not declared in this scope 15 | return 0; | ^~
s623155491
p03720
C++
#include<stdio.h> using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
a.cc: In function 'int main()': a.cc:2:50: error: 'cin' was not declared in this scope 2 | using namespace std;int g[55];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~ a.cc:2:1: n...
s398519423
p03720
C++
#include<stdio.h> using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
a.cc: In function 'int main()': a.cc:2:50: error: 'cin' was not declared in this scope 2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;} | ^~~ a.cc:2:1: n...
s422629004
p03720
C++
#include <ios> using namespace std; int g[55]; main() { int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~ a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; ...
s455865622
p03720
C++
#include <iostream> using namespace std; int g[89]; main(int) { n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(int) | ^~~~ a.cc:4:1: warning: 'int main(int)' takes only zero or two arguments [-Wmain] a.cc: In function 'int main(int)': a.cc:6:4: error: 'n' was not declared in this scope 6 | n,m;cin>>n>>m;for(int i=0;i<...
s347395335
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N , M; cin >> N, M; vector<int> A; vector<int> B; for (int i = 0; i < N; i++) { cin >> A.at(i); }
a.cc: In function 'int main()': a.cc:11:4: error: expected '}' at end of input 11 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s432334865
p03720
Java
import java.util.*; import static java.lang.System.*; import static java.lang.Math.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(in); int n = Integer.parseInt(sc.next()); int m = Integer.parseInt(sc.next()); int[] a=new int[m]; int[] b=new int[m]; HashMap<Integer,Intege...
Main.java:21: error: unexpected type int c=map.get(a[i])++; ^ required: variable found: value Main.java:23: error: unexpected type c=map.get(b[i])++; ^ required: variable found: value 2 errors
s536898716
p03720
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define llong long long #define pb(a)...
a.cc: In function 'int main()': a.cc:26:16: error: array must be initialized with a brace-enclosed initializer 26 | int sum[N] = 0; | ^
s582962352
p03720
C++
#include<iostream> using namespace std; int main(){ int N, M; int a[110]; multiset<int> st; for(int i = 0; i < 2*M; i += 2){ cin >> a[i]; st.insert(a[i]); } for(int i = 0; i < N) cout << st.count(i+1) << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'multiset' was not declared in this scope 7 | multiset<int> st; | ^~~~~~~~ a.cc:2:1: note: 'std::multiset' is defined in header '<set>'; this is probably fixable by adding '#include <set>' 1 | #include<iostream> +++ |+#include <set> 2 | using name...
s872008906
p03720
C++
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int cnt[n + 1]; // 初期化 for (int i = 1; i <= n; i++) cnt[i] = 0; for (int i = 1; i <= m; i++) { int a = 0 int b = 0; cin >> a >> b; cnt[a] += 1; cnt[b] += 1; } for (int i = 1; i <= n; i++) { if (cnt[i...
a.cc: In function 'int main()': a.cc:14:5: error: expected ',' or ';' before 'int' 14 | int b = 0; | ^~~ a.cc:15:17: error: 'b' was not declared in this scope 15 | cin >> a >> b; | ^
s093236664
p03720
C++
#include "stdafx.h" #include "iostream" #include "algorithm" #include "string" #include "vector" #include "cmath" #define INT_MAX 2147483647 #define LLINT_MAX 9223372036854775807 #define mod 1000000007 #define ll long long int using namespace std; int main() { int n, m; cin >> n >> m; int a, b; int ans[50]; for (...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s411659057
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, sum = 0; cin >> N >> M; for (int n = 1; n < N + 1; n++){ //Nの値を順に調べる for (int j = 0; j < M; j++){ //各行ごとに調べる int a, b; cin >> a >> b >> endl; //入力受付 if(n == a){ // N=aのとき if(n == b){ sum += 2; }...
a.cc: In function 'int main()': a.cc:11:21: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 11 | cin >> a >> b >> endl; //入力受付 | ~~~~~~~~~~~~~~^~~~~~~ In file included from /...
s880883411
p03720
C++
using namespace std; int main() { int N, M, a, b; cin >> N >> M; for (int n = 1; n < N + 1; n++){ int sum = 0; //N = pの個数のカウント //以下で各行ごとに調べる for (int j = 0; j < M; j++){ cin >> a >> b; //行のa, bの入力 //a, bがNに等しいか否かの判定 if (n == a && n == b){ sum += 2; } else if...
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> N >> M; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:27:3: error: '...
s660805201
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 for (int k = 0; k < 2; k++){ //配列の各要素についてiを探索 vect...
a.cc: In function 'int main()': a.cc:14:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 14 | cin << city.at(k); | ~~~ ^~ ~~~~~~~~~~ | | ...
s309450345
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 cin >> a >> b; vector<int>city; city = {a, b};...
a.cc: In function 'int main()': a.cc:16:22: error: no match for call to '(std::vector<int>) (int&)' 16 | if (i == city(k)){ | ~~~~^~~
s355587709
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 cin >> a >> b; vector<int>city; city = {a, b};...
a.cc: In function 'int main()': a.cc:16:22: error: no match for call to '(std::vector<int>) (int&)' 16 | if (i == city(k)){ | ~~~~^~~ a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s731976151
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M, a, b, sum = 0; cin >> N >> M; for (int i = 1; i < N + 1; i++){ /*全体に対してi = a or i = bの個数を探索. iはN、つまり都市数*/ for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数 cin >> a >> b; vector<int>city; city = {a, b} ...
a.cc: In function 'int main()': a.cc:14:20: error: expected ';' before 'for' 14 | city = {a, b} //配列に各行のa, bを代入 | ^ | ; 15 | 16 | for(k = 0; k < 2; k++){ | ~~~ a.cc:16:18: error: 'k' was not declared in this scope 16 | ...
s085820723
p03720
C
#include <iostream> #include <cstring> int main() { int n, m; std::cin >> n >> m; int r[ n ]; std::memset( r, 0, sizeof( r ) ); for( int i = 0; i < m; i++ ) { int a, b; std::cin >> a >> b; r[ a - 1 ] += 1; r[ b - 1 ] += 1; } for( int i = 0; i < n; i++ ) { std::cout << r[ i ] << std::endl; } re...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s814976703
p03720
C++
int main(void){ int n,m; int a[55],b[55]; cin >> n >> m; for(int i=0 ; i<m ; i++){ cin >> a[i] >>b[i]; a[i] -= 1; b[i] -= 1; } int ans[55]; for(int i = 0 ; i < n ; i++){ for(int j = 0 ; j < m ; i++){ if(a[j] == i|| b[j] == i){ ans[i] += 1...
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> n >> m; | ^~~ a.cc:19:9: error: 'cout' was not declared in this scope 19 | cout << ans[i] << endl; | ^~~~ a.cc:19:27: error: 'endl' was not declared in this scope 19 | c...
s332288750
p03720
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N,M; N=sc.nextInt(); M=sc.nextInt(); int [] num_road = new int[N]; for(int a=0;a<M;a++){ int a_city =sc.nextInt(); int b_city =sc.nextInt(); num_road[a...
Main.java:19: error: reached end of file while parsing } ^ 1 error
s608291979
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>n,m; vector<int>ab(2*m); vector<int>num(n); for(int i=0;i<n;i++){ num.at(i)=0; for(int i=0;i<2*m;i++){ cin>>ab.at(i); int t=ab.at(i)-1; num.at(t)++; } for(int i=0;i<n;i++){ cout<<num.at(i)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s350699186
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>n,m; vector<int>ab(2*m); vector<int>num(n); for(int i=0;i<n;i++){ num(i)=0; for(int i=0;i<2*m;i++){ cin>>ab.at(i); int t=ab.at(i)-1; num.at(t)++; } for(int i=0;i<n;i++){ cout<<num.at(i)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:6: error: no match for call to '(std::vector<int>) (int&)' 10 | num(i)=0; | ~~~^~~ a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s573588723
p03720
C++
#include <bits/stdc++.h> using namespace std; int main(){ int m,n; cin>>n,m; vector<int>ab(2*m); vector<int>num(n); for(int i=0;i<2*m;i++){ cin>>ab.at(i); num(ab.at(i))++; } for(int i=0;i<n;i++){ cout<<num.at(i)<<endl/; } return 0; }
a.cc: In function 'int main()': a.cc:11:6: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 11 | num(ab.at(i))++; | ~~~^~~~~~~~~~ a.cc:15:25: error: expected primary-expression before ';' token 15 | cout<<num.at(i)<<endl/; | ...
s821684445
p03720
C++
#include <iostream> using namespace std; int main() { int n,m,a,b; cin>>n>>m; vector<int> road(n,0); for(int i=0;i<m;i++) { cin>>a>>b; road.at(a-1)++; road.at(b-1)++; } for(int i=0;i<n;i++) { cout<<road.at(i)<<endl; } }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<int> road(n,0); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | u...
s452912881
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; int city[N] for(int i = 0;i < 2 * M;i++){ int a,b; cin >> a >> b; city[a - 1]++; city[b - 1]++; } for(int i = 0;i < N;i++){ cout << city[i]; } }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'for' 8 | for(int i = 0;i < 2 * M;i++){ | ^~~ a.cc:8:17: error: 'i' was not declared in this scope 8 | for(int i = 0;i < 2 * M;i++){ | ^ a.cc:15:13: error: 'city' was not declared in this scope 15 |...
s240363533
p03720
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin >> N >> M; int city[N] for(int i = 0;i < 2 * M;i++){ int a,b; cin >> a >> b; city[a - 1]++; city[b - 1]++; } for(int i = 0;i < N;i++){ cout << city[i]; } }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'for' 8 | for(int i = 0;i < 2 * M;i++){ | ^~~ a.cc:8:17: error: 'i' was not declared in this scope 8 | for(int i = 0;i < 2 * M;i++){ | ^ a.cc:15:13: error: 'city' was not declared in this scope 15 |...
s024644873
p03720
C++
#include <iostream> #include <climits> #include <stack> #include <queue> #include <string> #include <set> #include <map> #include <math.h> #include <algorithm> #include <vector> using namespace std; typedef long long ll; typedef pair<ll,ll> P; long long int INF = 1e18; double Pi = 3.141592653589; const int mod = ...
a.cc: In function 'int main()': a.cc:28:21: error: expected primary-expression before '<<' token 28 | #define p(x) cout<<x<<endl; | ^~ a.cc:55:9: note: in expansion of macro 'p' 55 | p(); | ^
s717650734
p03720
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> using namespace std; int main (void) { int N, M; int ans =0; cin >> N >> M; int A[N][N]={0}; for (int i=0; i<=M-1;i++){ cin >> a >> b; A[a][b]=1; A[b][a]=1; } for (int j=0; j<=N-1; j++) { for (in...
a.cc: In function 'int main()': a.cc:14:12: error: 'a' was not declared in this scope 14 | cin >> a >> b; | ^ a.cc:14:17: error: 'b' was not declared in this scope 14 | cin >> a >> b; | ^
s793201665
p03720
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<vector> #include<map> using namespace std; int main(){ int N,M; cin >> N >> M; vector<int> vc(N); for(int i=0;i<M;i++){ cin >> a >> b; vc[a-1]++; vc[b-1]++; } for(int i=0;i<vc.size();i++){ cout << vc...
a.cc: In function 'int main()': a.cc:12:16: error: 'a' was not declared in this scope 12 | cin >> a >> b; | ^ a.cc:12:21: error: 'b' was not declared in this scope 12 | cin >> a >> b; | ^
s847137719
p03720
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] a = new int[M]: int[] b = new int[M]; for(int i = 0;i < M;i++){ a[i] = sc.nextInt(); b[i] = sc.nextIny(); } for(int i = 0;i < N;i++)...
Main.java:7: error: ';' expected int[] a = new int[M]: ^ 1 error
s206214498
p03720
Java
import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int ab; int[] road = new int[n+1]; for(int i = 0;i<m*2;i++) { ab = sc.nextInt(); road[ab-1] =road[ab-...
Main.java:18: error: reached end of file while parsing } ^ 1 error
s740902775
p03720
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; int a[M], b[M]; for(int i=0; i<M; i++){ cin >> a[i] >> b[i]; } for(int i=0; i<N; i++){ cout << count(a,a+M,i) + count(b,b+M,i) << endl; }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s605349653
p03720
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; int a[M], b[M]; for(int i=0; i<M; i++){ cin >> a[i] >> b[i]; } for(int i=0; i<N; i++){ cout << count(a,i) + count(b,i) << endl; }
a.cc: In function 'int main()': a.cc:13:30: error: no matching function for call to 'count(int [M], int&)' 13 | cout << count(a,i) + count(b,i) << endl; | ~~~~~^~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:1: /usr/include/c++/14...
s827154553
p03720
C++
#include <iostream> using namespace std; int cnt[100]; int N, K; int main() { cin >> N >> K: for(int i = 0; i < K; ++i) { int a, b; cin >> a >> b; --a; --b; cnt[a]++; cnt[b]++; } for(int i = 0; i < N; ++i) { cout << cnt[i] << endl; } }
a.cc: In function 'int main()': a.cc:7:16: error: expected ';' before ':' token 7 | cin >> N >> K: | ^ | ; a.cc:8:18: error: 'i' was not declared in this scope 8 | for(int i = 0; i < K; ++i) { | ^
s184872949
p03720
C++
#include <cstdio> #include <cstdlib> #include <iostream> #include <fstream> #include <sstream> #include <set> #include <map> #include <vector> #include <list> #include <algorithm> #include <cstring> #include <cmath> #include <string> #include <queue> #include <bitset> //UWAGA - w czasie kompilacji musi byc znany ro...
a.cc:47:18: error: macro "FOR" requires 3 arguments, but only 2 given 47 | FOR(i,n+1){ | ^ a.cc:22:9: note: macro "FOR" defined here 22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i) | ^~~ a.cc: In function 'int main()': a.cc:47:9: error: 'FOR' was not declared in this ...
s168393326
p03720
C++
#include<bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; int main(){ int a,b,c,f=0; cin>>a>>b; multi_set<int>s[100]; r(i,b){ cin>>c>>f; s[c].insert(f); s[f].insert(c); } r(i,a)cout<<s[i+1].size()<<endl; }
a.cc: In function 'int main()': a.cc:7:9: error: 'multi_set' was not declared in this scope 7 | multi_set<int>s[100]; | ^~~~~~~~~ a.cc:7:19: error: expected primary-expression before 'int' 7 | multi_set<int>s[100]; | ^~~ a.cc:10:17: error: 's' was not declar...
s856278221
p03720
C++
#include<bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; int main(){ int a,b,c,f=0; cin>>a>>b; set<int>s[100]; r(i,m){ cin>>c>>f; s[c].insert(f); s[f].insert(c); } r(i,n)cout<<s[i+1].size()<<endl; }
a.cc: In function 'int main()': a.cc:8:13: error: 'm' was not declared in this scope 8 | r(i,m){ | ^ a.cc:2:30: note: in definition of macro 'r' 2 | #define r(i,n) for(int i=0;i<n;i++) | ^ a.cc:13:13: error: 'n' was not declared in this scope 13 | ...
s879954956
p03720
C++
#include<iostream> using namespace std; int n,m; int a[55],b[55],c[55]; int main() { cin>>n>>m; for(i=1;i<=n;i++) { cin>>a[i]>>b[i]; c[a[i]]++; c[b[i]]++; } for(i=1;i<=n;i++) { cout<<c[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:13: error: 'i' was not declared in this scope 8 | for(i=1;i<=n;i++) | ^ a.cc:14:13: error: 'i' was not declared in this scope 14 | for(i=1;i<=n;i++) | ^
s870938859
p03720
C++
// glory be to the sky #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m; int dg[250]; cin >> n >> m; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; ++dg[a]; ++dg[b]; } for (int i = 1; i <= n; i++) cout << ...
a.cc: In function 'int main()': a.cc:25:49: error: 'a' was not declared in this scope 25 | for (int i = 1; i <= n; i++) cout << dg[a] << endl; | ^
s622692791
p03720
C++
// glory be to the sky #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m; int dg[250]; cin >> n >> m; for (int i = 0; i < m; i++) { cin >> a >> b; ++dg[a]; ++dg[b]; } for (int i = 1; i <= n; i++) cout << dg[a] << end...
a.cc: In function 'int main()': a.cc:20:24: error: 'a' was not declared in this scope 20 | cin >> a >> b; | ^ a.cc:20:29: error: 'b' was not declared in this scope 20 | cin >> a >> b; | ^ a.cc:24:49: error: 'a' was not ...
s894301278
p03720
C++
#include<bits/stdc++.h> int main(){ int n,m,i,a; int x[51]; cin>>n>>m; for(i=1;i<=n;i++){ x[i]=0; } for(i=0;i<m*2;i++){ cin>>a; x[a]+=1; } for(i=1;i<=n;i++){ cout<<x[i]; } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n>>m; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std...
s645045502
p03720
C++
#include<bits/stdc++.h> int main(void){ int n,m,i,a; int x[51]; cin>>n>>m; for(i=1;i<=n;i++){ x[i]=0; } for(i=0;i<m*2;i++){ cin>>a; x[a]+=1; } for(i=1;i<=n;i++){ cout<<x[i] } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n>>m; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std...
s332117525
p03720
C++
N,M = map(int,input().split()) a = [] for i in range(M): x,y = input().split() a.append(x),a.append(y) for i in range(1,N+1):print(a.count(str(i)))
a.cc:1:1: error: 'N' does not name a type 1 | N,M = map(int,input().split()) | ^
s182802856
p03720
C++
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <numeric> using namespace std; const double PI = acos(-1.0); const string ALP = "abcdefghijklmnopqrstuvwxyz"; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define FOR(i,a,b) for(int i=(a);i<(...
a.cc: In function 'int main()': a.cc:20:13: error: expected ';' before '}' token 20 | c[a]++ | ^ | ; 21 | } | ~
s925863644
p03720
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { string[] s = Console.ReadLine().Split(' '); int N = int.Parse(s[0]); ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s008720068
p03720
C++
using namespace std; //-------------------------------------------- #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define LL long long #define INF INT_MAX/3 //-------------------------------------------- const doub...
a.cc:13:20: error: 'acos' was not declared in this scope 13 | const double PI = acos(-1.0); | ^~~~ a.cc: In function 'int main()': a.cc:21:3: error: 'scanf' was not declared in this scope 21 | scanf("%d %d",&n,&m); | ^~~~~ a.cc:31:14: error: 'printf' was not declared in this sc...
s479378263
p03720
C
#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); int c[a]={0}; for(int i=0;i<b;i++){ int x,y; scanf("%d%d",&x,&y); c[x-1]++; c[y-1]++; } for(int i=0;i<a;i++){ printf("%d\n",c[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int c[a]={0}; | ^
s722753886
p03720
C
#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); int c[a]={0}; for(int i=0;i<b;i++){ int x,y; scanf("%d%d",&x,&y); c[x-1]++; c[y-1]++; } for(int i=0;i<a;i++){ printf("%d\n",c[i]); } return 0; }
main.c: In function 'main': main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer 5 | int c[a]={0}; | ^
s045862542
p03720
C++
#include<iostream> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; a=a%b; c=c%b; for(int i=1;i<=b;i++){ if((a*i)%b==c){ cout<<"YES<<endl; return 0; } } cout<<"NO<<endl; return 0; }
a.cc:10:7: warning: missing terminating " character 10 | cout<<"YES<<endl; | ^ a.cc:10:7: error: missing terminating " character 10 | cout<<"YES<<endl; | ^~~~~~~~~~~ a.cc:14:7: warning: missing terminating " character 14 | cout<<"NO<<endl; | ^ a.cc:14:7: error: missing termi...
s896605777
p03720
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <queue> #include <stack> #include <functional> #include <set> #include <map> #include <deque> #include <cmath> #define WMAX 10000 #define HMAX 10000 #define NMAX 52 #define MMAX 52 //コメントアウトするとde...
a.cc: In function 'void solve()': a.cc:41:29: error: 'M' was not declared in this scope 41 | for (int i = 0; i < M; ++i) | ^ a.cc: In function 'int main()': a.cc:60:21: error: 'M' was not declared in this scope 60 | cin >> N >> M; | ^
s970928297
p03720
C++
#include<stdio.h> int n,m,p,a[50],b[50],c[50][50]; int main() { scanf("%d%d",&n,&m); for(i=0;i<m;i++){ scanf("%d%d",&a[i],&b[i]); c[a[i]][b[i]]=1; c[b[i]][a[i]]=1; } for(i=0;i<n;i++){ p=0; for(j=0;j<51;j++){ p+=c[i][j]; } printf("%d\n",p); } return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: 'i' was not declared in this scope 6 | for(i=0;i<m;i++){ | ^ a.cc:11:13: error: 'i' was not declared in this scope 11 | for(i=0;i<n;i++){ | ^ a.cc:13:21: error: 'j' was not declared in this scope 13 | ...
s921814044
p03720
C
#include<stdio.h> int main(){ int nn,mm; int ss[51][2]; int ans; int i,j; scanf("%d %d",&nn,&mm); for(i=0;i<mm;i++){ scanf("%d %d",&ss[i][0],&ss[i][1]); } for(j=1;j<=nn;j++){ ans = 0; for(i=0;i<mm;i++){ if(ss[i][0] == j) ans++; if(ss[i][1] == j) ans++; } printf("%d\n",ans); }
main.c: In function 'main': main.c:23:9: error: expected declaration or statement at end of input 23 | } | ^
s174969209
p03720
C++
#include<iostream> #include<string> using namespace std; int main(){ int a,b,c[50],d[50]; cin>>a>>b;s for(int i=0;i<b;i++){ cin>>c[i]; } for(int x=0;x<a;x++){ for(int z=0;z<b;z++){ if(c[z]==x){ d[x]++; } } } for(int y=0;y<a;y++){ cout<<d[y]<<endl; } }
a.cc: In function 'int main()': a.cc:6:19: error: 's' was not declared in this scope 6 | cin>>a>>b;s | ^ a.cc:7:21: error: 'i' was not declared in this scope 7 | for(int i=0;i<b;i++){ | ^
s993664043
p03720
C++
n, m = map(int, input().split()) nums = [] for i in range(m) : for val in map(int, input().split()): nums.append(val-1) for i in range(n): print(nums.count(i))
a.cc:1:1: error: 'n' does not name a type 1 | n, m = map(int, input().split()) | ^
s153379203
p03720
C++
2 5 1 2 2 1 1 2 2 1 1 2
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 5 | ^
s372662038
p03720
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n >> m; int map<int,int> ans; for ( int i = 0; i < m; i++) { int x,y; cin >>x >> y; ans[x]++; ans[y]++; } for ( int i = 1 ; i <= n; i++) cout << ans[i] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:26: error: invalid declarator before 'ans' 7 | int map<int,int> ans; | ^~~ a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | ans[x]++; | ^~~ | abs a.cc:16:17: error: 'a...
s985206877
p03720
C++
#include<iostream> using namespace std; int num[50]; int main(){ int A,B; cin >> A >> B >>//A都市,B道路 int n,m; int a,b cin >> n >> m; while() { cin >> a >> b; num[a]++ ; num[b]++: } for(int i=1; i <=n; i++) cout << num...
a.cc: In function 'int main()': a.cc:11:5: error: expected primary-expression before 'int' 11 | int n,m; | ^~~ a.cc:14:5: error: expected initializer before 'cin' 14 | cin >> n >> m; | ^~~ a.cc:16:11: error: expected primary-expression before ')' token 16 | while() | ...
s092987143
p03720
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int[] m_sum = new int[m]; for(int i = 0 ; i < n ; i++){ int a = scan.nextInt() - 1 int b = scan.nextInt() - 1 m_sum...
Main.java:15: error: ';' expected int a = scan.nextInt() - 1 ^ Main.java:16: error: ';' expected int b = scan.nextInt() - 1 ^ 2 errors
s461532461
p03720
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int[] m_sum = new int[m]; for(int i = 0 ; i < n ; i++){ m_sum[scan.nextInt() - 1]++: m_sum[scan.nextInt() - 1]++: ...
Main.java:15: error: ';' expected m_sum[scan.nextInt() - 1]++: ^ Main.java:16: error: ';' expected m_sum[scan.nextInt() - 1]++: ^ 2 errors
s443740881
p03720
C++
#include<iostream> using namespace std; int main(){ int ans[100]; int N,M; cin >> N >> M; for(int i=0;i<M;i+=){ int a,b; cin >> a >> b; ans[a-1]++; ans[b-1]++; } for(int i=0;i<N;i++) cout << ans[i] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: expected primary-expression before ')' token 7 | for(int i=0;i<M;i+=){ | ^
s545325809
p03720
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<math.h> #include<vector> using namespace std;   int c[50]; signed main() { int a, b; cin >> a >> b; for (int d = 0; d < b; d++) { int e, f; cin >> e >> f; c[e - 1]++; c[f - 1]++; } for (int i = 0; i < a; i++) { cout << c[i] << endl; } }
a.cc:7:1: error: extended character   is not valid in an identifier 7 |   | ^ a.cc:7:1: error: '\U000000a0' does not name a type 7 |   | ^ a.cc: In function 'int main()': a.cc:13:17: error: 'c' was not declared in this scope 13 | c[e - 1]++; c[f - 1]++; | ^ a...
s508119054
p03720
Java
//package com.zhangyong.algorithm; import java.io.*; import java.util.StringTokenizer; public class Solution { FastScanner in; PrintWriter out; class FastScanner { BufferedReader br; StringTokenizer st; private FastScanner(File f) { try { br = new Bu...
Main.java:6: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ 1 error
s877422341
p03720
C
#include <stdio.h> #define NMAX 50 int main(void) { int N, M; int A[NMAX], B[NMAX]; int road[NMAX]; int i; scanf("%d %d", N ,M); for (i = 0; i < M+ i++) { scanf("%d %d", A[i], B[i]); } for (i = 0; i < N; i++) { road[i] = 0; } for (i = 0; i < M; i++) { road[A[i] - 1]++; road[B[i] - 1]++; } ...
main.c: In function 'main': main.c:13:31: error: expected ';' before ')' token 13 | for (i = 0; i < M+ i++) { | ^ | ;
s371961742
p03720
C++
using namespace std; int main() { int N, M, metro, i; int count[50] = {}; cin >> N >> M; for (i = 0; i < M * 2; i++) { cin >> metro; count[metro - 1]++; } for (i = 0; i < N; i++) { cout << count[i] << endl; } }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> N >> M; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:11...
s812528037
p03720
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int m, n;int a[55]; ios::sync_with_stdio; while (cin >> m >> n) { memset(a, 0, sizeof(a)); for (int i = 0; i < n; i++) { int aa, bb; cin >> aa >> bb; if (aa != bb) { a[aa]++; a[bb]++; } } for (int i = 1; i <= m; i++) ...
a.cc: In function 'int main()': a.cc:9:17: error: 'memset' was not declared in this scope 9 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#...
s739984694
p03720
C++
#include<iostream> using namespace std; int main(void){ int N,M; cin >> N >> M; int town[N]; fill(town,town+N,0); for(int i = 0 ;i<M;++i){ int tmp1,tmp2; cin >> tmp1 >> tmp2; tmp1--; tmp2--; town[tmp1]++; town[tmp2]++; } for(int i = ; i < N;++i){ cout << town[i] << e...
a.cc: In function 'int main()': a.cc:23:15: error: expected primary-expression before ';' token 23 | for(int i = ; i < N;++i){ | ^
s659436682
p03720
C++
#include<string.h> int map[100][100]; int main(){ int n,m,i,a,b,j,sum; scanf("%d%d",&n,&m); memset(map,0,sizeof(map)); for(i=0;i<m;i++){ scanf("%d%d",&a,&b); map[a][b]++; map[b][a]++; } for(i=1;i<=n;i++){ sum=0; for(j=1;j<=n;j++){ sum+=map[i][j]; } printf("%d\n",sum); } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf' was not declared in this scope 5 | scanf("%d%d",&n,&m); | ^~~~~ a.cc:17:17: error: 'printf' was not declared in this scope 17 | printf("%d\n",sum); | ^~~~~~ a.cc:2:1: note: 'printf' is defined in ...
s368003853
p03720
C++
#include <iostream> #include <algorithm> #include <queue> #include <stack> #include <cmath> #include <string> #include <cstdio> #include <cstdlib> using namespace std; int main() { int m, n;int a[55]; ios::sync_with_stdio; while (cin >> m >> n) { memset(a, 0, sizeof(a)); for (int i = 0; i < n; i++) { int aa, ...
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <cstdlib> +++ |...
s610851553
p03720
C++
#include <iostream> #include <algorithm> #include <queue> #include <stack> #include <cmath> #include <string> #include <cstdio> #include <cstdlib> using namespace std; int main() { int m, n;int a[55]; ios::sync_with_stdio; while (cin >> m >> n) { memset(a, 0, sizeof(a)); for (int i = 0; i < n; i++) { int aa, ...
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(a, 0, sizeof(a)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <cstdlib> +++ |...