submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s281689288 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct bellford
{
const ll INF=LONG_LONG_MAX;
struct edge {int u, v; ll w;};
int nv, ne;
vector<ll> d;
vector<int> p;
vector<edge> E;
bellford(int nv, int ne) : nv(nv), ne(ne)
{
d.resize(nv, INF);
p.res... | a.cc: In function 'int main()':
a.cc:65:14: error: expected '}' at end of input
65 | return 0;
| ^
a.cc:51:1: note: to match this '{'
51 | {
| ^
|
s706634791 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define _GLIBCXX_DEBUG
#define rep(i, V) for (int i = 0; i < V; i++)
#define repr(i, V) for (int i = V-1; i >= 0; i--)
#define repval(i, a, V) for (int i = a; i < V ; i++)
#define all(x) x.begin(), x.end()
#define ld long double
#define eps 0.000000000... | a.cc: In function 'int main()':
a.cc:44:39: error: 'struct Edge' has no member named 'first'
44 | if (i == n-1 && e.first == n-1){
| ^~~~~
|
s424421176 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1... | a.cc: In function 'void c_dfs(int)':
a.cc:21:5: error: reference to 'visit' is ambiguous
21 | visit[src]=1;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visit... |
s338709835 | p03722 | C++ | /**
* author: FromDihPout
* created: 2020-07-26
**/
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<pair<pair<int,int>, int>> edges(m);
for (int i = 0; i < m; i++) {
... | a.cc: In function 'int main()':
a.cc:30:23: error: 'struct std::pair<std::pair<int, int>, int>' has no member named 'f'
30 | int u = e.f.f, v = e.f.s, w = e.s;
| ^
a.cc:32:23: error: 'v' was not declared in this scope
32 | score[v] = max(score[v], score[u] +... |
s561652083 | p03722 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
int main()
{
const ll INF = -1e15;
struct edge{
ll from;
ll to;
ll cost;
};
ll n, m;
cin >> n >> m;
vector<edge>edges(m);
... | a.cc: In function 'int main()':
a.cc:42:5: error: expected primary-expression before '}' token
42 | }
| ^
|
s518557356 | p03722 | C++ | //https://atcoder.jp/contests/abc061/tasks/abc061_d
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;
typedef pair<int,pint> ppint;
typedef pair<ll,pll> ppll;
typedef vector<int> vint;
typedef vector<ll> vll;
const double pi=3.141592653589793;
co... | a.cc: In function 'void Main()':
a.cc:207:39: error: expected ':' before ';' token
207 | negative[n-1]?cout << "inf" <<endl;cout << -res[n-1] <<endl;
| ^
| :
a.cc:207:39: error: expected primary-expression before ';' token
|
s189759795 | p03722 | C++ | #include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
const ll oo = 1e11 + 7;
const int mod = 1e9 + 7, maxn = (2 * 1e3) + 10;
const long double PI = acos(-1);
int main (){
ios_base::sync_with_stdio(fals... | a.cc: In function 'int main()':
a.cc:33:20: error: 'i' was not declared in this scope
33 | if (dist[a[i]] == oo) continue;
| ^
|
s445102951 | p03722 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <tuple>
#include <bitset>
#include <random>
#define REP(i,n) for(int i=0;i<n;i++)
#define INF 100000000000000000
using namespace st... | a.cc: In function 'void Bellman_Ford(std::vector<std::vector<std::pair<int, int> > >, int)':
a.cc:15:13: warning: overflow in conversion from 'long int' to 'std::vector<int>::value_type' {aka 'int'} changes value from '100000000000000000' to '1569325056' [-Woverflow]
15 | #define INF 100000000000000000
| ... |
s996845667 | p03722 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<stack>
#include<queue>
#include<tuple>
#include<cassert>
#include<set>
#include<functional>
//#include<bits/stdc++.h>
using ll = long long;
using ld = long double;
using... | a.cc: In function 'bool find_negative_loop(ll, ll)':
a.cc:64:9: error: 'memset' was not declared in this scope
64 | memset(d, 0, sizeof(d));
| ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
14 | #include<functional>
... |
s589293808 | p03722 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#in... | a.cc: In function 'int main()':
a.cc:115:39: error: expected '}' at end of input
115 | else cout << point[n - 1] << endl;
| ^
a.cc:92:12: note: to match this '{'
92 | int main() {
| ^
|
s996663891 | p03722 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#in... | a.cc: In function 'int main()':
a.cc:112:39: error: expected '}' at end of input
112 | else cout << point[n - 1] << endl;
| ^
a.cc:92:12: note: to match this '{'
92 | int main() {
| ^
|
s550625643 | p03722 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;
template<typename T> struct WG{
using P = tuple<int, int, T>;
int n; T inf = 2000000000000000000;
vector<bool> negative_loop(n, false);
vector<P> edges;
vector<T> ans;
WG(int n_){
n = n_;
ans.resize(n, inf);
... | a.cc:8:30: error: 'n' is not a type
8 | vector<bool> negative_loop(n, false);
| ^
a.cc:8:33: error: expected identifier before 'false'
8 | vector<bool> negative_loop(n, false);
| ^~~~~
a.cc:8:33: error: expected ',' or '...' before 'fa... |
s926577057 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
long long INF = 1000000000000000;
int main(){
int N, M;
cin >> N >> M;
vector<vector<pair<int, int>>> E(N);
for (int i = 0; i < M; i++){
int a, b, c;
cin >> a >> b >> c;
a--;
b--;
E[a].push_back(make_pair(c, b));
}
vector<vector<long long>> d... | a.cc: In function 'int main()':
a.cc:29:24: error: no match for 'operator!=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type... |
s068896693 | p03722 | Java | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.ArrayDeque;
import java.util.Queue;
clas... | Main.java:35: error: cannot find symbol
Arrays.fill(V,0);
^
symbol: variable V
location: class Main
Main.java:48: error: cannot find symbol
deg[from]++;
^
symbol: variable deg
location: class Main
Main.java:49: error: cannot find symbol
deg[to]... |
s548602908 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;
// =================グラフテンプレート==================
// costの部分の型は指定できます
template <typename T>
struct edge {
int from, to;
T cost;
edge(int to, T cost) : from(-1), to(to), cost(cost) ... | a.cc: In function 'int main()':
a.cc:82:16: error: 'N' was not declared in this scope
82 | cout<<-ans[N-1]<<endl;
| ^
|
s077877291 | p03722 | C++ | // =================グラフテンプレート==================
// costの部分の型は指定できます
template <typename T>
struct edge {
int from, to;
T cost;
edge(int to, T cost) : from(-1), to(to), cost(cost) {}
edge(int from, int to, T cost) : from(from), to(to), cost(cost) {}
// 行き先を代入できる
edge &operator=(const int &x) {
to = x;
... | a.cc:23:15: error: 'vector' does not name a type
23 | using Edges = vector<edge<T>>;
| ^~~~~~
a.cc:26:23: error: 'vector' does not name a type
26 | using WeightedGraph = vector<Edges<T>>;
| ^~~~~~
a.cc:29:16: error: 'vector' does not name a type
29 | using Matrix... |
s907332121 | p03722 | C++ | // =================グラフテンプレート==================
// costの部分の型は指定できます
template <typename T>
struct edge {
int from, to;
T cost;
edge(int to, T cost) : from(-1), to(to), cost(cost) {}
edge(int from, int to, T cost) : from(from), to(to), cost(cost) {}
// 行き先を代入できる
edge &operator=(const int &x) {
to = x;
... | a.cc:23:15: error: 'vector' does not name a type
23 | using Edges = vector<edge<T>>;
| ^~~~~~
a.cc:26:23: error: 'vector' does not name a type
26 | using WeightedGraph = vector<Edges<T>>;
| ^~~~~~
a.cc:29:16: error: 'vector' does not name a type
29 | using Matrix... |
s685925690 | p03722 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; (i) < (n); (i)++)
using namespace std;
long modpow(long a, long n, long mod) {
long res = 1;
while (n > 0) {
if (n & 1) res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
// a^{-1} mod を計算する
long modinv(long ... | a.cc: In member function 'void BellmanFord::shortest_path(int)':
a.cc:269:20: error: 'N' was not declared in this scope
269 | cout << -d[N-1] << endl;
| ^
|
s181888799 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (ll i = 0; i < (n); i++)
typedef pair<int, int> P;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
const ll INF = -1e10+7;
struct edge{
int from;
int to;
int c;
};
bool bellma... | a.cc: In function 'int main()':
a.cc:65:1: error: '_' was not declared in this scope
65 | _
| ^
|
s301287243 | p03722 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
... | a.cc: In function 'int main()':
a.cc:27:24: error: expression list treated as compound expression in initializer [-fpermissive]
27 | bool neg(N + 1, false);
| ^
a.cc:41:16: error: conflicting declaration 'std::vector<bool> neg'
41 | vector<bool> neg(N + 1, false);
| ... |
s567213168 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
struct edge {
int from;
int to;
long long cost;
};
long long INF = 1e12;
vector<long long> bellman_ford(vector<edge> es, int start_point, int vertex_num) {
vector<long long> shortest_path(vertex_num, INF);
shortest_path[start_point] = 0;
for (int i... | a.cc: In function 'int main()':
a.cc:51:36: error: expected ';' before '}' token
51 | cout << -shortest_path[N-1]
| ^
| ;
52 | }
| ~
|
s826238346 | p03722 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=10... | a.cc: In function 'int main()':
a.cc:66:16: error: too few arguments to function 'void shortest_path(ll)'
66 | shortest_path();
| ~~~~~~~~~~~~~^~
a.cc:41:6: note: declared here
41 | void shortest_path(ll s){
| ^~~~~~~~~~~~~
|
s480094962 | p03722 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=10... | a.cc: In function 'int main()':
a.cc:73:27: error: 'inf' was not declared in this scope; did you mean 'ynf'?
73 | if(d[e.from]!=inf&&d[e.to]>d[e.from]+e.cost){
| ^~~
| ynf
a.cc:77:21: error: return-statement with no value, in function return... |
s002153455 | p03722 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef... | a.cc:15:13: error: conflicting declaration 'typedef int ll'
15 | typedef int ll;
| ^~
a.cc:8:19: note: previous declaration as 'typedef long long int ll'
8 | typedef long long ll;
| ^~
|
s982955994 | p03722 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define INF 100100100100100
using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
// 隣接リストで使う辺を表す型
struct Edge {
int to;
ll cost; ... | a.cc: In function 'void bellman_ford(int, int)':
a.cc:39:22: error: expected ';' before '}' token
39 | loop=true
| ^
| ;
40 | } // n回目にも更新があるなら負の閉路が存在
| ~
a.cc:58:9: warning: empty parentheses were disambiguated... |
s430398178 | p03722 | C++ | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long
using namespace std;
void file(){
... | In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<std::tuple<int, int, int>, std::allo... |
s558104613 | p03722 | C++ | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long
using namespace std;
void file(){
... | In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<std::tuple<long long int, long long ... |
s836583966 | p03722 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.StringTokenizer;
import contest061.BellmanFord... | Main.java:12: error: package contest061.BellmanFord does not exist
import contest061.BellmanFord.Response;
^
Main.java:41: error: cannot find symbol
Response res = bel.bellmanford(0, N - 1);
^
symbol: class Response
location: class Main
2 errors
|
s259177766 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
#define MAX_V 1000
#define MAX_E 2000
#define INF 1e9
struct edge {
int from, to, cost;
};
int V, E, d[MAX_V];
edge es[MAX_E];
bool find_negative_loop(int s)
{
int cnt = 0;
for (int i = 0; i < V; i++) {
d[i] = INF;
}
d[s] = 0;
while (true) {
bool upda... | a.cc:53:5: error: expected unqualified-id before 'return'
53 | return 0;
| ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
54 | }
| ^
|
s785691322 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2000 + 5;
const ll oo = 0x3f3f3f3f3f3f3f3f;
int N, M;
ll d1, d2;
int main(){
while (cin >> N >> M){
vector<int>a(M);
vector<int>b(M);
vector<ll>c(M);
for (int i = 0; i < M; i++){
cin >> a[i] >> b[i] >> c[i];
a[i]--, b[i]-... | a.cc: In function 'int main()':
a.cc:28:10: error: expected '}' at end of input
28 | }
| ^
a.cc:8:11: note: to match this '{'
8 | int main(){
| ^
|
s126882413 | p03722 | C++ | #include "pch.h"
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include<algorithm>
#include<sstream>
#include<iomanip>
#include<deque>
#include<list>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
con... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s923145021 | p03722 | C++ | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#d... | a.cc: In function 'void find_negative_loop()':
a.cc:53:21: error: 'e' was not declared in this scope
53 | if(dist[e.from]==INF) continue;
| ^
|
s026712923 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#defin... | a.cc: In member function 'void BellmanFord<T>::get_distance(int)':
a.cc:45:21: error: 'update' was not declared in this scope
45 | update = true;
| ^~~~~~
|
s549535462 | p03722 | C++ |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//Number unexplored line, INF = infinity
const ll INF = 1LL << 50;
int main(void){
//문제에서 주어진 노드와 간선의 최대수
const int NMAX = 1005;
const int MMAX = 2005;
//Number of Node, N and Roads, M
int N, M;
cin >> N >> M;
... | a.cc: In function 'int main()':
a.cc:51:41: error: 'TRUE' was not declared in this scope
51 | if (i == N) Cycle = TRUE;
| ^~~~
a.cc:58:17: error: 'TRUE' was not declared in this scope
58 | if(Cycle == TRUE) cout << "inf" << endl;
| ... |
s504717219 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//Number unexplored line, INF = infinity
const ll INF = 1LL << 50;
int main(void){
//문제에서 주어진 노드와 간선의 최대수
const int NMAX = 1005;
const int MMAX = 2005;
//Number of Node, N and Roads, M
int N, M;
cin >> N >> M;
... | a.cc: In function 'int main()':
a.cc:50:41: error: 'True' was not declared in this scope
50 | if (i == N) Cycle = True;
| ^~~~
a.cc:57:17: error: 'True' was not declared in this scope
57 | if(Cycle == True) cout << "Cycle" << endl;
| ... |
s556481686 | p03722 | C++ | #include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;//ベルマンとかはllにしよ
//ここ十分にしないとだめ
#define INF 1000000000000
struct Edge{
ll to_Node;
ll cost;
Edge(ll t,ll c){to_Node=t;cost=c;}
};
//関係ないループを外す
bool bellmanford(vector< vector<Edge> >& Edges,vector<ll... | a.cc: In function 'bool bellmanford(std::vector<std::vector<Edge> >&, std::vector<long long int>&, ll)':
a.cc:20:5: error: 'f' was not declared in this scope
20 | f=false;
| ^
|
s767741025 | p03722 | C++ | #include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;//ベルマンとかはllにしよ
//ここ十分にしないとだめ
#define INF 1000000000000
struct Node{
//ノードの情報
vector<pair<ll,ll>> edge;//各エッジの接続先のノード番号とコスト
//ベルマンフォード法用のデータ
ll mincost=INF;//そのノードへの最小コスト
};
//関係ないループを外す
bool bel... | a.cc: In function 'bool bellmanford(std::vector<Node>&, ll)':
a.cc:29:19: error: 'l' was not declared in this scope
29 | if(i==l-1 and x.edge[k].first==l-1) return true;
| ^
|
s054479448 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
template <typename T>
struct edge{
int from, to;
T co... | a.cc: In function 'std::vector<_Tp> BellmanFord(int, int, std::vector<edge<T> >&, T)':
a.cc:39:58: error: 'n' was not declared in this scope
39 | if(dist[e.from] + e.cost < dist[e.to] && e.to == n - 1) return vector<T>();
| ^
|
s240497273 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
template <typename T>
struct edge{
int from, to;
T co... | a.cc: In function 'int main()':
a.cc:71:34: error: no matching function for call to 'BellmanFord(int&, int, std::vector<edge<long long int> >&, double)'
71 | vector<ll> dist = BellmanFord(n, 0, es, 1e15);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:27:11: note: candidate: 'template<class T> st... |
s779607361 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
/*
MODint依存
*/
template <typename T>
struct Comb{
vec... | a.cc: In function 'int main()':
a.cc:118:10: error: 'Mint' was not declared in this scope; did you mean 'uint'?
118 | Comb<Mint<>> C(1000);
| ^~~~
| uint
a.cc:118:14: error: template argument 1 is invalid
118 | Comb<Mint<>> C(1000);
| ^
a.cc:118:15: error: ex... |
s922870304 | p03722 | C++ | //#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL<<60LL)
typedef long long ll;
using namespace std;
ll n, m;
vector<vector<ll>> g(1001, vector<ll>());
map<pair<ll, ll>, ll> m1;
vector<ll>... | a.cc: In function 'll ret(ll, ll, std::vector<long long int>, ll)':
a.cc:37:20: error: too few arguments to function 'll ret(ll, ll, std::vector<long long int>, ll)'
37 | ret(b, s+ m1[{a, b}],svec);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:18:4: note: declared here
18 | ll ret(ll a,... |
s235695271 | p03722 | C++ | //#include "stdafx.h"
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>
#include <... | a.cc: In function 'int main()':
a.cc:134:25: error: expected primary-expression before ')' token
134 | if (!res.update)) {
| ^
|
s610393173 | p03722 | C++ | // ベルマンフォード法(O(V*E))V:頂点、E:辺の数
// 単一始点最短路問題
// 負の辺を含む時はこっち
// 含まない時はdijkstraダイクストラ(O(ElogV))が良い。
#include <bits/stdc++.h>
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define size_t unsigned long long
#define ll long long
#define rep(i,a) for(int i=0;i<(a);i++)
#define repr(i,a) for(int... | a.cc: In function 'int main()':
a.cc:77:16: error: expected ';' before 'using'
77 | cin >> V >> E// ベルマンフォード法(O(V*E))V:頂点、E:辺の数
| ^
| ;
......
93 | using namespace std;
| ~~~~~
a.cc:94:7: warning: empty parentheses were disambiguated as a function decla... |
s111948711 | p03722 | C++ | #include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int n, m;
long long res[50000];
long long a[50000], b[50000], c[50000];
vector<int> g[50000], vg[50000];
int t[50000], f[50000];
int main()
{
cin >> n >> m;
for (int i = 0; i < m; i++) {cin >> a[i] >> b[i] >> c[i]; g[a[i]].push_back... | a.cc:10:1: error: 'vector' does not name a type
10 | vector<int> g[50000], vg[50000];
| ^~~~~~
a.cc: In function 'int main()':
a.cc:16:63: error: 'g' was not declared in this scope
16 | for (int i = 0; i < m; i++) {cin >> a[i] >> b[i] >> c[i]; g[a[i]].push_back(b[i]); vg[b[i]].push_back(a[i]);}
| ... |
s418810091 | p03722 | C++ | #include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int n, m;
long long res[50000];
long long a[50000], b[50000], c[50000];
vector<int> g[50000], vg[50000];
int t[50000], f[50000];
int main()
{
cin >> n >> m;
for (int i = 0; i < m; i++) {cin >> a[i] >> b[i] >> c[i]; g[a[i]].push_back... | a.cc:10:1: error: 'vector' does not name a type
10 | vector<int> g[50000], vg[50000];
| ^~~~~~
a.cc: In function 'int main()':
a.cc:16:63: error: 'g' was not declared in this scope
16 | for (int i = 0; i < m; i++) {cin >> a[i] >> b[i] >> c[i]; g[a[i]].push_back(b[i]); vg[b[i]].push_back(a[i]);}
| ... |
s597258342 | p03722 | C++ | #include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include<time.h>
using namespace std;
typedef long long int llint;
typedef pair<int, int> pint;
typedef vector<bool> vbool;
typedef... | a.cc: In function 'int main()':
a.cc:144:25: error: 'LLONG_MAX' was not declared in this scope
144 | vllint costs(n, LLONG_MAX);
| ^~~~~~~~~
a.cc:12:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
11 | #include<que... |
s876963617 | p03722 | C++ | //#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace std::chrono;
#define int long long
#define ll long long
auto start_time = system_clock::now();
//@formatter:off
#ifdef _DEBUG
//区間削除は出来ない
template<... | a.cc: In function 'auto dijkstra_cou(const graph<T>&, long long int, long long int)':
a.cc:909:203: error: there are no arguments to 'err' that depend on a template parameter, so a declaration of 'err' must be available [-fpermissive]
909 | template<class COU,class T=int> auto dijkstra_cou(const graph<T> &g, int s, i... |
s288215499 | p03722 | C | #include<iostream>
#include<vector>
using namespace std;
struct edge{long from,to,cost;};
long bellman_ford(int start){
long n,m,a;
cin>>n>>m;
edge es[m];
for(int i=0;i<m;i++){
cin>>es[i].from>>es[i].to>>es[i].cost;
es[i].from--;es[i].to--;es[i].cost*=-1;
}
vector<long>dist(n,0x7... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s975814328 | p03722 | C++ | #include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#de... | a.cc: In function 'int main()':
a.cc:78:6: error: 'ng' was not declared in this scope; did you mean 'n'?
78 | if(ng){
| ^~
| n
|
s737563269 | p03722 | C++ | #include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#de... | a.cc: In function 'void shortest_path(int)':
a.cc:42:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
42 | cnt++;
| ^~~
| int
a.cc: In function 'int main()':
a.cc:79:6: error: 'ng' was not declared in this scope; did you mean 'n'?
79 | if(ng){
| ... |
s935362953 | p03722 | C++ | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
const long long int INF=1e14;
vector<pair<pair<int, long long int>, int> > E;
int main() {
int N, M;
cin >> N >> M;
E.resize(M);
for(int m=0; m<M; m++) {
int a, b;
long long int c;
... | a.cc:46:5: error: 'cout' does not name a type
46 | cout << -score[N-1] << endl;
| ^~~~
a.cc:48:5: error: expected unqualified-id before 'return'
48 | return 0;
| ^~~~~~
a.cc:50:1: error: expected declaration before '}' token
50 | }
| ^
|
s959699747 | p03722 | C++ | #include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <iomanip>
#include <string>
#include <queue>
#include <numeric>
#include <functional>
#include <array>
#include <map>
#include <set>
#define INF /*1000000007*/ 1000000000000000003
#define MOD 1000... | a.cc: In function 'int main()':
a.cc:40:16: error: 'N' was not declared in this scope
40 | cin >> N >> M;
| ^
|
s288036609 | p03722 | C++ | from collections import deque
N,M = map(int,input().split())
dic = {}
for i in range(M):
a,b,c = map(int,input().split())
a -= 1
b -= 1
if a not in dic:
dic[a] = []
dic[a].append([b,c])
lis = [[0] * N for j in range(N)]
lis[0][0] = 1
lmax = [0] * N
lmax[0] = 1
mcost = [-1 * float("... | a.cc:1:1: error: 'from' does not name a type
1 | from collections import deque
| ^~~~
a.cc:8:1: error: expected unqualified-id before 'for'
8 | for i in range(M):
| ^~~
|
s866777210 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
// macro-----------------------------------------------------------------------------------------
#define rep(i, a, b) for (int i = a; i < b; i++)
#define int long long
const int inf = 100100100100000;
const int mod = 1000000007;
#define isvisiblechar(c) (0x21 <= (c) && (... | a.cc:32:24: error: '{anonymous}::MaiScanner& {anonymous}::MaiScanner::operator>>(long long int&)' cannot be overloaded with '{anonymous}::MaiScanner& {anonymous}::MaiScanner::operator>>(long long int&)'
32 | inline MaiScanner &operator>>(long long &var) {
| ^~~~~~~~
a.cc:28:24: note:... |
s271325366 | p03722 | C++ | #include<cstdio>
struct edge {
int from, to;
int cost;
};
int n, m;
long d[1000];
bool jf[1000], jb[1000];
edge e[2000];
int main() {
scanf("%d %d", &n, &m);
for (int i = 0; i < m; i++) {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
e[i].from = a - 1;
e[i].to = b - 1;
... | a.cc: In function 'int main()':
a.cc:24:25: error: 'v' was not declared in this scope
24 | for (int i = 0; i < v; i++) {
| ^
a.cc:30:25: error: 'v' was not declared in this scope
30 | for (int i = 0; i < v; i++) {
| ^
|
s055143583 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = ... | a.cc: In function 'void Main()':
a.cc:48:5: error: 'print' was not declared in this scope; did you mean 'rint'?
48 | print(cost);
| ^~~~~
| rint
|
s718570423 | p03722 | C++ |
#include <bits/stdc++.h>
#define For(i,n) for(long long i=0; i<n; i++)
using namespace std;
long long dp[2020];
bool visited[2020];
bool inff = false;
struct line{
long long a;
long long b;
long long c;
};
bool cmp(const line a, const line b){
return a.a<b.a;
}
void move(long long i, line* tes, long long ... | a.cc: In function 'void move(long long int, line*, long long int, long long int)':
a.cc:23:60: error: expected ']' before ')' token
23 | if(visited[tes[i].b && dp[tes[i].b]<dp[tes[i].a]+tes[i].c) inff=true;
| ^
| ... |
s835736826 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
using ll = long long;
using Graph = vector<vector<int>>;
vector<bool> seen, finished;
int pos; // vertex in cycle
stack<int> hist;
vector<ll> score;
vector<vector<ll>> value;
const ll INFTY = 1000000000001;
void loop(stack<... | a.cc: In function 'void dfs(const Graph&, int)':
a.cc:42:27: error: lvalue required as left operand of assignment
42 | if (score[v] == INFTY && score[nv] =! INFTY) {
|
s077230576 | p03722 | C++ | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return ... | a.cc: In function 'int main()':
a.cc:104:9: error: 'cycle' was not declared in this scope; did you mean 'cycle_'?
104 | cycle = true;
| ^~~~~
| cycle_
|
s680840481 | p03722 | C++ | #include <bits/stdc++.h>
#define sz(v) ((int)(v).size())
#define all(v) ((v).begin()),((v).end())
#define allr(v) ((v).rbegin()),((v).rend())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define Y imag()
#define X real()
#define clr... | a.cc: In function 'll solve(int)':
a.cc:49:8: error: conflicting declaration 'll ret'
49 | ll ret=-1e14;
| ^~~
a.cc:46:9: note: previous declaration as 'll& ret'
46 | ll &ret=mem[no];
| ^~~
|
s460031095 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long
struct edge{int a,b,c;};
main(){
int n,m,r;
cin>>n>>m;
vector<edge> e(m);
vector<int> d(n,-1e18),nc(n,0);
for(int i=0;i<m;++i){
cin>>e[i].a>>e[i].b>>e[i].c;
--e[i].a;--e[i].b;
}
dist[0]=0;
for(int i=0;i<2*n-1;++i)for(int j=0;j<m;++j){... | a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'dist' was not declared in this scope
14 | dist[0]=0;
| ^~~~
|
s941765017 | p03722 | C++ | #include<iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <queue>
#include <fstream>
#include <functional>
using namespace std;
using ll = long long;
#define all(x) (x).b... | a.cc: In function 'void Bellman_short(int)':
a.cc:157:23: error: 'LLONG_MAX' was not declared in this scope
157 | REP(i, V+1)d[i] = LLONG_MAX;
| ^~~~~~~~~
a.cc:15:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
14 | #inc... |
s535291359 | p03722 | C++ | #include<iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <queue>
#include <fstream>
#include <functional>
using namespace std;
using ll = long long;
#define all(x) (x).b... | a.cc: In function 'void Bellman_short(int)':
a.cc:157:23: error: 'LLONG_MAX' was not declared in this scope
157 | REP(i, V+1)d[i] = LLONG_MAX;
| ^~~~~~~~~
a.cc:15:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
14 | #inc... |
s509261024 | p03722 | C++ | #include<iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <queue>
#include <fstream>
#include <functional>
using namespace std;
using ll = long long;
#define all(x) (x).begin(),(x).end()
#de... | a.cc: In function 'bool Bellman_negLoop()':
a.cc:173:5: error: 'memset' was not declared in this scope
173 | memset(d, 0, sizeof(d));
| ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
13 | #include <functional>
+++ |+#includ... |
s531994753 | p03722 | C++ | //include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;
//container util
//---------------------... | 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:3:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of '_OutputIterator std::__set_intersection(_InputIterator1, _InputIterator1, _InputIterator2, _InputIt... |
s288914029 | p03722 | C++ | void solve();
int main() {
solve();
return 0;
}
//////////////////////////////////////////////////
//////////////////////////////////////////////////
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>... | a.cc:22:10: error: expected unqualified-id before ';' token
22 | int N, M,;
| ^
|
s780364393 | p03722 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#i... | a.cc: In function 'int main()':
a.cc:80:33: error: lvalue required as left operand of assignment
80 | if(d[e.from] != INF && d[e.to] = d[e.from] + e.cost) {
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
a.cc:88:37: error: lvalue required as left operand of assignment
88 | if(d[e.f... |
s451880505 | p03722 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll INF = -1e17;
int n, m... | a.cc: In function 'void serch(int)':
a.cc:39:9: error: 'v' was not declared in this scope
39 | v++;
| ^
|
s586422344 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
#define INF 1007654321
#define PI 3.14159265358979
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repp(i, s, e) for(int i = (s); i <= (e); ++i)
#define sz(x) ((int)x.size())
#define all(x) x.... | a.cc: In function 'int main()':
a.cc:42:27: error: 'V' was not declared in this scope
42 | ll tmp = dist[V-1];
| ^
|
s368912760 | p03722 | C++ | #include <bits/stdc++.h>
int main(){
cout<<"inf"<<endl;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
3 | cout<<"inf"<<endl;
| ^~~~
| std::cout
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:63:18... |
s298104935 | p03722 | C++ | #include<iostream>
int main(){
cout<<"inf"<<endl;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
3 | cout<<"inf"<<endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///<... |
s760120489 | p03722 | C++ | #include <iostream>
#include <string>
#include <queue>
#include <utility>
#include <algorithm>
#include <numeric>
#include <set>
#include <climits>
#include <map>
using namespace std;
vector <pair <int, long long> > edges[1000];
long long max_d[1000];
int main(){
int N;
int M;
cin >> N >> M;
for(int i = 0; i ... | a.cc: In function 'int main()':
a.cc:40:20: error: 'dst' was not declared in this scope
40 | if(max_d[dst] == LLONG_MIN){
| ^~~
|
s933605788 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repn(i,n) for(ll i=0;i<=(ll)(n);i++)
typedef pair<int,int> ... | a.cc: In function 'std::vector<long long int> BF(ll, std::vector<std::vector<long long int> >&, ll)':
a.cc:39:8: error: unable to find numeric literal operator 'operator""V'
39 | if(100V+1<=cnt){
| ^~~~
|
s128894224 | p03722 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(int i = m, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define clr(ar, val) memset(ar, val, sizeof(ar))
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; r... | a.cc: In function 'int main()':
a.cc:29:16: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, int> >, std::tuple<long long int, int> >::value_type' {aka 'std::tuple<long long int, int>'} and 'int')
29 | v[1] = 0;
| ^
In... |
s242479553 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const long long INF = 1e18;
long long GCD(long long a, long long b){return b == 0 ? a : GCD(b, a % b);}
long long fast_exp(long long base, long long exp, long long mod = MOD) {
long long tot = 1;
for(;exp > 0;exp >>= 1) {
... | a.cc: In function 'int main()':
a.cc:51:16: error: 'i' was not declared in this scope
51 | if(i == n - 1 && b[j] == n){
| ^
|
s683934168 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
ll N,M; vector<vector<pair<ll,ll>>> to ;
vector<ll> dist;
int main(){
cin >> N >> M;
dist = vector<ll> (N,INF);
to.resize( N + 10);
for(ll i = 0; i < M; i++){
ll a,b,c; cin >> a >> b >> c; a--; b--; c *=... | a.cc: In function 'int main()':
a.cc:39:7: error: expected '}' at end of input
39 | }}
| ^
a.cc:13:11: note: to match this '{'
13 | int main(){
| ^
|
s541764178 | p03722 | C++ | #include<iostream>
#include<vector>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
int main(){
ll N,M; cin >> N >> M;
vector<pair<ll,ll>> to[1001]
for(ll i = 0; i < M; i++){
ll a,b,w; cin >> a >> b >> w; a--; b--; w *= - 1;
to[a] = make_pair(b,w);}
vector<ll> dist(N,INF);
... | a.cc: In function 'int main()':
a.cc:13:3: error: expected initializer before 'for'
13 | for(ll i = 0; i < M; i++){
| ^~~
a.cc:13:17: error: 'i' was not declared in this scope
13 | for(ll i = 0; i < M; i++){
| ^
a.cc:25:18: error: 'to' was not declared in this scope; did you mean... |
s803475247 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
struct edge {
int to, cost;
};
vector<edge> G[1000];
int N;
vector<bool> used(1000);
bool dfs(int v, long long depth, vector<long long> &dist) {
if (used.at(v) && dist.at(v) >= 0) return true;
else if (used.at(v) && dist.at(v) == -1) return false;
us... | a.cc: In function 'int main()':
a.cc:67:42: error: expected primary-expression before '>' token
67 | if (x.at(G[i].at(j).to)) > 10'000'000'000'000) {
| ^
a.cc:84:38: error: expected primary-expression before '>' token
84 | if (x.at(G[i].at... |
s295498386 | p03722 | C++ | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | a.cc:129:8: error: extra qualification 'Kruskal::' on member 'searchMinimumSpanningTree' [-fpermissive]
129 | void Kruskal::searchMinimumSpanningTree() {
| ^~~~~~~
a.cc:141:3: error: extra qualification 'Kruskal::' on member 'Kruskal' [-fpermissive]
141 | Kruskal::Kruskal(Graph graph) { this->graph... |
s334110030 | p03722 | C++ | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | a.cc:79:8: error: extra qualification 'Kruskal::' on member 'searchMinimumSpanningTree' [-fpermissive]
79 | void Kruskal::searchMinimumSpanningTree() {
| ^~~~~~~
a.cc:91:3: error: extra qualification 'Kruskal::' on member 'Kruskal' [-fpermissive]
91 | Kruskal::Kruskal(Graph graph) { this->graph =... |
s100488697 | p03722 | C++ | INF = float('inf')
#vは頂点数、eは辺数
#s番目の頂点から各頂点への最短距離を求める
def Bellmanford(n, e, s):
d = [INF]*n
d[s] = 0
for i in range(n):
print(i)
for e_from, e_to, e_cost in e:
if d[e_from] != INF and d[e_to] > d[e_from] + e_cost:
print("aaa")
d[e_to] = d[e_from] + e_cost
if i == n-1:
... | a.cc:1:13: warning: multi-character character constant [-Wmultichar]
1 | INF = float('inf')
| ^~~~~
a.cc:2:2: error: extended character 、 is not valid in an identifier
2 | #vは頂点数、eは辺数
| ^
a.cc:2:2: error: invalid preprocessing directive #v\U0000306f\U00009802\U000070b9\U00006570\U000030... |
s663090462 | p03722 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <string.h>
#include <limits.h>
using namespace std;
typedef long long ll;
ll INF=1e18;
struct edge { ll from, to, cost; };
edge es[2005];
ll d[1005];
ll v, e;
bool neg = false;
void shortest_path(int s) {
for (int i = 0; i < v; i++) d[i] = INF;
... | a.cc: In function 'void shortest_path(int)':
a.cc:28:49: error: expected primary-expression before ')' token
28 | if (i == v - 1 && d[v - 1] != l;) {
| ^
|
s478786395 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()
#define pb push_back
#define mk make_pair
typedef long long LL;
typedef pair<int,int> Interval;
template<typename T>
ostream& operator<<(o... | /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
|
s478617753 | p03722 | C++ | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
a.cc:97:26: error: no matching function for call to 'Graph::hasNegativeCycle()'
97 | if (!g.hasNegativeCycle()) {
| ~~~~~~~~~~~~~~~~~~^~
a.cc:89:6: note: ca... |
s426845156 | p03722 | C++ | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
a.cc:96:25: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
96 | print(-g.getDistance[N]);
| ... |
s759833275 | p03722 | C++ | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
a.cc:96:25: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
96 | print(-g.getDistance[N]);
| ... |
s525846353 | p03722 | C++ | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | a.cc:48:23: error: expected identifier before '->' token
48 | vector<ll> dist(this->V, INF);
| ^~
a.cc:48:23: error: expected ',' or '...' before '->' token
a.cc:48:19: warning: explicit object member function only available with '-std=c++23' or '-std=gnu++23' [-Wc++23-extensions]
48... |
s242974999 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
long long INF = - 1'000'000'000'000'000'000;
int main(){
int n, m;
cin >> n >> m;
struct edge {
long long from, to, cost;
};
vector<edge> es(m);
for (int i = 0; i < m; i++){
cin >> es[i].from >> es[i].to >> es[i].cost;
}
v... | a.cc: In function 'int main()':
a.cc:41:18: error: 'i' was not declared in this scope
41 | if (distance[i - 1] == INF) cout << distance[100000000] << endl;
| ^
|
s814464477 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
long long INF = - 1'000'000'000'000'000'000;
int main(){
int n, m;
cin >> n >> m;
struct edge {
long long from, to, cost;
};
vector<edge> es(m);
for (int i = 0; i < m; i++){
cin >> es[i].from >> es[i].to >> es[i].cost;
}
v... | a.cc: In function 'int main()':
a.cc:41:18: error: 'i' was not declared in this scope
41 | if (distance[i - 1] == INF) cout << distance[INF] << endl;
| ^
|
s641300947 | p03722 | 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 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int M... | a.cc: In function 'int main()':
a.cc:60:34: error: expected unqualified-id before '=' token
60 | negation = true; //壊れてる
| ^
|
s212895333 | p03722 | C++ | #include "bits/stdc++.h"
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define print(n) cout<<n<<endl
const int M=100010;
const int MOD=10000... | a.cc: In function 'int main()':
a.cc:20:11: error: expected unqualified-id before ',' token
20 | ll,dp[1010][1010]={};
| ^
|
s027594756 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
const ll mo = 1000000007;
const ll INF = 1LL << 60; //MAX 9223372036854775807
ll ans = 0;
int main()
{
ll n,m;
cin >> n>>m;
vector<pair<ll,ll> > G[n... | a.cc: In function 'int main()':
a.cc:21:12: error: expected ';' before '}' token
21 | maxa+=c
| ^
| ;
22 | }
| ~
|
s031665523 | p03722 | C++ | #include "bits/stdc++.h"
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define print(n) cout<<n<<endl
const int M=100010;
const int MOD=10000... | a.cc:38:1: error: expected declaration before '}' token
38 | }
| ^
|
s557864408 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
const long long INF=1e12;
struct edge{int from,to,cost;};
edge es[2000];
long long d[1000];
int V,E;
void shortest_path(int s){
for(int i=0;i<V;i++)
d[i]=INF;
d[s]=0;
for(int i=0;i<V;i++)
for(int j=0;j<E;j++){
edge e=es[j];
if(d[e.from]!=INF&&d[e.to]>d[e.from]+e... | a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s387021747 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
const long long INF=1e12;
struct edge{long long from,to,cost;};
edge es[2000];
long long d[1000];
long long V,E;
void shortest_path(long long s){
for(long long i=0;i<V;i++)
d[i]=INF;
d[s]=0;
while(true){
bool update=false;
for(long long i=0;i<E;i++){
edge e=es[i]... | a.cc: In function 'bool find_negative_loop()':
a.cc:32:38: error: expected primary-expression before '>' token
32 | if(i=>V-1&&e.to==V-1)
| ^
|
s953981976 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
const long long INF=1e12;
struct edge{long long from,to,cost;};
edge es[2000];
long long d[1000];
long long V,E;
void shortest_path(long long s){
for(long long i=0;i<V;i++)
d[i]=INF;
d[s]=0;
while(true){
bool update=false;
for(long long i=0;i<E;i++){
edge e=es[i]... | cc1plus: error: '::main' must return 'int'
|
s181171751 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
//#define int long long
//TEMPLATE START---------------8<---------------8<---------------8<---------------8<---------------//
typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<l... | a.cc:159:2: error: stray '#' in program
159 | }#include <bits/stdc++.h>
| ^
a.cc:159:3: error: 'include' does not name a type
159 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:165:11: error: redefinition of 'const int INF'
165 | const int INF = (0x7FFFFFFFL); const ll INFF = (0x7FFFFFFFFFFFFFFFL); con... |
s823874928 | p03722 | C++ | #include <iostream>
#include <numeric>
#include <vector>
using namespace std;
using Weight = long long;
class Edge {
public:
int src, dst;
Weight w;
Edge(): src(0), dst(0), w(0) {}
Edge(int src, int dst, Weight w): src(src), dst(dst), w(w) {}
};
using Edges = vector < Edge >;
using Graph = vector < Edges >;
... | a.cc: In function 'void BellmanFord(const Graph&, int)':
a.cc:25:22: error: 'numeric_limits' was not declared in this scope
25 | const Weight INF = numeric_limits<Weight>::max() / 4;
| ^~~~~~~~~~~~~~
a.cc:25:43: error: expected primary-expression before '>' token
25 | const Weight I... |
s576788163 | p03722 | C++ | #include "/Users/daikikodama/Desktop/stdc++.h"
//#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 10000000000000000
... | a.cc:1:10: fatal error: /Users/daikikodama/Desktop/stdc++.h: No such file or directory
1 | #include "/Users/daikikodama/Desktop/stdc++.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s941021324 | p03722 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int N, M;
struct edge {
ll from, to, cost;
};
static const ll INF = 1000000000000;
edge es[2000];
ll d[1000];
bool find_negative_loop(int s){
int cnt = 0;
for(int i = 0; i < N; i++){
d[i] = INF;
}
d[s] = 0;... | a.cc: In function 'bool find_negative_loop(int)':
a.cc:29:29: error: lvalue required as left operand of assignment
29 | if(cnt == N && e.to = N - 1){
| ~~~~~~~~~^~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.