submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s563197650 | p03661 | C++ | #include <cstdio>
#include <vector>
#include <cstdlib>
using namespace std;
int n;
long long a[200005];
inline long long abs(long long x){
if(x < 0) x = -x;
return x;
}
int main(){
scanf("%d", &n);
for(int i = 1; i <= n ; ++i)
scanf("%lld", &a[i]), a[i] += a[i - 1];
long long Sol = 10000000... | a.cc: In function 'int main()':
a.cc:19:15: error: call of overloaded 'abs(long long int)' is ambiguous
19 | if(abs(x - y) < Sol) Sol = abs(x - y);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from a.cc:3:
/usr/include/stdlib.h:980:12: note: candidate: ... |
s976522627 | p03661 | C++ | c:\Users\mgoncharov\etc\contests\atcoder\arc078\a.cpp | a.cc:1:3: error: stray '\' in program
1 | c:\Users\mgoncharov\etc\contests\atcoder\arc078\a.cpp
| ^
a.cc:1:9: error: stray '\' in program
1 | c:\Users\mgoncharov\etc\contests\atcoder\arc078\a.cpp
| ^
a.cc:1:20: error: stray '\' in program
1 | c:\Users\mgoncharov\etc\contests\atcoder\ar... |
s298244580 | p03661 | C++ | #include <iostream>
using namespace std;
#define int long long
int n;
int a[200001];
int Abs(int x) { if (x > 0) return x; return -x; }
signed main() {
int i;
cin >> n;
for (i = 0; i < n; i++) cin >> a[i + 1];
for (i = 1; i <= n; i++) a[i] += a[i - 1];
int ans = 1e+18;
for (i = 1; i < n; i++) {
ans = min... | a.cc: In function 'int main()':
a.cc:19:35: error: too many arguments to function 'long long int Abs(long long int)'
19 | ans = min(ans, Abs(a[i], a[n] - a[i]));
| ~~~^~~~~~~~~~~~~~~~~~~
a.cc:8:5: note: declared here
8 | int Abs(int x) { if (x > 0) return x; r... |
s107105466 | p03661 | 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, a[112345];
LL ans;
int main()
{
in >> N;
rep(i, N) { in >> a[i]; }
rep(i, N) { a[i + 1] += a[i]; }
for (LL i = 0; i < N - 1; ++i)... | a.cc: In function 'int main()':
a.cc:21:31: error: no matching function for call to 'min(LL&, int)'
21 | ans = std::min(ans, abs(a[i] - (a[N] - a[i])));
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from... |
s443016619 | p03662 | C++ | #include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using n... | a.cc: In function 'int main()':
a.cc:156:29: error: expected ';' before 'dfs'
156 | memset(bef,-1,sizeof(bef))
| ^
| ;
157 | dfs(0,-1);
| ~~~
|
s807642262 | p03662 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
const int MAXN=100000+10;
vector<int> edge[MAXN];//用邻接表来实现树的存储
int n,cnt[3];//cnt用来记录颜色数量
int tree[MAXN];//tree数组储存每个节点的颜色,1是指black,2指white
void bfs()
{
queue<int> q;
q.push(1),q.push(n);//Fennec先,Snuke后,所以先后入队
while(!q.empty())
... | a.cc: In function 'int main()':
a.cc:35:5: error: 'memset' was not declared in this scope
35 | memset(tree,0,sizeof(tree));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<queue>
+++ |+#include <cstring>
... |
s477643834 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using ii=pair<ll, ll>;
using vi=vector<ll>;
using vb=vector<bool>;
using vvi=vector<vi>;
using vii=vector<ii>;
using vvii=vector<vii>;
void dfs(int u, vvi &E, vi &p,vi &sz)
{
void sz[u]=1;
for(int i=0; i<e[u].size(); j++)
... | a.cc: In function 'void dfs(int, vvi&, vi&, vi&)':
a.cc:13:10: error: declaration of 'sz' as array of void
13 | void sz[u]=1;
| ^~
a.cc:14:20: error: 'e' was not declared in this scope
14 | for(int i=0; i<e[u].size(); j++)
| ^
a.cc:14:33: error: 'j' was not declared... |
s202974813 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
int n;
struct edge{
int to,next;
}e[20010];
int head[10010],s[10010],path[10010],len,cnt;
void add(int u, int v)
{
e[cnt++]=(edge){v,head[u]};
head[u]=cnt;
}
bool dfs(int x,int fa)
{
x==n;
bool p=x;
for(int i=head[x];i;i=e[i].next)
{
int ... | a.cc: In function 'int main()':
a.cc:41:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
41 | ans+=s[path[i]]-s[path[i-1]];
| ^~~
| abs
a.cc:42:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
42 | printf("%s\n", ans*2>n ? "Fennec" : "... |
s215061570 | p03662 | C++ | #include<bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> P;
int N;
vector<int> color[100010]; //color[i] = 0は無色、1は黒、2は白
vector<int> graph[100010];
int fennec[100010];
int snuke[100010];
void bfsf(int s) {
priority_queue<int,vector<int>,greater<int>> que;
que.push(s);
fenne... | a.cc: In function 'void bfss(long long int)':
a.cc:49:13: error: 'greak' was not declared in this scope
49 | greak;
| ^~~~~
a.cc: In function 'int main()':
a.cc:63:14: error: 'color' cannot be used as a function
63 | color(i) = 0;
| ~~~~~^~~
|
s925771371 | p03662 | C++ | #include<bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> P;
int N;
vector<int> color[100010]; //color[i] = 0は無色、1は黒、2は白
vector<bool>
vector<int> graph[100010];
int fennec[100010];
int snuke[100010];
void bfsf(int s) {
priority_queue<int,vector<int>,greater<int>> que;
que.push... | a.cc:9:13: error: invalid declarator before 'graph'
9 | vector<int> graph[100010];
| ^~~~~
a.cc: In function 'void bfsf(long long int)':
a.cc:21:27: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
21 | for(int i = 0;i < graph[p].size();i++) {
| ... |
s845511874 | p03662 | C++ | #include<bits/stdc++.h>
#define int long long
using namespace std;
typaedef pair<int,int> P;
int N;
vector<int> color[100010]; //color[i] = 0は無色、1は黒、2は白
vector<bool>
vector<int> graph[100010];
int fennec[100010];
int snuke[100010];
void bfsf(int s) {
priority_queue<int,vector<int>,greater<int>> que;
que.pus... | a.cc:4:1: error: 'typaedef' does not name a type; did you mean 'typedef'?
4 | typaedef pair<int,int> P;
| ^~~~~~~~
| typedef
a.cc:9:13: error: invalid declarator before 'graph'
9 | vector<int> graph[100010];
| ^~~~~
a.cc: In function 'void bfsf(long long int)':
a.cc:21:27: error: '... |
s389124671 | p03662 | C++ | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<b;i++)
#defin... | a.cc: In function 'int main()':
a.cc:122:2: error: expected '}' at end of input
122 | }
| ^
a.cc:90:11: note: to match this '{'
90 | int main(){
| ^
|
s985947057 | p03662 | Java | import java.util.*;
public class Main {
static Scanner scanner = new Scanner(System.in);
public static void main(String[]$) {
int n = scanner.nextInt();
List<Integer>[] edge = new ArrayList[n];
for (int i = 0; i < n; i++) {
edge[i] = new ArrayList<>();
}
for... | Main.java:28: error: cannot find symbol
Utils.println(i, j, deque);
^
symbol: variable Utils
location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s724245497 | p03662 | C++ | #include "bits/stdc++.h"
using namespace std;
int N, INF = 1000000000;
static int Dis1[100010] = {}, DisN[100010] = {};
vector<int> V[100010];
void BFS1() {
for (int i = 1; i < N; i++) {
Dis1[i] = INF;
}
queue<int> Q;
Q.push(0);
while (Q.size()) {
int x = Q.front();
Q.pop();
for (int i : V[x]) {
if (D... | /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
|
s108812870 | p03662 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define rt return
#define dll(x) scanf("%I64d",&x)
#define xll(x) printf("%I64d\n",x)
... | a.cc: In function 'int main()':
a.cc:94:29: error: 'endL' was not declared in this scope
94 | cout << "Fennec" << endL;
| ^~~~
|
s938270981 | p03662 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.function.Consumer;
import java.util.stream.IntStream;
import static java.util.stream.Collectors.toList;
public class Main {
private static final Scanner scanner = new Scanner(System.in);
priv... | Main.java:42: error: package AbstractMap does not exist
List<AbstractMap.SimpleEntry<Integer, Integer>> que = new ArrayList<>();
^
Main.java:43: error: package AbstractMap does not exist
que.add(new AbstractMap.SimpleEntry<>(0, 0));
... |
s628265104 | p03662 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
#define max(a,b) a>b?a:b
#define N 105
int a[N][N],dis1[N],dis2[N];
int n,res;
vector<int>g[N];
void dfs(int cur, int pre, int len, int dist[])
{
int now;
dist[cur]=len;
for(i=0;i<g[cur].size();++i)
{
now=g[cur][i];
if(now!=pre)
dfs(... | a.cc: In function 'void dfs(int, int, int, int*)':
a.cc:14:13: error: 'i' was not declared in this scope
14 | for(i=0;i<g[cur].size();++i)
| ^
|
s030948255 | p03662 | C++ | #include <iostream>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <sstream>
using namespace std;
typedef long long LL;
#define lowbit(x) ((x)&(-x))
#define INF ... | a.cc:20:2: error: invalid preprocessing directive #defineGE; did you mean #define?
20 | #defineGE() printf(">----------\n")
| ^~~~~~~~
| define
a.cc:21:2: error: invalid preprocessing directive #defineIN; did you mean #define?
21 | #defineIN() freopen("in.txt","r",stdin)
| ^~~~~~~~
| d... |
s630922777 | p03662 | C | #include<iostream>
#include<vector>
#include<mem.h>
using namespace std;
#define N 110
vector<int>g[N];
int dis1[N], parent[N];
int n, num;
//work out the distance between each point and first point with dfs
void dfs_dis(int cur, int par){
int next;
dis1[cur] = dis1[par] + 1;
for(int i = 0; i < g[cur].size(... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s768692100 | p03662 | C++ | #include<iostream>
#include<vector>
#include<mem.h>
using namespace std;
#define N 110
vector<int>g[N];
int dis1[N], parent[N];
int n, num;
//work out the distance between each point and first point with dfs
void dfs_dis(int cur, int par){
int next;
dis1[cur] = dis1[par] + 1;
for(int i = 0; i < g[cur].size(... | a.cc:3:9: fatal error: mem.h: No such file or directory
3 | #include<mem.h>
| ^~~~~~~
compilation terminated.
|
s736118986 | p03662 | C++ | #include<iostream>
#include<vector>
#include<mem.h>
using namespace std;
#define N 110
vector<int>g[N];
int dis1[N], parent[N];
int n, num;
//work out the distance between each point and first point with dfs
void dfs_dis(int cur, int par){
int next;
dis1[cur] = dis1[par] + 1;
for(int i = 0; i < g[cur].size(... | a.cc:3:9: fatal error: mem.h: No such file or directory
3 | #include<mem.h>
| ^~~~~~~
compilation terminated.
|
s515260122 | p03662 | C | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <ma... | main.c:1:10: fatal error: algorithm: No such file or directory
1 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s786701599 | p03662 | C | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <ma... | main.c:1:10: fatal error: algorithm: No such file or directory
1 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s964225500 | p03662 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<string.h>
#include<math.h>
#include<stdio.h>
#include<queue>
#include<utility>
#include<cstdio>
#include<cstring>
#include<new>
#include<new.h>
#include<float.h>
#include<ctype.h>
#include<cfloat>
#include<cmat... | a.cc:15:9: fatal error: new.h: No such file or directory
15 | #include<new.h>
| ^~~~~~~
compilation terminated.
|
s129381229 | p03662 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<string.h>
#include<math.h>
#include<stdio.h>
#include<queue>
#include<utility>
#include<cstdio>
#include<cstring>
#include<new>
#include<new.h>
#include<float.h>
#include<ctype.h>
#include<cfloat>
#include<cmat... | a.cc:15:9: fatal error: new.h: No such file or directory
15 | #include<new.h>
| ^~~~~~~
compilation terminated.
|
s373360132 | p03662 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int n,a,b,rt,size[400005],fa[400005],tot=0,sum1,sum2,cnt,e[400005],last[400005],next[400005],tmp;
inline int read(){
char c=getchar();
int x=0;
for(;c>'9'||c<'0';) c=getchar();
for(;c>='0'&&c<='9';){
x=(x<<3)+(x<<1)+c-'0';
c=getchar();
return x;
}
}
vo... | a.cc: In function 'void add(int, int)':
a.cc:18:9: error: reference to 'next' is ambiguous
18 | next[cnt]=last[x];
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_b... |
s229028783 | p03662 | C++ | #include<iostream>
#include<vector>
using namespace std;
int d[100001][2],visit[100001]={};
vector<vector<int>> v(100001);
int dfs(int p,int a){
visit[p]=1;
for(int i=0;i<v[p].size();i++)
if(visit[v[p][i]]==0){
d[v[p][i]][a]=d[p][a]+1;
dfs(v[p][i],a);
}
}
int main(){
int n,a,b,cnt=0;
cin... | a.cc: In function 'int dfs(int, int)':
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
16 | }
| ^
a.cc: In function 'int main()':
a.cc:38:10: error: expected primary-expression before '>' token
38 | if(cnt=>0)
| ^
|
s412008134 | p03662 | C | #include<iostream>
#include<vector>
using namespace std;
int d[100001][2],visit[100001]={};
vector<vector<int>> v(100001);
int dfs(int p,int a){
visit[p]=1;
for(int i=0;i<v[p].size();i++)
if(visit[v[p][i]]==0){
d[v[p][i]][a]=d[p][a]+1;
dfs(v[p][i],a);
}
}
int main(){
int n,a,b,cnt=0;
cin... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s495271921 | p03662 | C++ | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include ... | a.cc: In function 'int dfs(int, int)':
a.cc:160:27: error: expected primary-expression before '=' token
160 | else if (v[crt] == 1) = 3;
| ^
|
s109814233 | p03662 | C++ | #include <iostream>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <string>
#include <stack>
#include <limits>
#include <climits>
#include <cassert>
#include <fstream>
#include <cstring>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <algorithm>
#include <functional>
#include... | a.cc: In function 'void solve()':
a.cc:141:43: error: no matching function for call to 'min(std::vector<long long int>::size_type, unsigned int)'
141 | int center = path.size() / 2 + min(path.size()%2, 1u);
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/includ... |
s844481215 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define mp(a,b) make_pair(a,b)
#... | a.cc:29:15: error: 'maxn' was not declared in this scope
29 | vector<int> g[maxn];
| ^~~~
a.cc:30:8: error: 'maxn' was not declared in this scope
30 | int d1[maxn], d2[maxn];
| ^~~~
a.cc:30:18: error: 'maxn' was not declared in this scope
30 | int d1[maxn], d2[maxn];
| ... |
s628776021 | p03662 | C++ | #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<stack>
#include<string.h>
#include<string>
using namespace std;
typedef long long LL;
#define _CRT_SECURE_NO_WARNINGS
int N;
vector<int> l[100010];
template<class T> class Node {
public:
Node()
:parent(0), child(0)
... | a.cc:21:9: error: invalid use of template-name 'std::vector' without an argument list
21 | vector child;
| ^~~~~~
a.cc: In function 'void Set(int, int)':
a.cc:32:34: error: 'class Node<int>' has no member named 'child'
32 | nodes[n].child.push_back(&nodes[l[n][i]]);
... |
s279333787 | p03662 | C++ | #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<stack>
#include<string.h>
#include<string>
using namespace std;
typedef long long LL;
#define _CRT_SECURE_NO_WARNINGS
int N;
vector l[100010];
template class Node {
public:
Node()
:parent(0), child(0)
{};
Node* par... | a.cc:14:1: error: missing template argument list after 'std::vector'; for deduction, template placeholder must be followed by a simple declarator-id
14 | vector l[100010];
| ^~~~~~
| <>
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/queue:63,
... |
s491637348 | p03662 | C++ | #include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long LL;
#define _CRT_SECURE_NO_WARNINGS
int N;
vector l[100010];
template class Node {
public:
Node()
:parent(0), child(0)
{};
Node* parent;
vector child;
T para;
};
Node nodes[100010];
int main() {
sca... | a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
a.cc:2:9: error: #include expects "FILENAME" or <FILENAME>
2 | #include
| ^
a.cc:3:9: error: #include expects "FILENAME" or <FILENAME>
3 | #include
| ^
a.cc:4:9: error: #include expects "FIL... |
s958428397 | p03662 | C++ | /*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/
#include <bits/stdc++.h>
using namespace std;
const int mx=1e5+5;
vector <int> tree[mx];
int cnt,level[mx],dist[mx];
bool vis[mx];
void bfs1 ()
{
memset(vis,0,sizeof(vis));
queue<int> myQ;
myQ.push(1);
level[1]=0;
vis[1]=true;
int m;
while (!myQ.e... | a.cc: In function 'int main()':
a.cc:69:14: error: expected '}' at end of input
69 | return 0;
| ^
a.cc:54:1: note: to match this '{'
54 | {
| ^
|
s799685860 | p03662 | C++ |
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
#define N 100005
int n;
int map[N][N];
vector<int>v;
void dps(){
stack<int>s;
int check[N];
for(int i=1;i... | /tmp/ccE075y1.o: in function `dps()':
a.cc:(.text+0x6b): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccE075y1.o
a.cc:(.text+0x12c): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccE075y1.o
a.cc:(.text+0x180): relocation tr... |
s518621015 | p03662 | C++ | #include <iostream>
#include <vector>
#include <cstring>
constexpr int MAX_N=(int)1e5;
int n;
std::vector<int> G[MAX_N];
bool path[MAX_N];
bool used[MAX_N];
void search(int s,int t){
used[s]=true;
if(s==t){
std::memcpy(path,used,sizeof(used))
return;
}
for(int i=0;i<G[s].size();++i... | a.cc: In function 'void search(int, int)':
a.cc:20:42: error: expected ';' before 'return'
20 | std::memcpy(path,used,sizeof(used))
| ^
| ;
21 | return;
| ~~~~~~
|
s775835738 | p03662 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
using namespace std;
const int MAXN=1e5+10;
int num1[MAXN],num2[MAXN];
int T,n;
int head[MAXN],next[2*MAXN],u[2*MAXN],v[2*MAXN],tot;
int read()
{
int f=0,w=1; char ch=getchar();
while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }
whi... | a.cc: In function 'void add(int, int)':
a.cc:19:31: error: reference to 'next' is ambiguous
19 | u[++tot]=l; v[tot]=r; next[tot]=head[l]; head[l]=tot;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.... |
s977011542 | p03662 | C++ | #include <cstdio>
#include <iostream>
#include <vector>
#define N 100000
using namespace std;
int e[N+1][N+1] = {};
vector<int> p;
bool used[N+1];
int dfs_goal(int s, int g, int n){
for (int i=1;i<=n;i++) {
if (!used[i] && e[s][i] == 1) {
if (i==g) {
p.push_back(i);
return(i);
}
used[i] ... | /tmp/ccvs9Zv0.o: in function `dfs_goal(int, int, int)':
a.cc:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0... |
s446485782 | p03662 | C++ | #include <cstdio>
#include <iostream>
#include <vector>
#define N 100000
using namespace std;
int n;
int e[N+1][N+1] = {};
vector<int> p;
bool used[N+1];
int dfs_goal(int s, int g, int n){
for (int i=1;i<=n;i++) {
if (!used[i] && e[s][i] == 1) {
if (i==g) {
p.push_back(i);
return(i);
}
u... | /tmp/ccT7VclH.o: in function `dfs_goal(int, int, int)':
a.cc:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0... |
s563009110 | p03662 | C++ | #include <cstdio>
#include <iostream>
#include <vector>
#define N 100000
using namespace std;
int n;
int e[N+1][N+1] = {};
vector<int> p;
bool used[N+1];
int dfs_goal(int s, int g){
for (int i=1;i<=n;i++) {
if (!used[i] && e[s][i] == 1) {
if (i==g) {
p.push_back(i);
return(i);
}
used[i] ... | /tmp/ccdtBgG9.o: in function `dfs_goal(int, int)':
a.cc:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x8c):... |
s537830575 | p03662 | C++ | #include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include ... | a.cc: In member function 'std::vector<_Tp> Graph<T>::shortest_path(int)':
a.cc:65:5: error: expected ',' or ';' before 'for'
65 | for (int u = 0; u < V; u++) {
| ^~~
a.cc:65:21: error: 'u' was not declared in this scope
65 | for (int u = 0; u < V; u++) {
| ^
|
s494872925 | p03662 | C++ | #include<iostream>
#include<vector>
using namespace std;
int x[100010], y[100010];
vector<int> adjacent[100010];
void DFSx(int a) {
for (int b : adjacent[a]) {
if (x[b] == -1) {
x[b] = x[a] + 1;
DFSx(b);
}
}
}
void DFSy(int a) {
for (int b : adjacent[a]) {
if (y[b] == -1) {
y[b] = y... | a.cc: In function 'int main()':
a.cc:25:3: error: 'memset' was not declared in this scope
25 | memset(x, -1, sizeof(x));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<vector>
+++ |+#include <cstring>
3 |
|
s373833591 | p03662 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
int n, a, b;
int fenv, snuv, pathv;
vector<int> g[100005];
bool used[100005];
// fennec
void bfs() {
queue<pair<int, int> > que;
pair<int, int> tmp;
que.push(make_pair(0, 0));
while (!... | a.cc: In function 'void bfs2()':
a.cc:56:26: error: expected ',' or ';' before ':' token
56 | bool flag = false:
| ^
a.cc:60:29: error: 'size_' was not declared in this scope; did you mean 'size_t'?
60 | for (int i = 0; i < size_; ++i) {
| ... |
s805574308 | p03662 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
const int INF=INT_MAX/2;
vector<int> bfs(int N,vector<vector<int> >& G,int s){
vector<int> d(N,INF);
queue<int>q;
q.push(s);
while(q.size()){
int u=q.front();
q.pop();
for(int v=0;v<G[u].size();v++)
if(d[G[u][v]]>d[u]+1){
d[G[u][v... | a.cc:5:15: error: 'INT_MAX' was not declared in this scope
5 | const int INF=INT_MAX/2;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include<queue>
+++ |+#include <climits>
3 | #include<vector>
|
s110810162 | p03662 | C++ | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
const int INF=INT_MAX/2;
vector<int> bfs(int N,vector<vector<int> >& G,int s){
vector<int> d(N,INT_MAX/2);
queue<int>q;
q.push(s);
while(q.size()){
int u=q.front();
q.pop();
for(int v=0;v<G[u].size();v++)
if(d[G[u][v]]>d[u]+1){
d[... | a.cc:5:15: error: 'INT_MAX' was not declared in this scope
5 | const int INF=INT_MAX/2;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include<queue>
+++ |+#include <climits>
3 | #include<vector>
a.cc: ... |
s185068864 | p03662 | C++ | #include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
cons... | a.cc: In function 'void dfs(int, int)':
a.cc:35:20: error: incompatible types in assignment of 'int' to 'int [262144]'
35 | cnt+=cnt[k];
| ~~~^~~~~~~~
|
s952384700 | p03662 | C++ | #include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
cons... | a.cc: In function 'void dfs(int, int)':
a.cc:35:20: error: incompatible types in assignment of 'int' to 'int [262144]'
35 | cnt+=cnt[to];
| ~~~^~~~~~~~~
|
s959126581 | p03662 | C++ | #include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <error.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype... | a.cc:56:10: fatal error: conio.h: No such file or directory
56 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s664280265 | p03662 | C++ | #include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
cons... | a.cc:19:15: error: 'INT_MAX' was not declared in this scope
19 | const int INF=INT_MAX/2;
| ^~~~~~~
a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
16 | #include<set>
+++ |+#include <climits>
17 | using namespace std;
|
s362470943 | p03662 | C++ | #include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
cons... | a.cc:19:15: error: 'INT_MAX' was not declared in this scope
19 | const int INF=INT_MAX/2;
| ^~~~~~~
a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
16 | #include<set>
+++ |+#include <climits>
17 | using namespace std;
a.... |
s798195252 | p03662 | C++ | //code by 27.
#include<stdio.h>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<fstream>
#include<stdlib.h>
#include<set>
#include<cassert>
#include<climits>
#include<cmath>
#include<memory.h>
#include<coni... | a.cc:19:9: fatal error: conio.h: No such file or directory
19 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s564423387 | p03662 | C++ | #include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <error.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype... | a.cc:56:10: fatal error: conio.h: No such file or directory
56 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s354771052 | p03662 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long LL;
const int MAXN=1e5+5;
int n;
vector<int> g[MAXN*2];
int d1[MAXN],d2[MAXN];
void dfs(int rt,int fa,int d,int dist[])
{
dist[rt]=d;
for(int x:g[rt])
{
if(x!=fa)
dfs(x,rt,d+1... | a.cc: In function 'int main()':
a.cc:50:14: error: expected '}' at end of input
50 | return 0;
| ^
a.cc:23:1: note: to match this '{'
23 | {
| ^
|
s943003669 | p03662 | C++ | /************************************
Name: 荆国浩
E-mail: 1839714778@qq.com
************************************/
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <fstream>
#define rep(N) for(int i=0;i<N;i++)
#define ll long long... | a.cc: In function 'void bfs(int)':
a.cc:26:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
26 | que.push(make_pair<int,int>(x,0));
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include... |
s440923925 | p03662 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
#define B 1
#define W 2
int N;
vector<int> G[100001];
int Order[100001];
int Order2[100001];
int prev[100001];
int color[100001];
int cnt=0;
void dfs(int v,int p,int *order){
order[v]=order[p]+1;
prev[v]=p;
for(int i... | a.cc: In function 'void dfs(int, int, int*)':
a.cc:17:3: error: reference to 'prev' is ambiguous
17 | prev[v]=p;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
... |
s592832232 | p03662 | C++ | 4
1 4
4 2
2 3 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4
| ^
|
s121358545 | p03662 | C++ | #include<bits/stdc++.h>
#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end(... | a.cc: In function 'int main()':
a.cc:52:33: error: no matching function for call to 'begin(std::queue<long long int>&)'
52 | for(int i : que[even]){
| ^
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
from /usr/include/c++/14/bits/s... |
s098837762 | p03662 | C++ | int v = n - 1;
while (true) {
path.push_back(v);
v = parent[v];
if (v == 0) break;
}
path.push_back(v);
reverse(path);
int length = path.size() - 1;
return path[length / 2 + 1];
}
int main() {
int i;
... | a.cc:1:17: error: 'n' was not declared in this scope
1 | int v = n - 1;
| ^
a.cc:3:9: error: expected unqualified-id before 'while'
3 | while (true) {
| ^~~~~
a.cc:8:9: error: 'path' does not name a type
8 | path.push_back(v);
| ^~~~
... |
s979873411 | p03662 | C++ | #include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<string>
#include<sstream>
#include<windows.h>
#include<algorithm>
#include<list>
#include<ctime>
#include<set>
#include<map>
#include<cmath>
using namespace std;
#define R freopen("666input.txt","r",stdin);
#define W freopen("666output.txt","w",stdout... | a.cc:6:9: fatal error: windows.h: No such file or directory
6 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s440814088 | p03662 | C++ | #include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int,int>i_i;
//const int MOD=1e9+7;
const int INF=INT_MAX/2;
int n1=0,n2=0;
int N;
vector<int> G[1000000+5];
int vis[100005];
//vector<i... | a.cc:14:15: error: 'INT_MAX' was not declared in this scope
14 | const int INF=INT_MAX/2;
| ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include<queue>
+++ |+#include <climits>
7 | #include<vector>
|
s488265242 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n; cin>>n;
vector<vector<int>> g(n);
for(int i=0; i<n-1; ++i) {
int a, b; cin>>a>>b;
--a, --b;
g[a].push_back(b);
g[b].push_back(a);
}
vector<int> x(n);
queue<int> q;
q.push(0); x[0]=1;
q.pus... | a.cc: In function 'int main()':
a.cc:30:19: error: 'sunuke' was not declared in this scope; did you mean 'snuke'?
30 | cout<<(fennec>sunuke ? "Fennec" : "Snuke")<<endl;
| ^~~~~~
| snuke
|
s481979525 | p03662 | 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 'void Dijkstra(uint32_t, COST_T (&)[100000])':
a.cc:76:49: error: request for member 'cost' in 'e', which is of non-class type 'const int'
76 | auto cost = nowcost + e.cost;
| ^~~~
a.cc:77:40: error: request for member 't... |
s174483584 | p03662 | C++ | #include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#i... | a.cc:21:10: fatal error: windows.h: No such file or directory
21 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s984302774 | p03662 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
using namespace std;
const int maxn = int(1e5)+5;
int sz[maxn], P[maxn];
vector<int> graph[maxn];
void dfs(int node, int par)
{
sz[node] = 1, P[node] = par;
for(auto it: graph[node])
{
if(it != par)
{
dfs(it, node);
sz[node] += sz[... | a.cc: In function 'int main()':
a.cc:46:9: error: 'reverse' was not declared in this scope
46 | reverse(path.begin(), path.end());
| ^~~~~~~
|
s121315015 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
vector<int> d[2];
vector<int> v[100000];
void dfs(int x, int y, int dist, int s) {
d[s][x] = dist;
for (int i = 0; i < v[x].size(); i++) {
if (v[x][i] != y) {
dfs(v[x][i], visit, dist + 1, s);
}
}
}
int main... | a.cc: In function 'void dfs(int, int, int, int)':
a.cc:14:16: error: cannot resolve overloaded function 'visit' based on conversion to type 'int'
14 | dfs(v[x][i], visit, dist + 1, s);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s453221663 | p03662 | C++ | #include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#incl... | a.cc:58:14: error: expected unqualified-id before 'not' token
58 | vector<bool> not(100001, false);
| ^~~
a.cc: In function 'void dfs2(std::vector<bool>&, int, std::vector<long long int>)':
a.cc:76:58: error: expected ',' before '[' token
76 | not... |
s640125584 | p03662 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define fast_cin() ios_base::sync_with_stdio(false);
typedef long long ll;
const int INF = 1e7;
const int MAX_SIZE = 1e5 + 10;
vector<int> gra... | a.cc: In function 'void dfs(int, int)':
a.cc:54:13: error: expected primary-expression before ')' token
54 | for()
| ^
a.cc:55:1: error: expected primary-expression before '}' token
55 | }
| ^
a.cc:54:14: error: expected ';' before '}' token
54 | for()
| ... |
s640555026 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)
typedef vector<int> Array;
typedef vector<Array> Graph;
int dis... | a.cc: In function 'int main()':
a.cc:47:9: error: too few arguments to function 'void dfs1(int, int)'
47 | dfs1();
| ~~~~^~
a.cc:18:6: note: declared here
18 | void dfs1(int now, int dist){
| ^~~~
a.cc:48:9: error: too few arguments to function 'void dfs2(int, int)'
48 | dfs2();
... |
s651973936 | p03662 | C++ | #include <iostream>
#include <vector>
#include <cstring>
constexpr int MAX_N = (int)1e5;
int n;
std::vector<int> G[MAX_N];
bool used[MAX_N];
bool Isroute[MAX_N];
std::vector<int> routes;
int cnt, len;
bool init(int m) {
if (m == n - 1) {
len = cnt;
return true;
}
used[m] = true;
++cnt;
for (auto ... | a.cc: In function 'int main()':
a.cc:108:14: error: 'reverse' is not a member of 'std'
108 | std::reverse(routes.begin(), routes.end());
| ^~~~~~~
|
s493852654 | p03662 | C++ | #include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#incl... | a.cc:134:5: error: redefinition of 'int xcomp(std::vector<long long int>&, std::vector<long long int>&)'
134 | int xcomp(vector<LL>& a, vector<LL>& b) {
| ^~~~~
a.cc:42:5: note: 'int xcomp(std::vector<long long int>&, std::vector<long long int>&)' previously defined here
42 | int xcomp(vector<LL>& a, vec... |
s053977169 | p03662 | C++ | #include<iostream>
#include<vector>
#include<queue>
#include<set>
using namespace std;
const int N = 1e5 + 10;
typedef long long ll;
int c[N];
int vis[N], id;
int d[2][N];
vector<vector<int> > v;
void dfs(int u, int cost) {
d[id][u] = cost;
vis[u] = id;
for (int i = 0; i < v[u].size(); ++i) {
int next = v[u][i];
... | a.cc: In function 'int main()':
a.cc:22:9: error: 'memset' was not declared in this scope
22 | memset(vis, -1, sizeof vis);
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include<set>
+++ |+#include <cstring... |
s425562052 | p03662 | C++ | //#define MYDEBUG
#include <bits/stdc++.h>
#ifdef MYDEBUG
#define dbp(x) cout<<#x<<": "<<x<<endl
#define dbp2(x,y) cout<<#x<<","<<#y<<": "<<x<<","<<y<<endl
#define dbp3(x,y,z) cout<<#x<<","<<#y<<","<<#z<<": "<<x<<","<<y<<","<<z<<endl
#define dbp4(w,x,y,z) cout<<#w<<","<<#x<<","<<#y<<","<<#z<<": "<<w<<","<<x<<","<<y<<"... | a.cc: In function 'std::string bfs()':
a.cc:111:38: error: expected ')' before ']' token
111 | if (q[turn].empty()&&!q[next(turn].empty()) {
| ~ ^
| )
a.cc:118:30: error: expected ')' before ';' token
118 | int now = q[turn]... |
s822226538 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(... | a.cc:29:18: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
29 | vector<int> G[1e5+2];
| ~~~^~
a.cc:29:18: error: could not convert '(1.0e+5 + (double)2)' from 'double' to 'long unsigned int'
29 | vector<int> G[1e5+2];
| ~~~^~
... |
s525642425 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(... | a.cc:29:18: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
29 | vector<int> G[1e5+2];
| ~~~^~
a.cc:29:18: error: could not convert '(1.0e+5 + (double)2)' from 'double' to 'long unsigned int'
29 | vector<int> G[1e5+2];
| ~~~^~
... |
s679095266 | p03662 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MAXN=1e5+5;
int tot,head[MAXN];
bool mark[MAXN];
int ans1,ans2;
int n;
int num;
int slit;
int father;
struct Edge
{
int from,to;
int next;
}e[MAXN*2];
void add(int u,i... | a.cc: In function 'int main()':
a.cc:97:16: error: 'vis' was not declared in this scope
97 | memset(vis,false,sizeof(vis));
| ^~~
a.cc: In function 'int dfs2(int, int)':
a.cc:66:1: warning: control reaches end of non-void function [-Wreturn-type]
66 | }
| ^
|
s027900345 | p03662 | C++ | #include<iostream>
#include<queue>
using namespace std;
const int MAX = 100000;
struct board {
static queue<board *> graph;
int type; // 0:普通マス 1:黒マス 2:白マス
};
board *nowRead;
int count(board *read, int level) {
if (read->type == 2) return level / -2;
int judge, ret = 0;
while(!read->graph.empty()) {
nowRead = ... | /usr/bin/ld: /tmp/cc3muzbr.o: warning: relocation against `_ZN5board5graphE' in read-only section `.text'
/usr/bin/ld: /tmp/cc3muzbr.o: in function `count(board*, int)':
a.cc:(.text+0x39): undefined reference to `board::graph'
/usr/bin/ld: a.cc:(.text+0x52): undefined reference to `board::graph'
/usr/bin/ld: a.cc:(.tex... |
s841117589 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
int N;
std::vector<std::vector<int>> adjlist;
std::vector<int> do_search_path (int src, int dst, int prev = -1) {
if (src == dst)
return {dst};
vector<int> path;
for ( auto neighbor : adjlist[src] ) {
if (neighbor == prev) continue;
... | a.cc: In function 'int count(int, int)':
a.cc:55:22: error: call of overloaded 'count(int&, int&)' is ambiguous
55 | sum += count (n, node);
| ~~~~~~^~~~~~~~~
a.cc:35:5: note: candidate: 'int count(int, int, int)'
35 | int count (int node, int prev = -1, int r = 0) {
| ^~~~~... |
s737655829 | p03662 | 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:70:1: error: '::main' must return 'int'
70 | int64_t main()
| ^~~~~~~
|
s317471693 | p03662 | C++ | #include <stdio.h>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
vector<int> v[100010];
int vis[100010];
int ans=0;
int dfs(int n,int w)
{
if(vis[n]==1||n==w) return 0;
else
{
vis[n]=1;
for(int i=0;i<v[n].size();i++)
{
... | a.cc:7:1: error: 'vector' does not name a type
7 | vector<int> v[100010];
| ^~~~~~
a.cc: In function 'int dfs(int, int)':
a.cc:16:23: error: 'v' was not declared in this scope
16 | for(int i=0;i<v[n].size();i++)
| ^
a.cc: In function 'int main()':
a.cc:31:9: error: 'v' w... |
s002323965 | p03662 | Java | import java.util.*;
public class Main {
static boolean[] memo;
static int[] choice;
static ArrayList[] edge;
static int N;
static int[] wa;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
edge = new ArrayList[N + 1];
memo = new boolean[N + 1];... | Main.java:46: error: array required, but ArrayList<Integer> found
int u = road[i];
^
Main.java:47: error: cannot find symbol
senten += sum[u];
^
symbol: variable sum
location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:... |
s136167605 | p03662 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int end[100005],next[100005],last[100005],fu[10005],n,flag,son[100005];
int dfs(int p,int deep)
{
int sum=0,t,b;
if(p==n)flag=deep;
if(son[p]==0)return 0;
t=last[p];
while(t)
{
b=end[t];
sum+=1+dfs(b,deep+1);
t=next[t];
}
return sum;
}
int main()
{... | a.cc: In function 'int dfs(int, int)':
a.cc:13:19: error: reference to 'end' is ambiguous
13 | b=end[t];
| ^~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bit... |
s014142840 | p03662 | C++ | #include <stdio.h>
#include <vector>
#include <queue>
using namespace std;
vector<int> edges[100001];
int distA[100001];
int distB[100001];
int main() {
int N;
scanf("%d", &N);
for (int i = 0; i < N - 1; i++) {
int a, b;
scanf("%d %d", &a, &b);
edges[a].push_back(b);
edges[b].push_back(a);
... | a.cc: In function 'int main()':
a.cc:33:33: error: lvalue required as left operand of assignment
33 | if (distA[next_pos] != -1 || next_pos = N) continue;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
a.cc:46:33: error: lvalue required as left operand of assignment
46 | if (distB[next_pos] != -1... |
s344285297 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
int n;
vector<int> g[100005];
// int dis[100005];
int prev[100005], c[100005]... | a.cc: In function 'void setDis(int)':
a.cc:19:17: error: reference to 'prev' is ambiguous
19 | prev[v] = from;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_... |
s613891313 | p03662 | C | #include <stdio.h>
#include<queue>
using namespace std;
int main(void){
int N;
scanf("%d",&N);
int a[N-1],b[N-1];
for(int i=0;i<N-1;i++){
scanf("%d %d",&a[i],&b[i]);
}
queue<int> po;
int Ftyouten[N+1];
int Styouten[N+1];
for(int i=0;i<=N;i++){Ftyouten[i]=-1;Styouten[i]=-1;}
... | main.c:2:9: fatal error: queue: No such file or directory
2 | #include<queue>
| ^~~~~~~
compilation terminated.
|
s094005519 | p03662 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define vec vector
#define mp make_pair
#define pb push_back
#define piiv pair<int, pair<int, vector<int>>>
int INF = 1000000007;
int n;
vec<vec<int>> edge;
vec<int> bfs(voi... | a.cc: In function 'int main()':
a.cc:56:2: error: expected '}' at end of input
56 | {
| ~^
|
s571033055 | p03662 | C++ | #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,x,y;
bool vis[300000];
vector<int>v[300000];
int dfs(int x){
vis[x]=1;
int res=1;
for(int i=0;i<v[x].size();i++){
if(!vis[v[x][i]]&&v[x][i]!=n){
res+=dfs(v[x][i]);
}
}
return res;
}
int dfs2(int x){
vis[x]=1... | a.cc:65:2: error: stray '#' in program
65 | }#include<bits/stdc++.h>
| ^
a.cc:48:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
48 | main(){
| ^~~~
a.cc:65:3: error: 'include' does not name a type
65 | }#include<bits/stdc++.h>
| ^~~~~~~
a.cc:68:5: error: red... |
s479308814 | p03662 | C++ | // need
#include <iostream>
#include <algorithm>
// data structure
#include <bitset>
//#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
//#include <array>
//#include <tuple>
//#include <unordered_map>
//#include <unordered_set>
#incl... | a.cc: In function 'int main()':
a.cc:125:13: error: redeclaration of 'll p'
125 | int p = n - 1;
| ^
a.cc:119:13: note: 'll p' previously declared here
119 | int p = n - 1;
| ^
|
s484112300 | p03662 | C++ | #include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se... | a.cc: In lambda function:
a.cc:42:13: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
42 | prev[to] = x;
| ^
a.cc: In function 'int main()':
a.cc:50:15: error: 'du' was not declared in this scope; did you mean 'su'?
50 | if(df[i]<=du[i]) fe++;
... |
s808803431 | p03662 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
int n;
vector<int> v[100005];
bool vis[100005];
int END;
int cntB,cntW;
void dij(int x){
priority_queue<pair<int,int> > q;
q.push(make_pair(0,x));
vis[x]=true;
while (!q.empty()){
pair<int,int> t=q.t... | a.cc: In function 'int main()':
a.cc:79:9: error: 'memset' was not declared in this scope
79 | memset(vis,0,sizeof(vis));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <queue>
+++ |+#include <cstrin... |
s850922960 | p03662 | C++ | def spaceinput():
return list(map(int,input().split(" ")))
def f(c):
return abs(sum(aa[:c])-sum(aa[c:]))
N=int(input())
aa=spaceinput()
l=0
r=len(aa)-1
vl=f(l+1)
vr=f(r)
while True:
c=int((l+r)/2)
if c==0:
c+=1
vc=f(c)
if vl >vc:
l=c
vl=vc
elif vr >vc:
r=... | a.cc:1:1: error: 'def' does not name a type
1 | def spaceinput():
| ^~~
|
s141104483 | p03662 | C++ | #include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int head[200005],to[200005],next[200005],vis[200005],num,n,ans,u,v;
void add(int u,int v)
{
next[++num]=head[u];
head[u]=num;
to[num]=v;
}
int dfs(int now,int deep)
{
vis[now]=1;
int nowans=0;
if(no... | a.cc: In function 'void add(int, int)':
a.cc:10:9: error: reference to 'next' is ambiguous
10 | next[++num]=head[u];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cm... |
s454520716 | p03662 | C++ | //QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=100000+10;
const int maxm=200000+10;
struct Edge{int u,v;Edge(int u=0,int v=0):u(u),v(v){}}e[maxn];
int first[maxn],next[maxm],ecnt;
inline void add_edge(int u,int v){
next[ecnt]=first[u];first[u]=e... | a.cc: In function 'void add_edge(int, int)':
a.cc:15:9: error: reference to 'next' is ambiguous
15 | next[ecnt]=first[u];first[u]=ecnt;e[ecnt++]=Edge(u,v);
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s723726887 | p03662 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
const int N=200010;
int e[N],next[N],head[N],ed=0;
void adde(int x,int y){e[++ed]=y;next[ed]=head[x];head[x]=ed;}
int p[N],isr[N],cnt=0,sum=0,n;
bool dfs(int x,int fa){... | a.cc: In function 'void adde(int, int)':
a.cc:11:34: error: reference to 'next' is ambiguous
11 | void adde(int x,int y){e[++ed]=y;next[ed]=head[x];head[x]=ed;}
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_cla... |
s192938317 | p03662 | C++ |
def spaceinput():
return list(map(int,input().split(" ")))
def f(c):
return abs(sum(aa[:c])-sum(aa[c:]))
N=int(input())
aa=spaceinput()
l=0
r=len(aa)-1
vl=f(l+1)
vr=f(r)
while True:
c=int((l+r)/2)
if c==0:
c+=1
vc=f(c)
if vl >vc:
l=c
vl=vc
elif vr >vc:
r... | a.cc:2:1: error: 'def' does not name a type
2 | def spaceinput():
| ^~~
|
s725753270 | p03662 | C++ | #include<bits/stdc++.h>
using namespace std;
const int maxi=1e6;
int lev,rez,n,sum,x,y;
vector<int> v[maxi];
int pr[maxi];
void dfs(int x, int pred)
{
lev++;
sum++;
pr[x]=pred;
if (x==n) rez=lev;
for (int i:v[x])
if (i!=pred) dfs(i,x);
lev--;
}
int main()
{
cin>>n;
for (int ... | a.cc: In function 'int main()':
a.cc:57:1: error: a function-definition is not allowed here before '{' token
57 | {
| ^
a.cc:69:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
69 | int main()
| ^~
a.cc:69:9: note: remove parentheses to default-initia... |
s313724219 | p03662 | C++ |
def spaceinput():
return list(map(int,input().split(" ")))
def f(c):
return abs(sum(aa[:c])-sum(aa[c:]))
N=int(input())
aa=spaceinput()
l=0
r=len(aa)-1
vl=f(l+1)
vr=f(r)
while True:
c=int((l+r)/2)
if c==0:
c+=1
vc=f(c)
if vl >vc:
l=c
vl=vc
elif vr >vc:
r... | a.cc:2:1: error: 'def' does not name a type
2 | def spaceinput():
| ^~~
|
s019207403 | p03663 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define poly vector<ll>
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r... | a.cc:40:1: error: two or more data types in declaration of 'query'
40 | int
| ^~~
a.cc: In function 'int main()':
a.cc:50:25: error: 'query' was not declared in this scope
50 | query(ssw*10+j);
| ^~~~~
a.cc:60:49: error: 'query' was not declared in this ... |
s051336489 | p03663 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef int64_t llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
llo coo=0;
llo ask(llo aa){
coo+=1;
if(coo==65){
while(true){
continue;
}
}
cout<<"? "<<aa<<endl;
char x;
cin>>x;
if(x=='Y'){
return 1;
}
else{
return 0;
}
... | a.cc: In function 'int main()':
a.cc:91:48: error: no matching function for call to 'min(llo&, int&)'
91 | ans=min(ans,i);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/... |
s001973498 | p03663 | C++ | . | a.cc:1:1: error: expected unqualified-id before '.' token
1 | .
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.