submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s310958138 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main( ){
int N,M;
cin>>N>>M;
vector<int>A(M),B(M);
for(int i=0;i<M;i++) {
cin>>A.at(i),B.at(i);
}
for(int i =1;i<N+1;i+=1) {
for(int j=1;j<N+1;j+=1) {
int count j = 0
if(A.at(i-1)==j || B.at(i-1)==j) {
count j +=1;
}
}
... | 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... |
s902306082 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main( ){
int N,M;
cin>>N>>M;
vector<int>A(M),B(M);
for(int i=0;i<M) {
cin>>A.at(i),B.at(i);
}
for(int i =1;i<N+1;i+=1) {
for(int j=1;j<N+1;j+=1) {
int count j = 0
if(A.at(i-1)==j || B.at(i-1)==j) {
count j +=1;
}
}
}
... | a.cc: In function 'int main()':
a.cc:7:18: error: expected ';' before ')' token
7 | for(int i=0;i<M) {
| ^
| ;
a.cc:8:22: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allo... |
s637850402 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main( ){
int N,M;
cin>>N>>M;
vector<int>A(M),B(M);
for(int i=0;i<M) {
cin>>A.at(i),B.at(i);
}
for(int i =1;i<N+1;i+=1) {
for(int j=1;j<N+1;j+=1) {
int count j = 0
if(A.at(i-1)==j || B.at(i-1)==j) {
count j +=1;
}
}
}
... | a.cc: In function 'int main()':
a.cc:7:18: error: expected ';' before ')' token
7 | for(int i=0;i<M) {
| ^
| ;
a.cc:8:22: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allo... |
s312552322 | p03720 | C++ | #include<iostream>
using namespace std;
int main(void){
int N, M, A, B;
cin >> N >> M;
int count[N];
for(int i = 0; i < N; i++){
count.at(i) = 0;
}
for(int i = 0; i < M; i++){
cin >> A >> B;
count.at(A)++;
count.at(B)++;
}
for(int i = 0; i < N; i++){
cout << count.at(i... | a.cc: In function 'int main()':
a.cc:11:11: error: request for member 'at' in 'count', which is of non-class type 'int [N]'
11 | count.at(i) = 0;
| ^~
a.cc:16:11: error: request for member 'at' in 'count', which is of non-class type 'int [N]'
16 | count.at(A)++;
| ^~
a.cc:1... |
s451364941 | p03720 | C++ | #include<iostream>
using namespace std;
int main(void){
int N, M, A, B;
vector<int> count;
cin >> N >> M;
vector<int> count = vector<int>(N, 0);
for(int i = 0; i < M; i++){
cin >> A >> B;
count.at(A)++;
count.at(B)++;
}
for(int i = 0; i < N; i++){
cout << count.at(i) << endl... | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector<int> count;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <vector>
2 | using ... |
s618361254 | p03720 | C++ | #include<iostream>
using namespace std;
int main(void){
int N, M, A, B;
int count;
cin >> N >> M;
vector<int> count = vector<int>(N, 0);
for(int i = 0; i < M; i++){
cin >> A >> B;
count.at(A)++;
count.at(B)++;
}
for(int i = 0; i < N; i++){
cout << count.at(i) << endl;
}
... | a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
10 | vector<int> count = vector<int>(N, 0);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <v... |
s510570774 | p03720 | C++ | #include<iostream>
using namespace std;
int main(void){
int N, M, A, B;
cin >> N >> M;
vector<int> count = vector<int>(N, 0);
for(int i = 0; i < M; i++){
cin >> A >> B;
count.at(A)++;
count.at(B)++;
}
for(int i = 0; i < N; i++){
cout << count.at(i) << endl;
}
return 0;
... | a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
9 | vector<int> count = vector<int>(N, 0);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <ve... |
s568358879 | p03720 | C++ | #include<iostream>
using namespace std;
int main(void){
int N, M, A, B;
cin >> N >> M;
vector<int> count(N, 0);
for(int i = 0; i < M; i++){
cin >> A >> B;
count.at(A)++;
count.at(B)++;
}
for(int i = 0; i < N; i++){
cout << count.at(i) << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
9 | vector<int> count(N, 0);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <vector>
2 | ... |
s537645685 | p03720 | C++ | #include<ioatream>
using namespace std;
int main(void){
int N, M, A, B;
cin >> N >> M;
vector<int> count(N, 0);
for(int i = 0; i < M; i++){
cin >> A >> B;
count.at(A)++;
count.at(B)++;
}
for(int i = 0; i < N; i++){
cout << count.at(i) << endl;
}
return 0;
} | a.cc:1:9: fatal error: ioatream: No such file or directory
1 | #include<ioatream>
| ^~~~~~~~~~
compilation terminated.
|
s042464957 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N >> M;
vector<int> v(N);
int j;
0 < j < N;
for(int i = 0;i < M;i++){
int X;
cin >> x;
if(x = j){
v.at(j)++;
}
}
for(int i = 0;i < M;i++){
cout << v.at(j) << endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:12: error: 'x' was not declared in this scope
13 | cin >> x;
| ^
|
s718771362 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int m, n;
int buckets[50];
int main(){
cin>>n>>m;
int city[2*m];for(int i=0;i<m;i++)cin>>city[i]>>city[m+i];
for(int i=0;city[i];i++){buckets[city[i]]++;}
for(int i=1;i<=n;i++){cout<<buckets[i]<<"\n"};
}
| a.cc: In function 'int main()':
a.cc:9:47: error: expected ';' before '}' token
9 | for(int i=1;i<=n;i++){cout<<buckets[i]<<"\n"};
| ^
| ;
|
s783955657 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int m, n;
int buckets[50];
int main(){
cin>>n>>m;
int city[2*m];for(int i=0;i<2*m;i++)cin>>city[i];
for(int i=0;city[i];i++){buckets[city[i]]++;}
for(int i=0;i<N;i++)cout<<buckets[i]<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:17: error: 'N' was not declared in this scope
9 | for(int i=0;i<N;i++)cout<<buckets[i]<<endl;
| ^
|
s871576381 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int m, n;
int buckets[50];
int main(){
cin>>n>>m;
int city[2*m];for(int i=0;i<2*m;i++)cin>>city[i];
for(int i=0;city[i];i++){bucket[city[i]]++;}
for(int i=0;i<N;i++)cout<<bucket[i]<<endl;
} | a.cc: In function 'int main()':
a.cc:8:28: error: 'bucket' was not declared in this scope; did you mean 'buckets'?
8 | for(int i=0;city[i];i++){bucket[city[i]]++;}
| ^~~~~~
| buckets
a.cc:9:17: error: 'N' was not declared in this scope
9 | fo... |
s875406066 | p03720 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
vector<vector<int>> V(N,vector<int>(N,0));
for(int i = 0; i < M; i++){
int a, b;
cin >> a >> b;
a--, b--;
V[a][b]++;
V[b][a]++;
}
for(int i = 0; i < N; i++){
int t = 0;
for(int... | a.cc: In function 'int main()':
a.cc:22:19: error: expected ';' before '}' token
22 | t += V[i][j]
| ^
| ;
23 | }
| ~
|
s469453483 | p03720 | C++ | #include <isotream>
#include <vector>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
vector<vector<int>> V(N,vector<int>(N,0));
for(int i = 0; i < M; i++){
int a, b;
cin >> a >> b;
a--, b--;
V[a][b]++;
V[b][a]++;
}
for(int i = 0; i < N; i++){
int t = 0;
for(int... | a.cc:1:10: fatal error: isotream: No such file or directory
1 | #include <isotream>
| ^~~~~~~~~~
compilation terminated.
|
s732954700 | p03720 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
int a,b;
cin>>a>>b;
vector<vector<int>> c(2,vector<int>(b));
rep(i,2){
rep(j,b)
cin>>... | a.cc: In function 'int main()':
a.cc:20:25: error: 'k' was not declared in this scope
20 | if(c.at(i).at(j)==k)
| ^
|
s216007985 | p03720 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
int a,b;
cin>>a>>b;
vector<vector<int>> c(2,vector<int>(b));
rep(i,2){
rep(j,b)
cin>>... | a.cc: In function 'int main()':
a.cc:20:12: error: request for member 'at' in 'a', which is of non-class type 'long long int'
20 | if(a.at(i).at(j)==k)
| ^~
|
s763970201 | p03720 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,... | a.cc: In function 'int main()':
a.cc:47:39: error: no matching function for call to 'std::vector<int>::resize()'
47 | REP(i, M) { cout << edge[i].resize() << endl; }
| ~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/fun... |
s976936521 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N >> M;
for(int i = 0; i < M; i++) {
vector<int> vec(2);
cin >> vec(0) >> vec(1);
int count = 0;
for(int j = 0; j < N; j++) {
if(vec.at(0) == j || vec.at(1) == j) {
count ++ ;
}
cout << count... | a.cc: In function 'int main()':
a.cc:10:15: error: no match for call to '(std::vector<int>) (int)'
10 | cin >> vec(0) >> vec(1);
| ~~~^~~
a.cc:10:25: error: no match for call to '(std::vector<int>) (int)'
10 | cin >> vec(0) >> vec(1);
| ~~~^~~
|
s472604674 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N >> M;
for(int i = 0; i < M; i++) {
vector<int> vec(2);
cin >> vec(0) >> vec(1);
int count = 0;
for(int j = 0; j < N; j++) {
if(vec(0) == j || vec(1) == j) {
count ++ ;
}
cout << count << en... | a.cc: In function 'int main()':
a.cc:10:15: error: no match for call to '(std::vector<int>) (int)'
10 | cin >> vec(0) >> vec(1);
| ~~~^~~
a.cc:10:25: error: no match for call to '(std::vector<int>) (int)'
10 | cin >> vec(0) >> vec(1);
| ~~~^~~
a.cc:14:13: error:... |
s118724496 | p03720 | C++ | #include<iostream>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
int c[n];
memset(c,0,n);
for(int i=0;i<m;i++){
int a,b;
cin >> a >> b;
c[a-1] ++;
c[b-1] ++;
}
for(int i=0;i<n;i++){
cout << c[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'memset' was not declared in this scope
8 | memset(c,0,n);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | using na... |
s596057007 | p03720 | C | import java.util.* ;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner (System.in);
int x = scan.nextInt() ;
int y = scan.nextInt() ;
int a[] = new int[y];
int b[] =new int[y];
for(int i = 0 ; i< y ;i++){
a[i] = scan.nextInt();
b[i] =scan.nextInt() ... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.* ;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.* ;
| ^
main.c:2:1: error: unknown type name 'class'
2 | class Main {
| ^~~~~
main.c:2:12: e... |
s074540199 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, i;
cin >> N >> M;
vector<int> count(N, 0);
for (i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
if (i == a || i == b) {
count.at(i)++;
}
}
for (i = 0; i < N; i++) {
cout << count.at(i);
}
}
| a.cc: In function 'int main()':
a.cc:6:15: error: 'M' was not declared in this scope
6 | cin >> N >> M;
| ^
|
s042278362 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N >> M;
vector<int> count(N, 0);
for (i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
if (i == a || i == b) {
count.at(i)++;
}
}
for (i = 0; i < N; i++) {
cout << count.at(i);
}
}
| a.cc: In function 'int main()':
a.cc:6:15: error: 'M' was not declared in this scope
6 | cin >> N >> M;
| ^
a.cc:10:8: error: 'i' was not declared in this scope
10 | for (i = 0; i < M; i++) {
| ^
a.cc:19:8: error: 'i' was not declared in this scope
19 | for (i = 0; i < N... |
s621736040 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; // 都市の数
int M; // 道の数
vector<int> road(N); // 都市Nに接続している道の数
vector<int> city(2); // ある道がつなぐ2都市
cin >> N >> M;
int i,j,k; //カウンタ変数
for (i=0; i<M; i++) {
cin >> city.at(0) >> city.at(1);
for (j=0; j<N; j++){
if(city.at... | a.cc: In function 'int main()':
a.cc:27:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
27 | cin >> road.at(k) >> endl;
| ~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr... |
s771286185 | p03720 | C | #include<stdio.h>
int main(){
int a[50],b[50],n,m,ans[50];
for(int i=1; i<=50; i++){
ans[i]=0;
}
scanf("%d%d",&n, &m);
for(i=1; i<m; i++){
scanf("%d%d", &a[i],&b[i]);
ans[a[i]]++;
ans[b[i]]++;
}
for(i=1; i<=n; i++){
printf("%d\n",ans[i]);
}
return 0;
}
| main.c: In function 'main':
main.c:10:7: error: 'i' undeclared (first use in this function)
10 | for(i=1; i<m; i++){
| ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
|
s365872734 | p03720 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = n; i > 0; i--)
#define rep3(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep4(i, s, e) for (int i = (e); i < (int)(s); i--)
int main() {
int n, m;
int a,... | a.cc: In function 'int main()':
a.cc:21:25: error: no match for call to '(std::vector<int>) (int&)'
21 | cout << road_num(i) << endl;
| ~~~~~~~~^~~
|
s097702249 | p03720 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
#include <string>
#include <sstream>
#include <list>
//#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
/*
int cmp(shi a,shi b)
{
return a.x<b.x;
}
long long cmd(long long a, long lo... | a.cc:27:10: error: 'n' was not declared in this scope; did you mean 'yn'?
27 | int loda[n+1][n+1]={0};
| ^
| yn
a.cc:27:15: error: 'n' was not declared in this scope; did you mean 'yn'?
27 | int loda[n+1][n+1]={0};
| ^
| yn
a.cc: In function 'i... |
s804094491 | p03720 | C++ | #include"bits/stdc++.h"
using namespace std;
int main(){
int N,M;
cin>>N>>M;
vector<int> S(M);
int X,Y;
for(int i=0;i<M){
cin >> X >> Y >> endl;
}
| a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before ')' token
8 | for(int i=0;i<M){
| ^
| ;
a.cc:9:19: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved ov... |
s636354586 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i) = 0; i < (n); i++)
int main(){
int n, m, a, b, x[50] = {}
cin >> n >> m;
rep(i, m) {
cin >> a >> b;
x[a]++;
x[b]++;
}
rep(i, n) cout << x[i] << endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'cin'
7 | cin >> n >> m;
| ^~~
|
s589274298 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N>> M;
// N要素の配列
// 入力処理
for (int i = 0; i < N; i++) {
int sum=0;
for (int j = 0; j < M; j++) {
vector<int> A(2);
cin >> A.at(0)>>A.at(1);
if(i+1==A.at(0) || i+1==A.at(1))
sum+=1;
}
cout << sum << ... | a.cc: In function 'int main()':
a.cc:19:4: error: expected '}' at end of input
19 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s961268007 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N >> M;
vector<int> vec(2M);
for(int i = 0 ; i < 2M ; i++){
cin >> vec.at(i);
}
for(int j = 0 ; j < N ; j++){
int sum = 0;
for(int k = 0 ; k < 2M ; k++ ){
if(vec.at(k) == j){
sum += 1;
}
... | a.cc: In function 'int main()':
a.cc:8:19: error: unable to find numeric literal operator 'operator""M'
8 | vector<int> vec(2M);
| ^~
a.cc:10:23: error: unable to find numeric literal operator 'operator""M'
10 | for(int i = 0 ; i < 2M ; i++){
| ^~
a.cc:16:2... |
s647005992 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
int jk=0;
vector<int>vec(m*2);
for(int i=0;i <m*2;i++){
cin >> vec.at(i);
}
for(int a=0;a < n;a++){
for(int i =0;i < vec.size();i++){
if(vec.at(i) == a){
jk++;
}
}
cout << jk << endl;
jk = 0;
} | a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s345166117 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin>>N>>M;
vector<int> D(N);
vector<int> A(2);
for(int i=0;i<M;i++){
cin>>A.at(o)>>A.at(1);
D.at(A.at(0))++;
D.at(A.at(1))++;
}
for(int i=0;i<N;i++){
cout<<.at(i)<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:10:15: error: 'o' was not declared in this scope
10 | cin>>A.at(o)>>A.at(1);
| ^
a.cc:15:11: error: expected primary-expression before '.' token
15 | cout<<.at(i)<<endl;
| ^
|
s224900358 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin>>N>>M;
vector<int> D(N);
vector<int> A(2);
for(int i=0;i<M;i++){
cin>>A.at(o)>>A.at(1);
D.at(A.at(0))++;
D.at(A.at(1))++;
}
for(iny i=0;i<N;i++){
cout<<.at(i)<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:10:15: error: 'o' was not declared in this scope
10 | cin>>A.at(o)>>A.at(1);
| ^
a.cc:14:7: error: 'iny' was not declared in this scope; did you mean 'int'?
14 | for(iny i=0;i<N;i++){
| ^~~
| int
a.cc:14:15: error: 'i' was not ... |
s010417681 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N M;
cin >> N >> M;
vector<int> ans(N);
for(int i=0;i<M;i++){
int a, b;
cin >> a >> b;
for(int j=0;j<N;j++){
if(ans.at(j)==a||ans.at(j)==a) ans.at(j)++;
}
}
for(int i=0;i<N;i++) cout << ans.at(i) << endl;
} | a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'M'
5 | int N M;
| ^
a.cc:6:10: error: 'N' was not declared in this scope
6 | cin >> N >> M;
| ^
a.cc:6:15: error: 'M' was not declared in this scope
6 | cin >> N >> M;
| ^
|
s146280864 | p03720 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n,m;
cin>>n>>m;
vector<int>v[n+2];
for(int i=0;i<m;i++)
{
int x,y;
cin>>x>>y;
v[x].push_back(y);
v[y].push_back(x);
}
for(int i=1;i<n+1;i++)cout<<v[i].size();<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:45: error: expected primary-expression before '<<' token
15 | for(int i=1;i<n+1;i++)cout<<v[i].size();<<endl;
| ^~
|
s732966837 | p03720 | C++ | // In His Name
#include <Bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ll long long
#define gcd __gcd
using namespace std;
typedef pair<int, int> pii;
const int MAX = 100;
int n, m, deg[MAX];
int main(){
ios_base::sync_with_stdio(0);
cin >> n >> m;
for (int i = 0 ; i < m ; i++){
... | a.cc:3:10: fatal error: Bits/stdc++.h: No such file or directory
3 | #include <Bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s505590516 | p03720 | C++ | // In His Name
#include <Bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ll long long
#define gcd __gcd
using namespace std;
typedef pair<int, int> pii;
const int MAX = 100;
int n, m, deg[MAX];
int main(){
ios_base::sync_with_stdio(0);
cin >> n >> m;
for (int i = 0 ; i < m ; i++){
... | a.cc:3:10: fatal error: Bits/stdc++.h: No such file or directory
3 | #include <Bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s882544834 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
cin >> N >> M;
int a[M*2];
for(int i=0;i<M*2; ++i) cin >> a[i];
int tmp = {0};
for(int i=0;i<M*2;++i) {
tmp[a[i]]++;
}
for(int i=1;i<=N;++i) {
cout << tmp[i] << endl;
}
} | a.cc: In function 'int main()':
a.cc:11:12: error: invalid types 'int[int]' for array subscript
11 | tmp[a[i]]++;
| ^
a.cc:14:20: error: invalid types 'int[int]' for array subscript
14 | cout << tmp[i] << endl;
| ^
|
s264566569 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, i, a;
cin >> n >> m;
vector<int> x(n);
for(i = 0; i < 2 * m; i++){
cin >> a;
x.at(a - 1)++;
}
printf(x);
} | a.cc: In function 'int main()':
a.cc:14:10: error: cannot convert 'std::vector<int>' to 'const char*'
14 | printf(x);
| ^
| |
| std::vector<int>
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
... |
s747470247 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, i, a;
cin >> n >> m;
vector<int> x(n);
for(i = 0; i < 2 * m; i++){
cin >> a;
x.at(a - 1)++;
}
print(x);
} | a.cc: In function 'int main()':
a.cc:14:3: error: 'print' was not declared in this scope; did you mean 'rint'?
14 | print(x);
| ^~~~~
| rint
|
s004278388 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,m,sub;
cin >> n >> m;
vector<int> t(n);
for(int i = 0; i < m; i++){
cin >> sub;
t(sub - 1)++;
cin >> sub;
t(sub - 1)++;
}
for(int i = 0; i < n; i++){
cout << t(i) << endl;
}
}
| a.cc: In function 'int main()':
a.cc:10:6: error: no match for call to '(std::vector<int>) (int)'
10 | t(sub - 1)++;
| ~^~~~~~~~~
a.cc:12:6: error: no match for call to '(std::vector<int>) (int)'
12 | t(sub - 1)++;
| ~^~~~~~~~~
a.cc:15:14: error: no match for call to '(std::vector<int>... |
s072032877 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int M,N;
int i;
cin >> N >> M;
vector<int> a(M);
vector<int> b(M);
for(i=0; i<M; i++){
cin >> a.at(i);
cin >> b.at(i);
}
int count;
for(i=0; i<M; i++){
if(a.at(i)==i+1)
count++;
if(b.at(i)==i+1)
count++;
cout ... | a.cc: In function 'int main()':
a.cc:22:12: error: expected ';' before '}' token
22 | count=0
| ^
| ;
23 | }
| ~
|
s656874737 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int M,N;
cin >> N >> M;
vector<int> a(M);
vector<int> b(M);
for(i=0; i<M; i++){
cin >> a.at(i);
cin >> b.at(i);
}
int count;
for(i=0; i<M; i++){
if(a.at(i)==i+1)
count++;
if(b.at(i)==i+1)
count++;
cout << count ... | a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
10 | for(i=0; i<M; i++){
| ^
a.cc:15:7: error: 'i' was not declared in this scope
15 | for(i=0; i<M; i++){
| ^
a.cc:21:12: error: expected ';' before '}' token
21 | count=0
| ^
... |
s676790444 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
const int NMAMX = 50;
int A[NMMAX], B[NMMAX];
for (int i = 0; i < M; ++i) {
cin >> A[i] >> B[i];
}
int road[NMMAX];
for (int i = 0; i < N; ++i) {
road[i] = 0;
}
for (int i = 0; i < M; ++i) {
road[A[i... | a.cc: In function 'int main()':
a.cc:9:9: error: 'NMMAX' was not declared in this scope; did you mean 'NMAMX'?
9 | int A[NMMAX], B[NMMAX];
| ^~~~~
| NMAMX
a.cc:12:12: error: 'A' was not declared in this scope
12 | cin >> A[i] >> B[i];
| ^
a.cc:12:20: error: 'B' ... |
s372251748 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
cin >> N >> M;
int a[N]={};
for(int i=0;i<M;i++){
int a,b;
cin >> a >> b;
a[a]++;
a[b]++;
}
for(int i=0;i<N;i++){
cout << a[i] << endl;
}
}
| a.cc: In function 'int main()':
a.cc:11:6: error: invalid types 'int[int]' for array subscript
11 | a[a]++;
| ^
a.cc:12:6: error: invalid types 'int[int]' for array subscript
12 | a[b]++;
| ^
|
s986283395 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<vector<int>> city(m, vector(2));
for(int i=0; i<m; i++){
for(int j=0; j<2; j++){
cin >> city.at(i).at(j);
}
}
vector<int> num(n) = {0};
for (int i=0; i<m; i++){
for (int j=0; j<2; j++){
... | a.cc: In function 'int main()':
a.cc:8:39: error: class template argument deduction failed:
8 | vector<vector<int>> city(m, vector(2));
| ^
a.cc:8:39: error: no matching function for call to 'vector(int)'
In file included from /usr/include/c++/14/vector:66,
... |
s096180879 | p03720 | C++ | #include <iostream>
using namespace std;
int a[51]
int main(){
int n,m;cin>>n>>m;
for(int i = 0; m > i; i++){
int c,d;cin>>c>>d;
a[c-1]++;
a[d-1]++;
}
for(int i = 0; m > i; i++){
cout << a[i] << endl;
}
}
| a.cc:4:1: error: expected initializer before 'int'
4 | int main(){
| ^~~
|
s403425851 | p03720 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
//都市の数,Nを定義
int M;
//道路の数,Mを定義
cin >> N >> M;
//N,Mの順で標準入力
vector <int> num(N);
for (int i = 0; i < M; i++){
int Na;
//他の都市Na
int Nb;
//他の都市Nb
//それぞれの都市が他の都市に繋がる道路を何本もっ... | a.cc: In function 'int main()':
a.cc:26:29: error: 'class std::vector<int>' has no member named 'length'
26 | for (int i = 0; i < num.length(); i++){
| ^~~~~~
|
s916613768 | p03720 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
//都市の数,Nを定義
int M;
//道路の数,Mを定義
cin >> N >> M;
//N,Mの順で標準入力
vector <int> num(N);
for (int i = 0; i < M; i++){
int Na;
//他の都市Na
int Nb;
//他の都市Nb
//それぞれの都市が他の都市に繋がる道路を何本もっ... | a.cc: In function 'int main()':
a.cc:23:14: error: 'Mb' was not declared in this scope; did you mean 'Nb'?
23 | num [Mb-1]++;
| ^~
| Nb
a.cc:26:29: error: 'class std::vector<int>' has no member named 'length'
26 | for (int i = 0; i < num.length(); i++){
| ... |
s860671515 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> city(N);
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
++city.at(a - 1);
++city.at(b - 1);
}
cor (int i = 0; i < N; i++) {
cout << city.at(i) << endl;
} | a.cc: In function 'int main()':
a.cc:18:8: error: expected primary-expression before 'int'
18 | cor (int i = 0; i < N; i++) {
| ^~~
a.cc:18:19: error: 'i' was not declared in this scope
18 | cor (int i = 0; i < N; i++) {
| ^
a.cc:20:2: error: expected '}' at end of input
... |
s604674756 | p03720 | C++ | #include<iostream>
using namespace::std;
int main(){
int n,m;
cin>>n>>m;
vector<int> v[n+5];
for(int i=0,l,r;i<m;i++)
cin>>l>>r,v[l].push_back(r),v[r].push_back(l);
for(int i=1;i<=n;i++)
cout<<v[i].size()<<'\n';
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
8 | vector<int> v[n+5];
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <vector>
2 |
a.cc... |
s495413253 | p03720 | C++ |
int main() {
int N, M;
cin >> N >> M;
vector<int> vec(M*2);
for(int i = 0; i < M*2; i++){
int c;
cin >> c;
vec.at(i) = c;
}
vector<int> veca(M);
for(int i = 0; i< M; i++){
veca.at(i) = vec.at(i*2);
}
vector<int> vecb(M);
for(int i = 0; i< M; i++){
vecb.at(i) ... | a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin >> N >> M;
| ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector<int> vec(M*2);
| ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
6 | vector<int> vec(M*2)... |
s642831067 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
cin>>N>>M;
vector<int>a(M);
vector<int>b(M);
vector<int>ans(N);
for(int i=0;i<M;i++){
cin>>a.at(i)>>b.at(i);
for(int j==0;j<N;j++){
if(a.at(i)==j+1){
ans.at(j)++;
}
}
for(int k=0;k<N;k++){
if(b.at(i)==... | a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before '==' token
12 | for(int j==0;j<N;j++){
| ^~
| ;
a.cc:12:14: error: expected primary-expression before '==' token
12 | for(int j==0;j<N;j++){
| ^~
a.cc:12:21: error: expected ')' ... |
s384958186 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int aab;
cin >> a >> b;
vector<int> A(2*b);
for (int i=1;i<=a;i++) {
int c=0;
for(int j=0;j<2*b;j++) {
cin >> A[j];
if (A[j]==i)
c++;
}
cout << c << endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin >> a >> b;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin >> a >> b;
| ^
|
s042358100 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a、b;
cin >> a >> b;
vector<int> A(2*b);
for (int i=1;i<=a;i++) {
int c=0;
for(int j=0;j<2*b;j++) {
cin >> A[j];
if (A[j]==i)
c++;
}
cout << c << endl;
}
} | a.cc:4:7: error: extended character 、 is not valid in an identifier
4 | int a、b;
| ^
a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin >> a >> b;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin >> a >> b;
| ... |
s243023137 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n、m;
cin >> n >> m;
int a[2*m];
for (int i=1;i<=n;i++) {
int c=0;
for(int j=0;j<2*m;j++) {
cin >> a[j];
if (a[j]==i)
c++;
}
cout << c << endl;
}
}
| a.cc:4:7: error: extended character 、 is not valid in an identifier
4 | int n、m;
| ^
a.cc: In function 'int main()':
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
5 | cin >> n >> m;
| ^
| yn
a.cc:5:15: error: 'm' was not declared in this s... |
s282156348 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n、m;
cin >> n >> m;
int a[2*m];
for (int i=0;i<=n;i++) {
int c=0
for(int j=0;j<2*m;j++) {
cin >> a;
if (a[j]==i)
c++;
}
cout << c << endl;
}
}
| a.cc:4:7: error: extended character 、 is not valid in an identifier
4 | int n、m;
| ^
a.cc: In function 'int main()':
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
5 | cin >> n >> m;
| ^
| yn
a.cc:5:15: error: 'm' was not declared in this s... |
s226779121 | p03720 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n、m; cin >> n >> m;
vector<int> a(2*m);
for (int i=0;i<m;i++) {
int c=0
for(int j=0;j<2*m;j++) {
cin >> a;
if (a.at(j)==i)
c++;
}
cout << c << endl;
}
}
| a.cc:5:7: error: extended character 、 is not valid in an identifier
5 | int n、m; cin >> n >> m;
| ^
a.cc: In function 'int main()':
a.cc:5:20: error: 'n' was not declared in this scope
5 | int n、m; cin >> n >> m;
| ^
a.cc:5:25: error: 'm' was not declared in this scope; ... |
s226002053 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
vector<int> A(2*M);
for(int i=0;i<2*M;i++){
cin >> A.at(i);
}
vector<int> B(N);
for(int i=1;i<N+1;i++){
int count=0;
for(int j=0;j<N;j++){
if(A.at(j)==i){
count++
}
}
B.at(i-1)=count;
}
} | a.cc: In function 'int main()':
a.cc:15:16: error: expected ';' before '}' token
15 | count++
| ^
| ;
16 | }
| ~
|
s494596438 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;cin>>N>>M;
int a;
vector<int> t(N);
for(int i=0;i<2*M;i++){
cin>>a;
for(int j=0;k<N;j++){
if(j==a){
t.at(j)++;
break;
}
}
}
for(int i=0;i<N;i++)cout<<t.at(i)<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'k' was not declared in this scope
9 | for(int j=0;k<N;j++){
| ^
|
s370574201 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;cin>>N>>M;
int a;
ventor<int> t(N);
for(int i=0;i<M;i++){
cin>>a;
for(int j=0;k<N;j++){
if(j==a){
t.at(j)++;
break;
}
}
}
for(int i=0;i<N;i++)cout<<t.at(i)<<endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'ventor' was not declared in this scope
6 | ventor<int> t(N);
| ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
6 | ventor<int> t(N);
| ^~~
a.cc:9:17: error: 'k' was not declared in this scope
9 | for(int j=0;k... |
s885285368 | p03720 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
typed... | a.cc: In function 'int main()':
a.cc:35:40: error: expected ';' before '}' token
35 | count++
| ^
| ;
36 | }
| ~
a.cc:38:40... |
s210562535 | p03720 | C++ | #include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int c[n];
for(int i=0;i<m*2;i++){
int a;
cin>>a;
c[a-1]++;
}
for(int j=0;j<n;j++) cout<<c[i]<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:32: error: 'i' was not declared in this scope
15 | for(int j=0;j<n;j++) cout<<c[i]<<endl;
| ^
|
s228626692 | p03720 | C++ | #include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int c[n];
for(int i=0;i<m*2;i++){
int a;
cin>>a;
s[a-1]++;
}
for(int j=0;j<n;j++) cout<<c[i]<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 's' was not declared in this scope
12 | s[a-1]++;
| ^
a.cc:15:32: error: 'i' was not declared in this scope
15 | for(int j=0;j<n;j++) cout<<c[i]<<endl;
| ^
|
s386908788 | p03720 | C++ | #include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int c[n];
for(int i=0;i<m*2;i++){
int a;
cin>>a;
s[a-1]++;
}
for(int j=0;j<n;j++) cout<<s[i]<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 's' was not declared in this scope
12 | s[a-1]++;
| ^
a.cc:15:30: error: 's' was not declared in this scope
15 | for(int j=0;j<n;j++) cout<<s[i]<<endl;
| ^
a.cc:15:32: error: 'i' was not declared in this scope
... |
s232787542 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> L(2M);
for(int i=0; i<M; i++) {
cin >> L[2i] >> L[2i+1];
}
for(int i=1; i<=N; i++) {
int X=0;
for(int j=0; j<M; j++) {
if(L[2j] == i || L[2j+1] == i) {
X++;
}
}
cout << X ... | a.cc: In function 'int main()':
a.cc:7:17: error: unable to find numeric literal operator 'operator""M'
7 | vector<int> L(2M);
| ^~
a.cc:9:13: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'std::complex<double>')
9 | cin >> L[2i] >> L[2i+1];
| ... |
s967186884 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int n[50], m[50];
for(int i = 0; i < m; i++) {
cin >> a[i] >> b[i];
}
int road[50];
for(int i = 0; i < n; i++) {
road[i] = 0;
}
for(int i = 0; i < m; i++) {
road[a[i] - 1] = 1;
road[b[i] - 1] = 1;
}
... | a.cc: In function 'int main()':
a.cc:7:7: error: conflicting declaration 'int n [50]'
7 | int n[50], m[50];
| ^
a.cc:5:7: note: previous declaration as 'int n'
5 | int n, m;
| ^
a.cc:7:14: error: conflicting declaration 'int m [50]'
7 | int n[50], m[50];
| ^
... |
s700602614 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N >> M;
vector<int> num(N);
for (int i=0; i<M; i++) {
cin >> a >> b;
num[a-1]++;
num[b-1]++;
}
for (int i=0; i<N; i++) {
cout << num[i] << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:12: error: 'a' was not declared in this scope
9 | cin >> a >> b;
| ^
a.cc:9:17: error: 'b' was not declared in this scope
9 | cin >> a >> b;
| ^
|
s856279903 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
int i;
int path;
cin >> N >> M;
vector<int> town(N,0);
for(i=0;i<M;i++){
cin >> path;
town.at(path) += 1;
cin >> path;
town.at(path) += 1;
}
for(i=0;i<N;i++){
cout << town.at(i);
}
}
}
| a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s998540556 | p03720 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:256:7: error: no match for 'operator--' (operand type is 'std::vector<int>')
256 | -- a;
| ^~~~
a.cc:257:7: error: no match for 'operator--' (operand type is 'std::vector<int>')
257 | -- b;
| ^~~~
a.cc:259:8: error: no match for 'operator[]' (... |
s722769733 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> a(M*2);
vector<int> b(N);
for (int i = 0; i < M*2; i++) {
cin >> a.at(i);
for (int j = 0; j < N; j++) {
if (a.at(i) = j + 1) {
b.at(j)++;
}
}
}
for (int k = 0)... | a.cc: In function 'int main()':
a.cc:20:17: error: expected ';' before ')' token
20 | for (int k = 0); k < N; k++) {
| ^
| ;
a.cc:20:17: error: expected primary-expression before ')' token
a.cc:20:17: error: expected ';' before ')' token
20 | for (int k = 0); k < N;... |
s980145378 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> a(M*2);
vector<int> b(N);
for (int i = 0; i < M*2; i++) {
cin >> a.at(i);
for (int j = 0; j < N; j++) {
if (a.at(i) = j + 1) {
b.at(j)++
}
}
}
for (int k = 0);... | a.cc: In function 'int main()':
a.cc:16:18: error: expected ';' before '}' token
16 | b.at(j)++
| ^
| ;
17 | }
| ~
a.cc:20:17: error: expected ';' before ')' token
20 | for (int k = 0); k < N; k++) {
| ^
... |
s913154674 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector(int) a(M*2);
vector(int) b(N);
for (int i = 0; i < M*2; i++) {
cin >> a.at(i);
for (int j = 0; j < N; j++) {
if (a.at(i) = j + 1) {
b.at(j)++
}
}
}
for (int k = 0);... | a.cc: In function 'int main()':
a.cc:8:9: error: missing template arguments before '(' token
8 | vector(int) a(M*2);
| ^
a.cc:8:10: error: expected primary-expression before 'int'
8 | vector(int) a(M*2);
| ^~~
a.cc:9:9: error: missing template arguments before '(' token
9 | ... |
s795672950 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<int> u(m*2);
int s =0;
for(int i =0; i <m*2 ;i++){
cin >> u.at(i);
}
for(int j =0; j <n; j++) {
if(j == u.at(i) ) {
s++;
cout << s << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:14:20: error: 'i' was not declared in this scope
14 | if(j == u.at(i) ) {
| ^
|
s719401782 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<int> u(m*2);
int s =0;
for(int i =0; i <m*2 ;i++){
cin >> u.at(i);
for(int j =0; j <n; j++) {
if(j == u.at(i) ) {
s++
}
cout << s << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:14:12: error: expected ';' before '}' token
14 | s++
| ^
| ;
15 | }
| ~
|
s867998610 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<int> u(n);
for(int i = 0; i<n; i++) {
u.at(i) = 0;
}
for(int i =0; i < m; i++) {
vector<int> v(2);
cin >> v.at(0) >> v.at(2);
for(int j =0; j < n; j++) {
if ( j == v.at(0) ) {
u.at(j)... | a.cc: In function 'int main()':
a.cc:17:18: error: expected ';' before '}' token
17 | u.at(j)++
| ^
| ;
18 | }
| ~
a.cc:20:18: error: expected ';' before '}' token
20 | u.at(j)++
| ^
| ... |
s194966803 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vecort<int> u(n);
for(int i = 0; i<n; i++) {
u.at(i) = 0;
}
for(int i =0; i < m; i++) {
vector<int> v(2);
cin >> v.at(0) >> v.at(2);
for(int j =0; j < n; j++) {
if ( j == v.at(0) ) {
u.at(j)... | a.cc: In function 'int main()':
a.cc:7:3: error: 'vecort' was not declared in this scope
7 | vecort<int> u(n);
| ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
7 | vecort<int> u(n);
| ^~~
a.cc:9:5: error: 'u' was not declared in this scope
9 | u.at(i) = 0;
... |
s883824233 | p03720 | C++ | #include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>
#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
using namespace std;
int n;
int a[200000];
int main(){
cin >> n >> m;
REP(i,m){
int ... | a.cc: In function 'int main()':
a.cc:21:15: error: 'm' was not declared in this scope; did you mean 'tm'?
21 | cin >> n >> m;
| ^
| tm
|
s056369217 | p03720 | C++ | #include<algorithm>
#include<cmath>
#include<cstdio>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<sstream>
#include<stack>
#include<string>
#include<unordered_set>
#include<vector>
#define ll long long
#define P pair<int,int>
#define FOR(i,N) for(int i=0;i<(int)N;i++)
#define FORIN(i,a,b... | a.cc:125:11: error: macro "GI" passed 2 arguments, but takes just 1
125 | GI(N,M);
| ^
a.cc:20:9: note: macro "GI" defined here
20 | #define GI(name) int (name);scanf("%d",&(name))
| ^~
a.cc: In function 'int main()':
a.cc:125:5: error: 'GI' was not declared in this scope
125 | ... |
s579191433 | p03720 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int N, M, a, b;
cin >> N >> M;
int counter[55] = {0};//バケット
for (int i = 0; i < M; i++){
cin >> a >> b;
counter[a]++;
counter[b]++;
//cout << endl;
}
for (int i = 1; i < N + 1; i++){
cout << counter[i] << endl;
} | a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s902691330 | p03720 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int N, M, a, b;
cin >> N >> M;
int counter[55] = {0];//バケット
for (int i = 0; i < M; i++){
cin >> a >> b;
counter[a]++;
counter[b]++;
//cout << endl;
}
for (int i = 1; i < N + 1; i++){
cout << counter[i] << endl;
} | a.cc: In function 'int main()':
a.cc:7:23: error: expected '}' before ']' token
7 | int counter[55] = {0];//バケット
| ~ ^
a.cc:7:23: error: expected ',' or ';' before ']' token
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int... |
s984630979 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
//入力部
int N,M;
cin>>N>>M;
vector<int>a(M);
vector<int>b(M);
vector<int>c(N);
for(int i = 0;i < M; i++){
cin>>a.at(i)>>b.at(i);
}
//上下の文字列
for(int i = 0;i < N; i++){
for(int j=0;j < M; j++){
if (i + 1... | a.cc: In function 'int main()':
a.cc:22:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
22 | cout<<c.at[i]<<endl;
| ^
|
s160607094 | p03720 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<int> st(m*2);
for (int i = 0; i < m*2; i++) {
cin >> st.at(i);
}
for (int i = 1; i <= n; i++) {
cout << std::count(st.begin(),st.end(),i) << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:30: error: 'count' is not a member of 'std'; did you mean 'cout'?
17 | cout << std::count(st.begin(),st.end(),i) << endl;
| ^~~~~
| cout
|
s490326753 | p03720 | C++ | 4 3
1 2
2 3
1 4 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4 3
| ^
|
s466287424 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
cin>>N>>M;
vector<int> vec(N;0);
for (int i=0;i<M;i++){
int a,b;
cin>>a>>b;
vec.at(a+1)++;
vec.at(b+1)++;
}
for (int i=0;i<M;i++){
cout<<vec.at(i)<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:20: error: expected ')' before ';' token
7 | vector<int> vec(N;0);
| ~ ^
| )
a.cc:7:22: error: expected ';' before ')' token
7 | vector<int> vec(N;0);
| ^
| ;
|
s563864090 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
cin >>N >>M;
vector<int> a(M);
vector<int> b(M);
for(int i=0; i<M; i++)
cin >>a.at(i) >>b.at(i);
for(int i=0; i<N; i++){
int x=0;
for(int j=0; j<M; j++){
if(a.at(j)==(i+1)||b.at(j)==(i+1))
x++;
}
cout <<x <... | a.cc: In function 'int main()':
a.cc:17:16: error: expected primary-expression before '<' token
17 | cout <<x <<<endl;
| ^
|
s796822129 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
cin >>N >>M;
vecter<int> a(M);
vector<int> b(M);
for(int i=0; i<M; i++)
cin >>a.at(i) >>b.at(i);
for(int i=0; i<N; i++){
int x=0;
for(int j=0; j<M; j++){
if(a.at(j)=='i')
x++;
}
cout <<x <<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'vecter' was not declared in this scope
7 | vecter<int> a(M);
| ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
7 | vecter<int> a(M);
| ^~~
a.cc:10:11: error: 'a' was not declared in this scope
10 | cin >>a.at(i... |
s067734063 | p03720 | C++ | #include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
int a,b;
int n,m;
cin>>n>>m;
vector<int> c(55)
for(int i=0;i<m;i++){
cin>>a>>b;
c.at(a)++;
c.at(b)++;
}
for(int i=0;i<n;i++){
cout<<c.at(i)<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:3: error: 'vector' was not declared in this scope
13 | vector<int> c(55)
| ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
5 | #include<algorithm>
+++ |+#include <vector>
6 |
a.cc... |
s096674631 | p03720 | C++ | #include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
vector<int> c;
int main(){
int a,b;
int n,m;
cin>>n>>m;
for(int i=0;i<m;i++){
cin>>a>>b;
c.at(a)++;
c.at(b)++;
}
for(int i=0;i<n;i++){
cout<<c.at(i)<<endl;
}
}
| a.cc:9:1: error: 'vector' does not name a type
9 | vector<int> c;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:17:17: error: 'c' was not declared in this scope
17 | c.at(a)++;
| ^
a.cc:21:23: error: 'c' was not declared in this scope
21 | cout<<c.at... |
s184083213 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<int> r(m)
for(int i=0;i<2*m;i++){
cin >> r.at(i);
}
for(int i=0;i<n;i++){
int x=0;
for(int j=0;j<2*m;j++){
if(r.at(j)==i){
... | a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'for'
11 | for(int i=0;i<2*m;i++){
| ^~~
a.cc:11:15: error: 'i' was not declared in this scope
11 | for(int i=0;i<2*m;i++){
| ^
|
s811098797 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,M;
cin >> N >> M;
vetor<int> r(2*M);
for(int i=0; i<2*M; i++){
cin >> r.at(i);
}
for(int j=1; j<=N; j++){
int a=0;
for(int i=0; i<2*M; i++){
if(r.at(i)==j){
a++;
}
}
cout << a << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'vetor' was not declared in this scope
7 | vetor<int> r(2*M);
| ^~~~~
a.cc:7:9: error: expected primary-expression before 'int'
7 | vetor<int> r(2*M);
| ^~~
a.cc:9:12: error: 'r' was not declared in this scope
9 | cin >> r.at(i);... |
s833239704 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a[]={};
int b[]={};
int c[]={};
int d[]={};
int N,M;
cin >> N >> M;
a[M] = {};
for(int i = 0;i<M;i++){
cin >> a[i] >> b[i];
c[a[i]]++;
c[b[i]]++
}
for(int i = 0;i<N;i++){
cout << c... | a.cc: In function 'int main()':
a.cc:16:18: error: expected ';' before '}' token
16 | c[b[i]]++
| ^
| ;
17 | }
| ~
|
s448750131 | p03720 | Java | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int a[] = new int[M];
int b[] = new int[M];
for(int i=0; i<M; i++){
a = sc.nextInt();
... | Main.java:11: error: incompatible types: int cannot be converted to int[]
a = sc.nextInt();
^
Main.java:12: error: incompatible types: int cannot be converted to int[]
b = sc.nextInt();
^
Main.java:17: error: incompatible types: int cannot be c... |
s224265725 | p03720 | Java | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int a[] = new int[M];
int b[] = new int[M];
for(int i=0; i<M; i++){
a = sc.nextInt();
... | Main.java:26: error: illegal start of expression
for(int i=0; i<; i++){
^
1 error
|
s504510348 | p03720 | Java | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int a[] = new int[M];
int b[] = new int[M];
for(int i=0; i<M; i++){
a[] = sc.nextInt();
... | Main.java:11: error: not a statement
a[] = sc.nextInt();
^
Main.java:11: error: ';' expected
a[] = sc.nextInt();
^
Main.java:12: error: not a statement
b[] = sc.nextInt();
^
Main.java:12: error: ';' expected
b[] = sc.nextInt();
... |
s670609567 | p03720 | C++ | #include<iostream>
using namespace std;
int main() {
int n,m,a,b,v[50]={0};
cin >> n >> m;
for(int i=0; i<m; i++) {
cin >> a >> b;
v[a]++;
v[b]++;
}
for(int i=0; i<n; i++) {
cout << v[i] << endl;
}
| a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s219867250 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N[60] ={0};
int M;
int t;
cin >> t >> M;
for (int i = 0; i < M; i++)
{
int a,b;
cin >> a >> b;
N[a]++;
N[b]++;
}
for each (int var in N)
{
if(var){
cout << var << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:18:13: error: expected '(' before 'each'
18 | for each (int var in N)
| ^~~~
| (
a.cc:18:19: error: expected primary-expression before 'int'
18 | for each (int var in N)
| ^~~
a.cc:18:13: error: 'each'... |
s157783854 | p03720 | C++ | #include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int main() {
int N[60] ={0};
int M;
int t;
cin >> t >> M;
for (int i = 0; i < M; i++)
{
int a,b;
cin >> a >> b;
N[a]++;
N[b]++;
}
for each (int var in N)
{
if(var){
cout << var << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:20:13: error: expected '(' before 'each'
20 | for each (int var in N)
| ^~~~
| (
a.cc:20:19: error: expected primary-expression before 'int'
20 | for each (int var in N)
| ^~~
a.cc:20:13: error: 'each'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.