submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s742852096
p03722
C++
include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAX_M=20000; ll N, M; ll cost[1011][1011]; int main(){ cin>>N>>M; for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ if(i==j){ cost[i][j]=0; ...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:13:9: error: 'cin' was not declared in this scope 13 | cin>>N>>M; | ^~~ a.cc:33:44: error: 'max' was not declared in this scope 33 | ...
s480673670
p03722
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); final int NMAX = 1000; final int MMAX = 2000; final long INF = Long.MAX_VALUE; int[] a = new int[MMAX]; int[] b = new ...
Main.java:50: error: cannot find symbol boolean[] negative = new boolean[NMAX]; ^ symbol: variable NMAX location: class Main 1 error
s785606702
p03722
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++) #define all(c) begin(c),end(c) const ll INF = 1e18; struct edge { ll from, to, cost; }; edge es[2000]; ll d[1000]; bool flag = ...
a.cc: In function 'void bellmanford(int)': a.cc:21:22: error: 'n' was not declared in this scope 21 | while (count<n) { | ^
s435184531
p03722
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,x) for(int i=0;i<x;++i) struct edge{ int from, to, cost; edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}; }; vector<edge> edges; const int MAX_N = 100000; int N, M; int dist[MAX_N]; void bf(int...
a.cc: In function 'void bf(long long int)': a.cc:35:51: error: expected ';' before 'if' 35 | dist[e.to] = dist[e.from] + e.cost | ^ | ; 36 | if (e.to == N - 1) { | ...
s229287314
p03722
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,x) for(int i=0;i<x;++i) struct edge{ int from, to, cost; edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}; }; vector<edge> edges; const int MAX_N = 100000; int N, M; int dist[MAX_N]; void bf(int...
a.cc: In function 'int main()': a.cc:50:25: error: 'n' was not declared in this scope 50 | if (e.to == n - 1) { | ^
s286168019
p03722
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,x) for(int i=0;i<x;++i) struct edge{ int from, to, cost; edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}; }; vector<edge> edges; const int MAX_N = 100000; int N, M; int dist[MAX_N]; void bf(int...
a.cc: In function 'void bf(long long int)': a.cc:35:21: error: 'n' was not declared in this scope 35 | if (e.to == n - 1) { cout << "inf" << endl; exit(0); } | ^
s049230185
p03722
C++
#include<iostream> #include<algorithm> #include<functional> #include <string> #include<cstdio> #include<math.h> #include<stack> #include<queue> #include<cstring> #include<vector> #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define EREP(i,n) for(int i=(n-1);i>=0;--i) #define D(n,retu) REP(i,n...
a.cc: In function 'int main()': a.cc:69:18: error: expected '}' at end of input 69 | return 0; | ^ a.cc:46:12: note: to match this '{' 46 | int main() { | ^
s439909860
p03722
C++
#include<iostream> #include<algorithm> #include<functional> #include <string> #include<cstdio> #include<math.h> #include<stack> #include<queue> #include<cstring> #include<vector> #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define EREP(i,n) for(int i=(n-1);i>=0;--i) #define D(n,retu) REP(i,n...
a.cc: In instantiation of 'void fill_all(ARR&, const T&) [with T = long int; ARR = long long int]': a.cc:26:32: required from 'void fill_all(ARR&, const T&) [with T = long int; ARR = long long int [1001]]' 26 | for (auto& i : arr) { fill_all(i, v); } | ~~~~~~~~^~~~~~ a.c...
s069379887
p03722
C++
#include <bits/stdc++.h> using namespace std; using lint = long long; struct edge { int to, cost; edge() {} edge(int a, int b) :to(a), cost(b) {} }; const lint inf = 1001001001001001001; vector<vector<edge>> G; vector<lint> d; bool bellman_ford(int n, int s = 0) { d = vector<lint>(n, inf); d[s] = 0; fo...
a.cc: In function 'int main()': a.cc:51:3: error: 'else' without a previous 'if' 51 | else cout << -d.back() << endl; | ^~~~
s936577687
p03722
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #include <map> #include <set> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; #define INF_LL (ll)1e18 #define INF (int)1e9 ...
a.cc: In function 'int main()': a.cc:279:21: error: no match for 'operator[]' (operand types are 'll [1010]' {aka 'long long int [1010]'} and 'std::vector<int>') 279 | if(d[v] != INF_LL){ | ^
s564691489
p03722
C++
#include <iostream> #include <vector> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, a, n) for(int i = a ; i < (int)n ; i++) #define pb push_back #define N_MAX 1000 #define INF -1000000000000; typedef long long ll; struct Edge{ int from, to; ll cost; Edge(int f, int t, ll c) : from(f), t...
a.cc: In function 'bool bellman_ford()': a.cc:31:34: error: expected ')' before '[' token 31 | if(d[edge.from] != INF && d[edge.to] < d[edge.from] + edge.cost){ | ~ ^ | ) a.cc:31:33: error: label 'd' used but not defined 31 | ...
s403750224
p03722
C++
#include "bits/stdc++.h" #define MOD 1000000007 #define INF 11234567890 #define in std::cin #define out std::cout #define rep(i,N) for(int i=0;i<N;++i) typedef long long int LL; LL N, M, a[2123], b[2123], c[2123]; LL ans; struct edge { LL from, to, cost; }; edge G[2123]; LL d[1123]; bool negative[1123]; // s 番目の頂点から...
a.cc: In function 'void bellman_ford(LL)': a.cc:28:92: error: expected ';' before '{' token 28 | d[e.to] = std::min(d[e.to], d[e.from] + e.cost); (d[e.from] != INF) { } | ^~ | ...
s072221412
p03722
C++
#define _USE_MATH_DEFINES #include <iostream> #include <string> #include <algorithm> #include <cmath> #include <cstdio> #include <climits> #include <cstdlib> #include <vector> #include <queue> #include <unordered_map> #include <iomanip> #include <random> #include <future> #include <thread> #include <utility> using nam...
a.cc: In function 'int main()': a.cc:91:13: error: redeclaration of 'long long int ans' 91 | int ans = d[N - 1]; | ^~~ a.cc:71:13: note: 'long long int ans' previously declared here 71 | int ans = d[N - 1]; | ^~~
s348824202
p03722
C++
#include <stdlib.h> #include <iostream> using ll = long long; const ll INF = 1ll << 50; int main(void){ int N, M; std::cin >> N >> M; const int NMAX = 1000; const int MMAX = 2000; int a[MMAX], b[MMAX]; ll c[MMAX]; for (int i = 0; i < M; ++ i){ std::cin >> a[i] >> b[i] >> c[i]; c[i] = -c[i]; ...
a.cc: In function 'int main()': a.cc:62:12: error: expected '}' at end of input 62 | return 0; | ^ a.cc:7:15: note: to match this '{' 7 | int main(void){ | ^
s987061241
p03722
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <limits> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) typedef long long ll; int main(void) { ll N,M; cin >> N >> M; vector<ll> a(M), b(M), c(M); REP(i, M) { cin >> a[i] >> b[i]...
a.cc: In function 'int main()': a.cc:24:33: error: 'LLONG_MAX' was not declared in this scope 24 | FOR(i, 1, 1010) d[i] = -LLONG_MAX; | ^~~~~~~~~ a.cc:6:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 5 |...
s788246530
p03722
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <limits> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) typedef long long ll; int main(void) { ll N,M; cin >> N >> M; vector<ll> a(M), b(M), c(M); REP(i, M) { cin >> a[i] >> b[i]...
a.cc: In function 'int main()': a.cc:24:33: error: 'LLONG_MAX' was not declared in this scope 24 | FOR(i, 1, 1010) d[i] = -LLONG_MAX; | ^~~~~~~~~ a.cc:6:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 5 |...
s970953213
p03722
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <limits> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) typedef long long ll; int main(void) { int N,M; cin >> N >> M; vector<int> a(M), b(M), c(M); REP(i, M) { cin >> a[i] >> b...
a.cc: In function 'int main()': a.cc:25:33: error: 'LLONG_MAX' was not declared in this scope 25 | FOR(i, 1, 1010) d[i] = -LLONG_MAX; | ^~~~~~~~~ a.cc:6:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 5 |...
s172238202
p03722
C++
#include <bits/stdc++.h> #define MAXN 1000 std::vector < std::pair <int,int> > g[MAXN+1]; long long dist[MAXN+1]; int main(){ int i,n,m,a,b,c,j; long long aux; cin >> n >> m; for(i=1;i<=m;i++){ cin >> a >> b >> c; g[a].push_back(std::make_pair(b,c)); } for(i=1;i<=n;i++...
a.cc: In function 'int main()': a.cc:8:6: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | 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:1...
s788108766
p03722
C++
#include<bits/stdc++.h> #define rep(i,start,lim) for(lld i=start;i<lim;i++) #define repd(i,start,lim) for(lld i=start;i>=lim;i--) #define scan(x) scanf("%lld",&x) #define print(x) printf("%lld ",x) #define f first #define s second #define pb push_back #define mp make_pair #define br printf("\n") #define sz(a) lld((a).s...
a.cc: In function 'int main()': a.cc:38:99: error: 'i' was not declared in this scope 38 | rep(j,1,m+1) if(dis[a[j]]!=LLINF and dis[b[j]]>dis[a[j]]+c[j]) neg[b[j]]=1; else if(neg[a[i]]) neg[b[i]]=1; | ^
s656698210
p03722
C
#include<stdio.h> #define INF -1000000000000000000 #define ll long long int main() { int n, m, f; int i, j; ll score[1010] = {}; scanf("%d %d", &n, &m); ll a[2010] = {}; ll b[2010] = {}; ll c[2010] = {}; for (i = 1; i < m+1; i++) { scanf("%lld %lld %lld", &a[i], &b[i], &c[i]); } for (i = 2; i <...
main.c: In function 'main': main.c:34:7: error: break statement not within loop or switch 34 | break; | ^~~~~ main.c: At top level: main.c:42:10: error: expected declaration specifiers or '...' before string constant 42 | printf("%lld\n", score[n]); | ^~~~~~~~ main.c:42:20: erro...
s433297641
p03722
C++
#include <cstdio> #include <iostream> #include <algorithm> #include <queue> #include <cstring> using namespace std; int to[2010],len[2010],findnext[2010],head[1010],num,Numpath,Numdot,Inqueue[1010]; long long Shortpath[1010]; void add(int from,int go,int length) { to[++num]=go; len[num]=length; findnext[num]=head[fr...
a.cc: In function 'int main()': a.cc:79:28: error: expected initializer before '++' token 79 | long long q++; | ^~
s885543872
p03722
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<pair<ll, ll> > vp; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) #define out(n) cout << (n) << endl; __att...
a.cc: In function 'int main()': a.cc:60:11: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::pair<long long int, long long int> > >, std::vector<std::pair<long long int, long long int> > >::value_type' {aka 'class std::vector<std::pair<long long int, long long int> >'} has no member named 'first' 60...
s966226386
p03722
C++
// ProgramingExcerciseA.cpp : Defines the entry point for the console application. // #include "stdafx.h" using namespace std; typedef long long LL; /* Edge class */ struct Edge { int to; LL cost; Edge(int to, LL cost) : to(to), cost(cost) {} }; // node and edge /* data structure graph[0], graph[1], graph[2], ...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s766607412
p03722
C++
#include <stdio.h> #include <map> #include <vector> struct edge {long long from,long long to,long long cost;}; edge es[20000]; long long d[1100]; int over[1252]; int n,m; using namespace std; int main(){ scanf("%d%d",&n,&m); for(int i=0;i<m;i++){ long long a,b,c; scanf("%ld%ld%ld", &a,&b,&c); es[i].fr...
a.cc:4:29: error: expected unqualified-id before 'long' 4 | struct edge {long long from,long long to,long long cost;}; | ^~~~ a.cc: In function 'int main()': a.cc:18:11: error: 'struct edge' has no member named 'to' 18 | es[i].to = b-1; | ^~ a.cc:19:11: error...
s690724323
p03722
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<pair<int, int> > vp; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) #define out(n) cout << (n) << endl; __a...
a.cc: In function 'int main()': a.cc:64:10: error: too few arguments to function 'int tansaku(ll, int, vi, ll, ll)' 64 | tansaku(0, 1, load, false); | ~~~~~~~^~~~~~~~~~~~~~~~~~~ a.cc:26:5: note: declared here 26 | int tansaku(ll score, int node, vi load, ll flag, ll kinf) { | ^~~~~~~ a.cc: In ...
s885507861
p03722
C
#include <stdio.h> #define INF 2300000000000000000L long long dist[1001][1001]; int main(){ int V,E,i,j;long long k; scanf("%d%d",&V,&E); for(i=0;i<V;i++){ for(j=0;j<i;j++)dist[i][j]=INF; dist[i][j++]=0; for(;j<V;j++)dist[i][j]=INF; } for(;E--;)scanf("%d%d%lld",&i,&j,&k),dist[i-1][j-1]=-k; for(k=0;k<V;k++)f...
main.c: In function 'main': main.c:14:66: warning: comparison between pointer and integer 14 | if(dist[i][k]<INF && dist[k][j]<INF && dist[i][j]>dist[i]k]+dist[k][j]) | ^ main.c:14:74: error: expected ')' before 'k' 14 | ...
s097393316
p03722
C
#include <stdio.h> #define INF 2100000000 int dist[1001][1001]; int main(){ int V,E,i,j,k; scanf("%d%d",&V,&E); for(i=0;i<V;i++){ for(j=0;j<i;j++)dist[i][j]=INF; dist[i][j++]=0; for(;j<V;j++)dist[i][j]=INF; } for(;E--;)scanf("%d%d%d",&i,&j,&k),dist[i-1][j-1]=k; for(k=0;k<...
main.c: In function 'main': main.c:17:25: error: 'n' undeclared (first use in this function) 17 | printf("%d",dist[0][n-1]); | ^ main.c:17:25: note: each undeclared identifier is reported only once for each function it appears in
s586744071
p03722
C++
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; void DFS(vector<vector<int>> &graph, vector<bool> visited, int k, long long sum, long long &ret) { if (ret == -1) return; int N = visited.size(); if (k == N - 1) { ret = max(sum, ret); } for (int i = 0; i < N; ++i)...
a.cc: In function 'int main()': a.cc:44:25: error: 'LLONG_MIN' was not declared in this scope 44 | long long ret = LLONG_MIN; | ^~~~~~~~~ a.cc:5:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <algor...
s287831776
p03722
C++
public class Main{ public static void main(String[] args) { java.util.Scanner scanner = new java.util.Scanner (System.in); int N=scanner.nextInt() ; int K=scanner.nextInt() ; int a[]=new int[N+1]; int b[]=new int[N+1]; for(int i=1;i<=N;i++){ a[i]=scanner.nextInt(); b[i]=scanner.nextInt(); } ...
a.cc:1:1: error: expected unqualified-id before 'public' 1 | public class Main{ | ^~~~~~
s253895838
p03722
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<math.h> #include<vector> #include<map> #include<string.h> #define int long long using namespace std; int mincost[1000][1000]; signed main() { int a, b; scanf("%lld%lld", &a, &b); for (int c = 0; c < a; c++) { for (int d = 0; d < a; d++) { mincost[...
a.cc: In function 'int main()': a.cc:16:41: error: 'LLONG_MAX' was not declared in this scope 16 | mincost[c][d] = LLONG_MAX; | ^~~~~~~~~ a.cc:8:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <c...
s320382130
p03722
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<math.h> #include<vector> #include<map> #define int long long using namespace std; int mincost[1000][1000]; signed main() { int a, b; scanf("%lld%lld", &a, &b); for (int c = 0; c < a; c++) { for (int d = 0; d < a; d++) { mincost[c][d] = LLONG_MAX; ...
a.cc: In function 'int main()': a.cc:15:41: error: 'LLONG_MAX' was not declared in this scope 15 | mincost[c][d] = LLONG_MAX; | ^~~~~~~~~ a.cc:7:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <c...
s732076205
p03722
C++
#include <iostream> using namespace std; #define MAX_E 2010 // max M #define MAX_V 1010 // max N // #define INF 9223372036854775800 #define INF (1LL << 59) struct edge { int from; int to; long long cost; }; edge es[MAX_E]; long long d[MAX_V]; bool negative[MAX_V]; int V, E; int main() { cin >> V >> E; for ...
a.cc: In function 'int main()': a.cc:42:21: error: 'N' was not declared in this scope 42 | long long ans = d[N] * -1; | ^
s714223881
p03722
C++
#include <iostream> using namespace std; #define MAX_E 2010 // max M #define MAX_V 1010 // max N // #define INF 9223372036854775800 #define INF (1LL << 59) struct edge { int from; int to; long long cost; }; edge es[MAX_E]; long long d[MAX_V]; bool negative[MAX_V]; int V, E; int main() { cin >> V >> E; for ...
a.cc: In function 'int main()': a.cc:53:16: error: 'N' was not declared in this scope 53 | if (negative[N]) { | ^
s934726270
p03722
C++
#include <bits/stdc++.h> using namespace std; int N, M; bool heiro; struct edge{ int to; ll cost; edge(int t, ll c) : to(t), cost(c) {} }; vector<edge> G[1001]; typedef long long ll; ll dist[1001]; const ll INF = 1e12; int main() { cin >> N >> M; for(int i = 0; i < M; i++) { int a, b, c; cin >> a...
a.cc:9:3: error: 'll' does not name a type 9 | ll cost; | ^~ a.cc:10:15: error: 'll' has not been declared 10 | edge(int t, ll c) : to(t), cost(c) {} | ^~ a.cc: In constructor 'edge::edge(int, int)': a.cc:10:30: error: class 'edge' does not have any field named 'cost' 10 | ed...
s130048924
p03722
C++
#include <iostream> #include <cstdio> #include <cmath> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <set> #include <map> #include <stack> #include <queue> #include <algorithm> #define CH(N,A,B) (A<=N&&N<B) #define REP(i,a,b) for(int i=a;i<b;i++) #define RREP(i,a,b) for(int i=(b-1);...
a.cc: In function 'int main()': a.cc:51:14: error: 'negative' was not declared in this scope 51 | REP(i,0,N) negative[i] = false; | ^~~~~~~~
s146392016
p03722
C++
#include<cstdio>#include<cstring>#include<cmath>#include<string>#include<iostream>#include<algorithm>#include<map>#include<queue>#include<set>#include<vector>using namespace std;typedef long long ll;const int N=2005;const ll INF=1e11+7;#define de(x) cout<<#x<<" = "<<x<<endl;#define pb push_back#define fi first#define s...
a.cc:1:17: warning: extra tokens at end of #include directive 1 | #include<cstdio>#include<cstring>#include<cmath>#include<string>#include<iostream>#include<algorithm>#include<map>#include<queue>#include<set>#include<vector>using namespace std;typedef long long ll;const int N=2005;const ll INF=1e11+7;#define de(x) ...
s877180205
p03722
C++
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <sstream> #include <cctype> #include <stack> #include <queue> #include <cstring> #include <map> #include <list> #in...
a.cc: In function 'int main()': a.cc:70:26: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '__int128') 70 | cin>>a>>b>>c; | ~~~~~~~~~^~~ | | | | ...
s391094066
p03722
C++
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <sstream> #include <cctype> #include <stack> #include <queue> #include <cstring> #include <map> #include <list> #in...
a.cc:24:9: error: 'int128_t' does not name a type; did you mean 'int8_t'? 24 | int128_t cost; | ^~~~~~~~ | int8_t a.cc:25:32: error: 'int128_t' has not been declared 25 | edge(int from_,int to_,int128_t cost_){ | ^~~~~~~~ a.cc: In co...
s982063444
p03722
C++
#include <cstdio> #include <cstdlib> #include <vector> using namespace std; struct edge { int from; int to; long long cost; }; edge es[2000]; long long d[1000]; int num[1000]; int N,M; long long INF = 1LL << 50; bool est_path(int s); //bool find_n_loop(); int main(){ scanf("%d %d",&N,&M); for(int i=0;i<M;i+...
a.cc: In function 'int main()': a.cc:38:12: error: 'largest_path' was not declared in this scope; did you mean 'est_path'? 38 | if(largest_path(0)){ | ^~~~~~~~~~~~ | est_path a.cc: In function 'bool largest_path(int)': a.cc:69:23: error: 'MAX_N' was not declared in this scop...
s608978003
p03722
C++
#include <cstdio> #include <cstdlib> #include <vector> using namespace std; struct edge { int from; int to; long long cost; }; edge es[2000]; long long d[1000]; int num[1000]; int N,M; long long INF = 1LL << 50; bool largest_path(int s); //bool find_n_loop(); int main(){ scanf("%d %d",&N,&M); for(int i=0;i<...
a.cc: In function 'bool largest_path(int)': a.cc:69:23: error: 'MAX_N' was not declared in this scope 69 | bool negative[MAX_N]; | ^~~~~ a.cc:71:17: error: 'negative' was not declared in this scope 71 | negative[i] = false; | ^~~~~~~~ a.cc:...
s296291173
p03722
C++
#include <cstdio> #include <cstdlib> #include <vector> using namespace std; struct edge { int from; int to; long long cost; }; edge es[2000]; long long d[1000]; int num[1000]; int N,M; long long INF = 1LL << 50; bool largest_path(int s); //bool find_n_loop(); int main(){ scanf("%d %d",&N,&M); for(int i=0;i<...
a.cc: In function 'int main()': a.cc:38:12: error: 'find_n_loop' was not declared in this scope 38 | if(find_n_loop()){ | ^~~~~~~~~~~ a.cc: In function 'bool largest_path(int)': a.cc:69:23: error: 'MAX_N' was not declared in this scope 69 | bool negative[MAX_N]; | ...
s858022486
p03722
C++
#include <iostream> #include <algorithm> using namespace std; using ll = long long; const ll INF = -(1LL << 50); int n, m; int a[2000], b[2000]; ll c[2000]; ll d[1001]; int main() { cin >> n >> m; for (int i = 0; i < m; ++i) { cin >> a[i] >> b[i] >> c[i]; } fill(d, d + 1001, INF); for (int i = 0; i < n; ++i...
a.cc: In function 'int main()': a.cc:37:34: error: 'i' was not declared in this scope 37 | for (int j = 0; j < m; ++i) { | ^
s353525050
p03722
C++
#include <iostream> using namespace std; using ll = long long; const int MAX_N = 1000; const int MAX_M = 2000; const ll WEIGHT_MAX = 1000000000; // 頂点fromから頂点toへのコストcostの辺 struct edge { int from, to; ll cost; }; edge es[MAX_M]; // 辺 ll d[MAX_N]; // 始点から各頂点への最大距離 int N, M; // s番目の頂点から各頂点への最短距離を求め...
a.cc: In function 'bool shortest_path(int)': a.cc:24:16: error: 'LLONG_MAX' was not declared in this scope 24 | d[i] = LLONG_MAX / 2; | ^~~~~~~~~ a.cc:2:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostre...
s473459662
p03722
Java
import java.util.Scanner; 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]; int[] c = new int[M]; int[][] to = new int[N+1][M]; int[] cnt = new int[N+1]; for(int i=1;...
Main.java:33: error: ';' expected boolean[] check = new boolean[N+1] ^ Main.java:49: error: ']' expected if(cnt[b[next]]>0 && check[b[next]==false){ ^ 2 errors
s952660837
p03722
C++
#include"bits/stdc++.h" //#include<bits/stdc++.h> using namespace std; #define print(x) cout<<x<<endl; #define rep(i,a,b) for(int i=a;i<b;i++) typedef long long ll; const ll mod = LLONG_MAX; print("inf") return 0;
a.cc:4:18: error: 'cout' does not name a type 4 | #define print(x) cout<<x<<endl; | ^~~~ a.cc:9:1: note: in expansion of macro 'print' 9 | print("inf") | ^~~~~ a.cc:10:1: error: expected unqualified-id before 'return' 10 | return 0; | ^~~~~~
s282710600
p03722
C++
// ConsoleApplication1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include<cmath> #include<cstdio> #include<vector> #include<algorithm> #include<iostream> #include<queue> typedef long long i64; using namespace std; int n; int m; int a[2000]; int b[2000]; i64 c[2000]; struct Edge { int src, dst; i6...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s222276148
p03722
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<functional> #include<algorithm> #include<cstdio> #include<unordered_map>
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s958438803
p03722
C++
// ConsoleApplication1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include<cmath> #include<cstdio> #include<vector> #include<algorithm> #include<iostream> #include<queue> typedef long long i64; using namespace std; int n; int m; int a[2000]; int b[2000]; i64 c[2000]; struct Edge { int src, dst; i6...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s897603749
p03722
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define FOR(i,a,b) for(int i=a;i<b;i++) #define rep(i,b) FOR(i,0,b) #define INF 1e18+1 using ll = long long; const ll mod = LLONG_MAX; struct edge{ int from,to,cost; }; edge es[2010]; int d[1010];//最短距離 入力を負にしてヒックリカセス int V,E; void shrtest_path(i...
a.cc: In function 'int main()': a.cc:75:9: error: 'N' was not declared in this scope 75 | rep(i,N){ | ^ a.cc:4:34: note: in definition of macro 'FOR' 4 | #define FOR(i,a,b) for(int i=a;i<b;i++) | ^ a.cc:75:3: note: in expansion of macro 'rep' 75 | rep(i...
s379467165
p03722
C++
// ConsoleApplication1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include<cmath> #include<cstdio> #include<vector> #include<algorithm> #include<iostream> #include<queue> typedef long long i64; using namespace std; int n; int m; int a[1000]; int b[1000]; i64 c[1000]; struct Edge { int src, dst; i6...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s681262105
p03722
C++
#include <iostream> #include <stdio.h> #include <string> #include <vector> #include <cmath> #include <algorithm> using namespace std; struct edge{ int from; int to; long long int score; }; int main() { long long int N,M; cin >> N >> M; vector<struct edge>es(M); for(int i=0; i < M; i++){ long long i...
a.cc: In function 'int main()': a.cc:36:8: error: conflicting declaration 'bool inf' 36 | bool inf = false; | ^~~ a.cc:31:17: note: previous declaration as 'long long int inf' 31 | long long int inf = 10000000000; | ^~~
s600881218
p03722
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define FOR(i,a,b) for(int i=a;i<b;i++) #define rep(i,b) FOR(i,0,b) #define INF 1e18+1 using ll = long long; const ll mod = LLONG_MAX; struct edge{ int from,to,cost; }; edge es[2010]; int d[1010];//最短距離 入力を負にしてヒックリカセス int V,E; void shrtest_path(i...
a.cc: In function 'void shrtest_path(long long int)': a.cc:35:16: error: label 'E' used but not defined 35 | goto E; | ^
s532577781
p03722
C++
#include<bits//stdc++.h> using namespace std; typedef long long ll; typedef long double ld; struct P{ ll from,to,cost; }; vector<P>e; ll a[10001]; const ll inf=-999999999999999999; bool b[1001]; signed main(){ ll n,m; cin>>n>>m; for(ll i=0;i<m;i++){ ll a,b,c; cin>>a>>b>>c; e.push_back(P{a,b,c}); } for(ll i...
a.cc:38:9: error: expected unqualified-id before 'for' 38 | for(ll j=0;j<n;j++){ | ^~~ a.cc:38:20: error: 'j' does not name a type 38 | for(ll j=0;j<n;j++){ | ^ a.cc:38:24: error: 'j' does not name a type 38 | for(ll j=0;j<n;j++){ | ...
s204623659
p03722
C++
#include <iostream> #include <iomanip> #include <cmath> #include <queue> #include <map> #include <cstdlib> #include <algorithm> #include <utility> #include <queue> #include <string> #include <functional> #define rep(i, a, b) for(int i=a;i<b;++i) #define MOD 1000000007 #define RAND 1000 #define LLONG_MIN -92233720368547...
a.cc:21:22: warning: integer constant is so large that it is unsigned 21 | long long int maxy = LLONG_MIN; | ^~~~~~~~~ a.cc:48:22: error: empty character constant 48 | cout<<''inf''<<endl; | ^~~~~ a.cc:48:27: error: empty character constant 4...
s002533193
p03722
C++
#include "stdafx.h" #include<iostream> #include<vector> #include<algorithm> #include<map> #include<queue> using namespace std; #define REP(i, a, n) for(int i=a; i<n; i++) #define ll long long #define INF 1000000005 #define _INF -9000000000000000000 //#define _INF -1000000005 struct St { int cur; vector<bool> flag; ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s204108004
p03722
C++
n, m = map(int, input().split()) dist = [-10**18] * n edge = [] for i in range(m): a, b, c = map(int, input().split()) edge.append((a - 1, b - 1, c)) dist[0] = 0 for i in range(n): for i in edge: a, b, c = i if dist[a] + c > dist[b]: dist[b] = dist[a] + c updated = Tr...
a.cc:1:1: error: 'n' does not name a type 1 | n, m = map(int, input().split()) | ^
s453572429
p03722
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define FOR(i,a,b) for(int i=a;i<b;i++) #define rep(i,b) FOR(i,0,b) #define INF 1e18+1 using ll = long long; const ll mod = LLONG_MAX; struct edge{ int from,to,cost; }; edge es[2010]; int d[1010];//最短距離 入力を負にしてヒックリカセス int V,E; void shrtest_path(...
a.cc: In function 'int main()': a.cc:55:10: error: no matching function for call to 'find()' 55 | if(find()){ | ~~~~^~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bi...
s435835097
p03722
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<typename T> using Graph = vector<vector<T>>; #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, a) REP(i, 0, a) #define EACH(i, a) for (auto i: a) #define ITR(x, a) for (__typeof(a.begin()) x = a.begin(); x != a.end...
a.cc: In function 'int main()': a.cc:6:22: error: expected ',' or ';' before 'for' 6 | #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) | ^~~ a.cc:7:19: note: in expansion of macro 'REP' 7 | #define rep(i, a) REP(i, 0, a) | ^~~ a.cc:37:3: note: in...
s052172928
p03722
C++
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <limits.h> #include <map> #include <algorithm> #include <functional> using namespace std; struct edge { int from, to, cost; }; int main() { int N, M; long long d[1001]; bool done[1001]; ...
a.cc: In function 'int main()': a.cc:53:23: error: 'from' was not declared in this scope; did you mean 'fromfp'? 53 | if ( done[from] || e.from == 1 ) { | ^~~~ | fromfp
s976897908
p03722
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include<math.h> #define rep(i,a) for(int i=0;i<a;i++) #define nrep(i,a,b) for(int i=a;i<b;i++) #define mrep(i,a) for(int i=a;i>=0;i--) #define ll long long #define vl vector<ll> #define vvl vector<vector<ll> > #define vb vector<bool> #def...
a.cc: In function 'int main()': a.cc:15:13: error: 'LLONG_MAX' was not declared in this scope 15 | #define INF LLONG_MAX | ^~~~~~~~~ a.cc:43:23: note: in expansion of macro 'INF' 43 | dp.resize(n, -INF); | ^~~ a.cc:7:1: note: 'LLONG_MAX' is defined in header '...
s411417450
p03722
C++
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <limits.h> #include <map> #include <algorithm> #include <functional> using namespace std; struct edge { int from, to, cost; }; int main() { int N, M; long long d[1001]; bool done[1001]; ...
a.cc: In function 'int main()': a.cc:53:23: error: 'from' was not declared in this scope; did you mean 'fromfp'? 53 | if ( done[from] || e.forom == 1 ) { | ^~~~ | fromfp a.cc:53:34: error: 'struct edge' has no member named 'forom'; did you mean 'fro...
s895956790
p03722
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include<math.h> #define rep(i,a) for(int i=0;i<a;i++) #define nrep(i,a,b) for(int i=a;i<b;i++) #define mrep(i,a) for(int i=a;i>=0;i--) #define ll long long #define vl vector<ll> #define vvl vector<vector<ll> > #define vb vector<bool> #def...
a.cc: In function 'int main()': a.cc:15:13: error: 'LLONG_MAX' was not declared in this scope 15 | #define INF LLONG_MAX | ^~~~~~~~~ a.cc:43:23: note: in expansion of macro 'INF' 43 | dp.resize(n, -INF); | ^~~ a.cc:7:1: note: 'LLONG_MAX' is defined in header '...
s482693280
p03722
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int n,m; long long maxs[1010]; vector<pair<int,long long> > v[1010]; bool vis[1010],infs; void DFS(int x,long long pnt){ if(pnt>2000000000000)return; #include<algorithm> #include<vector> using namespace std; int n,m; long long maxs[1010]; v...
a.cc: In function 'void DFS(int, long long int)': a.cc:22:30: error: a function-definition is not allowed here before '{' token 22 | void DFS(int x,long long pnt){ | ^ a.cc:36:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 36 | int ma...
s278539031
p03722
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int n,m; long long maxs[1010]; vector<pair<int,long long> > v[1010]; bool vis[1010],infs; void DFS(int x,long long pnt){ if(pnt>2000000000000)return; #include<algorithm> #include<vector> using namespace std; int n,m; long long maxs[1010]; v...
a.cc: In function 'void DFS(int, long long int)': a.cc:22:30: error: a function-definition is not allowed here before '{' token 22 | void DFS(int x,long long pnt){ | ^ a.cc:36:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 36 | int ma...
s586731296
p03722
C++
#include <iostream> #include <string> #define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i)) using namespace std; const int N_MAX = 1050; // minus infinity const long MINF = -int(1e9)-50; int N,M; long A[N_MAX][N_MAX] = {}; // i: 今居る頂点 // s: iまでのスコア・コスト long dfs(int i, long s) { if (i == N-1) return s; /* A[i] ; ...
a.cc: In function 'long int dfs(int, long int)': a.cc:27:9: error: 'j' was not declared in this scope 27 | REP(0,j,N) { | ^ a.cc:3:32: note: in definition of macro 'REP' 3 | #define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i)) | ^ a.cc:27:7: error: lvalue required...
s441895337
p03722
C++
#include <iostream> #include <iomanip> #include <cmath> #include <queue> #include <map> #include <cstdlib> #include <algorithm> #include <utility> #include <queue> #include <string> #include <functional> #define rep(i, a, b) for(int i=a;i<b;++i) #define MOD 1000000007 #define RAND 1000 using namespace std; int a[10000...
a.cc:20:22: error: 'LLONG_MIN' was not declared in this scope 20 | long long int maxy = LLONG_MIN; | ^~~~~~~~~ a.cc:12:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 11 | #include <functional> +++ |+#include <climits> ...
s027380259
p03722
C++
#include <iostream> #include <vector> using namespace std; // 隣接リストで使う辺を表す型 struct Edge { long long to, cost; // 辺の接続先頂点, 辺の重み Edge(long long to, long long cost) : to(to), cost(cost) {} // コンストラクタ }; typedef vector<vector<Edge> > AdjList; // 隣接リストの型 AdjList graph; // グラフの辺を格納した構造体 // graph[v][...
a.cc: In function 'int main()': a.cc:54:16: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator<<' 54 | -dist[n-1] << endl; | ~~~~~~~~~~~^~~~~~~
s186543236
p03722
C++
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 3010, inf = 1e17; int n, m, a, b, c, u, v, w, flag = 0, cnt; vector <int> top; vector < pair <int, int> > g[N]; int was[N], dp[N]; void dfs(int v) { if (was[v]) return; was[v] = 1; for (auto i : g[v]) dfs(i.first); ...
a.cc:19:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 19 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:51:17: error: expected ';' before 'if' 51 | else cnt = 0 | ^ | ; 52 | if (cnt > 100) break; | ...
s441135133
p03722
C++
#include <iostream> #include <algorithm> #include <vector> #include <memory> using namespace std; #define reps(i,s,n) for(int (i) = (s); (i) < (n); ++(i)) #define rep(i,n) reps(i,0,n) using ll = long long; struct edge{ll from,to,cost;}; edge es[1001],m_es[1001]; #define MAX_V 1001 ll d[MAX_V]; ll V,E; #define INF 19...
a.cc: In function 'bool find_negative()': a.cc:40:5: error: 'memset' was not declared in this scope 40 | memset(d,0,sizeof(d)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <memory> +++ |+#include <cstring...
s264865623
p03722
C++
#include <iostream> #include <vector> using namespace std; // 隣接リストで使う辺を表す型 struct Edge { long long int to, cost; // 辺の接続先頂点, 辺の重み Edge(long long int to, long long int cost) : to(to), cost(cost) {} // コンストラクタ }; typedef vector<vector<Edge> > AdjList; // 隣接リストの型 AdjList graph; // グラフの辺を格納した構造体 ...
a.cc: In function 'int main()': a.cc:59:2: error: expected '}' at end of input 59 | } | ^ a.cc:37:12: note: to match this '{' 37 | int main() { | ^
s274187525
p03722
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define reps(i,s,n) for(int (i) = (s); (i) < (n); ++(i)) #define rep(i,n) reps(i,0,n) using ll = long long; struct edge{int from,to,cost;}; edge es[1001],m_es[1001]; #define MAX_V 1001 int d[MAX_V]; int V,E; #define INF 1930000000 #defin...
a.cc: In function 'bool find_negative()': a.cc:38:5: error: 'memset' was not declared in this scope 38 | memset(d,0,sizeof(d)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <vector> +++ |+#include <cstring...
s329405077
p03722
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> using namespace std; using ll = long long int; struct edge { ll from, to, cost; edge(ll a,ll b,ll c) : from(a) , to(b) , cost(c){ } }; edge es[2010]; ll d[1010]; ll V, E; ll INF = 9223372036854775807; bool bellman_ford(...
a.cc:17:13: error: no matching function for call to 'edge::edge()' 17 | edge es[2010]; | ^ a.cc:12:1: note: candidate: 'edge::edge(ll, ll, ll)' 12 | edge(ll a,ll b,ll c) : from(a) , to(b) , cost(c){ | ^~~~ a.cc:12:1: note: candidate expects 3 arguments, 0 provided a.cc:11:8: note: candid...
s633635679
p03722
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(); long[] d = new long[N]; boolean flg = false; long ans = 0; ArrayList<Edge> edge = new ArrayList<Edge>(); for(int i = 0; i <...
Main.java:11: error: cannot find symbol ArrayList<Edge> edge = new ArrayList<Edge>(); ^ symbol: class Edge location: class Main Main.java:11: error: cannot find symbol ArrayList<Edge> edge = new ArrayList<Edge>(); ^ symbol: class Edge location: ...
s353761020
p03722
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <numeric> #include <stack> #include <queue> #include <map> #include <set> #include <utility> #include <sstream> #include <complex> #include <fstream> #include <bitset> #include ...
a.cc: In function 'int main()': a.cc:79:29: error: 'LLONG_MIN' was not declared in this scope 79 | fill(d, d + 100100, LLONG_MIN); | ^~~~~~~~~ a.cc:18:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 17 | #incl...
s459422577
p03722
C++
# include <iostream> # include <sstream> # include <cstdio> # include <cstdlib> # include <algorithm> # include <string> # include <cstring> # include <cmath> # include <stack> # include <queue> # include <vector> # include <list> # include <map> # include <set> # include <deque> # include <iterator> # include <functio...
a.cc: In function 'int main()': a.cc:504:53: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'BigNumber') 504 | if (!SPFA(1, n)) printf("inf\n"); else cout << (-dist[n]); | ~~~~ ^~ ~~~~~~~~~~ | ...
s874584138
p03722
C++
# include <iostream> # include <sstream> # include <cstdio> # include <cstdlib> # include <algorithm> # include <string> # include <cstring> # include <cmath> # include <stack> # include <queue> # include <vector> # include <list> # include <map> # include <set> # include <deque> # include <iterator> # include <functio...
a.cc: In function 'int main()': a.cc:504:53: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'BigNumber') 504 | if (!SPFA(1, n)) printf("inf\n"); else cout << -dist[n] << endl; | ~~~~ ^~ ~~~~~~~~ ...
s116778892
p03722
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; struct Edge{ //边类型定义 ll u,v; //起点和终点 ll l; //边长-----------------------------******(可能是浮点型) }; ll n,m; //n是点数,m是边数 const ll N=1005,M=2006; //问题中给出的可能的最大点数和最大边数(无向边算两条边)-----------------*******(根据实际问题修改) const ll MAXL = 1e15; //边的无限长 Edge edge[M...
a.cc: In function 'bool relaxX(Edge)': a.cc:31:46: error: expected ';' before 'return' 31 | if((e.u)==(n-1)||(e.v==(n-1))return true; //进行更新的话返回真值 | ^~~~~~ | ; a.cc:32:9: error: expected primary-exp...
s344185626
p03722
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; struct Edge{ //边类型定义 ll u,v; //起点和终点 ll l; //边长-----------------------------******(可能是浮点型) }; ll n,m; //n是点数,m是边数 const ll N=1005,M=2006; //问题中给出的可能的最大点数和最大边数(无向边算两条边)-----------------*******(根据实际问题修改) const ll MAXL = 1e15; //边的无限长 Edge edge[M...
a.cc: In function 'bool relaxX(Edge)': a.cc:31:45: error: expected ')' before 'return' 31 | if((e.u)==(n-1)||(e.v==(n-1)return true; //进行更新的话返回真值 | ~ ^~~~~~ | ) a.cc:31:56: error: expected ')' before ';...
s812161897
p03722
C++
#include <cstdio> #include <cstring> #include <vector> #include <queue> #include <string> #include <algorithm> #include <iostream> #include <string> #include <map> #include <set> #include <functional> #include <iostream> #define INF 10000000000007LL using namespace std; typedef long long ll; typedef pair<int,ll> P;   i...
a.cc:17:1: error: extended character   is not valid in an identifier 17 |   | ^ a.cc:21:1: error: extended character   is not valid in an identifier 21 |   | ^ a.cc:48:1: error: extended character   is not valid in an identifier 48 |   | ^ a.cc:17:1: error: '\U000000a0' does not name a type ...
s681523632
p03722
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> using namespace std; using ll = long long int; struct edge { ll from, to, cost; edge(ll a,ll b,ll c) : from(a) , to(b) , cost(c){ } }; vector<edge> es[1010]; vector<ll> d; ll V, E; ll INF = 9223372036854775807; // 戻り値がt...
a.cc: In function 'int main()': a.cc:59:10: error: expected '}' at end of input 59 | } | ^ a.cc:43:12: note: to match this '{' 43 | int main() { | ^
s624675924
p03722
C++
#include<iostream> #include<vector> #include<stack> #include<algorithm> using namespace std; struct Node { long long max_score; bool visited; std::vector<pair<int ,int>> connect; }; int main() { long long N, M; cin >> N >> M; std::vector<Node> nodes(N + 1); for (int i = 1; i <= N; i++) { nodes[i].max_score...
a.cc: In function 'int main()': a.cc:21:38: error: 'LLONG_MIN' was not declared in this scope 21 | nodes[i].max_score = LLONG_MIN; | ^~~~~~~~~ a.cc:5:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits...
s090284349
p03722
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; long long n,m; bool infs; bool vis[1010]; long long maxs[1010]; vector<long long> v[1010]; vector<long long>score[1010]; void DFS(long long key,long long pnt){ if(vis[key]){infs=true;return;} maxs[key]=pnt; vis[key]=true; for(long long i=0...
cc1plus: error: '::main' must return 'int'
s580976312
p03722
C++
#include <set> #include <map> #include <list> #include <stack> #include <queue> #include <cmath> #include <ctime> #include <cstdio> #include <vector> #include <string> #include <bitset> #include <cctype> #include <cstdlib> #include <cstring> #include <utility> #include <numeric> #include <complex> #include <sstream> #i...
a.cc:30:17: error: 'LLONG_MAX' was not declared in this scope 30 | const int INF = LLONG_MAX; | ^~~~~~~~~ a.cc:25:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 24 | #include <algorithm> +++ |+#include <climits> 25 | using ...
s428548319
p03722
C++
#include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #include <queue> using namespace std; void SPFA(); queue<int> q; int dis[1005],a[1005][1005],n,m,st,en,time[1005]; bool flag; int main() { while(scanf("%d%d",&n,&m)!=EOF) { flag=1; memset(a,0,sizeof(a)...
a.cc:10:48: error: 'int time [1005]' redeclared as different kind of entity 10 | int dis[1005],a[1005][1005],n,m,st,en,time[1005]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:3...
s224512682
p03722
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <vector> #include <algorithm> #include <queue> #include <cmath> #include <map> #define eps 0.0000000001 #define maxn 30009 #define inf 0x3f3f3f3f #define mod 1000000009 #define ll long long using namespace std; int n,m; struct ee { int to; ll v...
a.cc: In function 'int main()': a.cc:57:21: error: 'ann' was not declared in this scope; did you mean 'ans'? 57 | ann=d[u]; | ^~~ | ans a.cc:61:24: error: 'ann' was not declared in this scope; did you mean 'ans'? 61 | if(a...
s804829391
p03722
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,ll> P; const ll INF=9000000000000000000LL; int N,M; ll score[1234]; bool X[1234][1234]; vector<P> e[2345]; void dfs(int s){ if(s==N) return; for(int i=0; i<e[s].size(); i++){ score[e[s][i].first]=max(score[e[s][i].fi...
a.cc:34:1: error: extended character   is not valid in an identifier 34 |   for(int j=1; j<=N; j++){ | ^ a.cc:34:1: error: extended character   is not valid in an identifier a.cc:38:1: error: extended character   is not valid in an identifier 38 |   } | ^ a.cc:38:1: error: extended character   is not ...
s090303981
p03722
C++
#include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <complex> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <bitset> #include <ctime> #include <map> #include <uno...
a.cc: In function 'bool Bellman_Ford(int, int, int, edge*, LL*)': a.cc:79:34: error: no match for 'operator-' (operand types are 'VI' {aka 'std::vector<int>'} and 'int') 79 | FORE(e, v) if (e = v - 1) return true; | ~ ^ ~ | | | ...
s236184508
p03722
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <vector> #include <queue> #include <map> #include <set> #include <functional> #include <cmath> #include <complex> #include <cctype> #include <cassert> #include <sstream> #include <ctime> #include <cstdlib> using namespace std; #defi...
a.cc: In function 'int main()': a.cc:67:28: error: invalid types 'int[ll {aka long long int}]' for array subscript 67 | cnt[pos]++; | ^ a.cc:68:32: error: invalid types 'int[int]' for array subscript 68 | if (cnt[n - 1] >= 20) { ...
s177929961
p03722
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include...
a.cc: In function 'bool find_negative_loop()': a.cc:54:9: error: 'memset' was not declared in this scope 54 | memset(d, 0, sizeof(d)); | ^~~~~~ a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 22 | #include <assert.h> +++ |...
s409821099
p03723
Java
a,b,c=map(int,input().split()) cnt=0 if a==b==c and a%2==0: print(-1) else: while a%2==0 and b%2==0 and c%2==0: a,b,c=(b+c)//2,(a+c)//2,(a+b)//2 cnt+=1 print(cnt)
Main.java:1: error: class, interface, enum, or record expected a,b,c=map(int,input().split()) ^ 1 error
s720152678
p03723
C++
#include <bits/stdc++.h> #define LL long long #define PII pair #define MP(x, y) make_pair((x),(y)) #define fi first #define se second #define PB(x) push_back((x)) #define MMG(x) memset((x), -1,sizeof(x)) #define MMF(x) memset((x),0,sizeof(x)) #define MMI(x) memset((x), INF, sizeof(x)) using namespace std; const int I...
a.cc: In function 'int bfs(int, int)': a.cc:25:5: error: 'queueq' was not declared in this scope 25 | queueq; | ^~~~~~ a.cc:26:5: error: 'q' was not declared in this scope 26 | q.push(MP(sx, sy)); | ^
s395445140
p03723
C++
#include <bits/stdc++.h> #include <atcoder/segtree> using namespace atcoder; #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") //#include <boost/multiprecision/cpp_int.hpp> using namespace std; using dou =long double; string yes="yes"; string Yes="Yes"; string YES="YES"; st...
a.cc:2:10: fatal error: atcoder/segtree: No such file or directory 2 | #include <atcoder/segtree> | ^~~~~~~~~~~~~~~~~ compilation terminated.
s026212007
p03723
C++
#include <bits/stdc++.h> #define rep(i, n) for(long long i = 0; i < n; i++) using ll = long long; using ld = long double; using namespace std; int main() { int A, B, C, a, b, c, N = 0; cin >> A >> B >> C; bool b = true; a = A; b = B; c = C; while(true) { A = B / 2 + C / 2; B = A / 2 + C / 2; C...
a.cc: In function 'int main()': a.cc:9:8: error: conflicting declaration 'bool b' 9 | bool b = true; | ^ a.cc:7:19: note: previous declaration as 'int b' 7 | int A, B, C, a, b, c, N = 0; | ^
s109169039
p03723
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = 1; i < (int)(n+1); i++) int main() { int A,B,C; cin>>A>>B>>C; int ans=true; rep(i,100000000){ if(A==B&&B==C) { if(...
a.cc: In function 'int main()': a.cc:17:20: error: expected ';' before ':' token 17 | break:} | ^ | ; a.cc:17:20: error: expected primary-expression before ':' token
s405876539
p03723
C++
int main(){ int a_ini,b_ini,c_ini; //A,B,Cの初期値 cin>>a_ini>>b_ini>>c_ini; int a=a_ini; int b=b_ini; int c=c_ini; int count=0; int a_temp,b_temp,c_temp; while(a%2==0 && b%2==0 && c%2==0){ a_temp=a; b_temp=b; c_temp=c; a=b_temp/2+c_temp/2; ...
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope; did you mean 'c_ini'? 3 | cin>>a_ini>>b_ini>>c_ini; | ^~~ | c_ini a.cc:27:5: error: 'cout' was not declared in this scope; did you mean 'count'? 27 | cout<<count<<endl; | ^~~~ | ...
s502599616
p03723
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); sc.close(); int ans = 0; int a2, b2, c2; while (a % 2 == 0 && b % 2 == 0 && c % 2 == 0) { if (a == b && b == c) { ans = -1; ...
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s944587447
p03723
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c; int x,y,z,count; count = 0; cin >> a >> b >> c; while(){ if(a%2==1 || b%2==1 || c%2==1){ cout << count << endl; break; } else if(a==b && b==c && c==a){ cout << -1 << endl; break; } x = b/2 + c/2;...
a.cc: In function 'int main()': a.cc:9:9: error: expected primary-expression before ')' token 9 | while(){ | ^
s633568084
p03723
C
#include <stdio.h> int main(void){ int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a==b && b==c && c==a %% a%2==0 %% b%2==0 && c%2==0){ printf("-1\n"); return 0; } int ans=0; while(a%2==0 && b%2==0 && c%2==0){ int _a=a, _b=b, _c=c; a=_b/2+_c/2; b=_a/2+_c/2;...
main.c: In function 'main': main.c:5:30: error: expected expression before '%' token 5 | if(a==b && b==c && c==a %% a%2==0 %% b%2==0 && c%2==0){ | ^
s760610113
p03723
C++
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数 int lcm(int ...
a.cc: In function 'int main()': a.cc:75:5: error: 'x' was not declared in this scope 75 | x = nc; | ^
s660033500
p03723
C++
#include <bits/stdc++.h> using namespace std; int main() { int l = ; vector <int> a(l); vector <int> b(l); vector <int> c(l); cin >> a.at(0) >> b.at(0) >> c.at(0); int ans =0 ; for ( int i=0 ; ; i++){ if ( a.at(i)%2==1 || b.at(i)%2==1 || c.at(i)%2==1){ cout << ans << endl ; return 0 ; ...
a.cc: In function 'int main()': a.cc:5:11: error: expected primary-expression before ';' token 5 | int l = ; | ^