submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s899226478 | p04049 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
const double pi=acos(-1);
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};
#define ll long long
#define inf int(1e9+7)
#define pb push_back
#define mp make_pair
int n,k;
vector<int>g[2005];
int dfs(int x,int p,int deepth,int mx)
{
int ans=1;
if(deepth!... | a.cc:4:17: error: 'acos' was not declared in this scope
4 | const double pi=acos(-1);
| ^~~~
a.cc:12:1: error: 'vector' does not name a type
12 | vector<int>g[2005];
| ^~~~~~
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:18:31: error: 'g' was not declared in this scope
18 |... |
s933354400 | p04049 | C |
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
//#include <set>
//#include <map>
//#include <iostream>
#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(... | main.c:8:10: fatal error: vector: No such file or directory
8 | #include <vector>
| ^~~~~~~~
compilation terminated.
|
s317017859 | p04049 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define substr(s,f,t) (s.substr(f-1,t-f+1))
#define ALL(a) (a).begin(),(a).end()
#define Yes(hog... | a.cc: In function 'int main()':
a.cc:34:34: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, std::pair<long long int, long long int> > >, std::pair<long long int, std::pair<long long int, long long int> > >::value_type' {aka 'std::pair<long long int, ... |
s975895642 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
using namespace std;
#define FOR(i, a, b) for (int i... | a.cc: In function 'int main()':
a.cc:49:15: error: 'INT_MAX' was not declared in this scope
49 | int res = INT_MAX;
| ^~~~~~~
a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
14 | #include <cstring>
+++ |+#include <climi... |
s015338893 | p04049 | C++ | #include<queue> #include<cstdio>
#include<algorithm>
using namespace std; const int MAXN = 2000; struct edge{ int to; edge *nxt; }edges[MAXN*2 + 5], *adj[MAXN + 5], *ecnt = &edges[0]; void addedge(int u, int v) { edge *p = (++ecnt); p->to = v, p->nxt = adj[u], adj[u] = p; p = (++ecnt); p->to = u, p->nxt = adj[v], adj[v... | a.cc:1:17: warning: extra tokens at end of #include directive
1 | #include<queue> #include<cstdio>
| ^
a.cc: In function 'int main()':
a.cc:3:594: error: 'scanf' was not declared in this scope
3 | using namespace std; const int MAXN = 2000; struct edge{ int to; edge *nxt; }edges[MAXN*2 + 5... |
s667697533 | p04049 | C++ | #include<queue> #include<cstdio> #include<algorithm> using namespace std; const int MAXN = 2000; struct edge{ int to; edge *nxt; }edges[MAXN*2 + 5], *adj[MAXN + 5], *ecnt = &edges[0]; void addedge(int u, int v) { edge *p = (++ecnt); p->to = v, p->nxt = adj[u], adj[u] = p; p = (++ecnt); p->to = u, p->nxt = adj[v], adj[v... | a.cc:1:17: warning: extra tokens at end of #include directive
1 | #include<queue> #include<cstdio> #include<algorithm> using namespace std; const int MAXN = 2000; struct edge{ int to; edge *nxt; }edges[MAXN*2 + 5], *adj[MAXN + 5], *ecnt = &edges[0]; void addedge(int u, int v) { edge *p = (++ecnt); p->to = v, p->nxt... |
s475765262 | p04049 | C++ | #include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string>
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
using namespace std;
using ... | a.cc: In function 'int main()':
a.cc:179:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
179 | scanf_s("%d%d", &A, &B);
| ^~~~~~~
| scanf
|
s099656322 | p04049 | C++ | #include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string>
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
using namespace std;
using ... | a.cc: In function 'int main()':
a.cc:179:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
179 | scanf_s("%d%d", &A, &B);
| ^~~~~~~
| scanf
|
s692618982 | p04049 | C++ | #include<bits/stdc++.h>
using namespace std;
const int MAXN=4000+5;
int first[MAXN*2],next[MAXN*2],get[MAXN*2],have1,have2;
int deep[MAXN],fa[MAXN],have[MAXN];
int n,k,top,ans,now,kkk,maxkkk;
inline void add(int x,int y){get[++top]=y;next[top]=first[x];first[x]=top;}
void dfs(int x,int f,int d){
deep[x]=d; fa[x]=f; if... | a.cc: In function 'void add(int, int)':
a.cc:7:30: error: reference to 'get' is ambiguous
7 | inline void add(int x,int y){get[++top]=y;next[top]=first[x];first[x]=top;}
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1... |
s007963003 | p04049 | C++ | #include<bits/stdc++.h>
#define LF double
#define LL long long
#define ULL unsigned int
#define fo(i,j,k) for(int i=j;i<=k;i++)
#define fd(i,j,k) for(int i=j;i>=k;i--)
#define fr(i,j) for(int i=begin[j];i;i=nxt[i])
using namespace std;
int const mn=2*1e3+3,mo=1e9+7;
int n,K,tmp,u[mn],v[mn],gra,begin[mn],to[mn*2],nxt[mn... | a.cc: In function 'void insert(int, int)':
a.cc:13:14: error: reference to 'begin' is ambiguous
13 | nxt[gra]=begin[u];
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note: candidates are:... |
s438260426 | p04049 | C++ | #include<bits/stdc++.h>
#define LF double
#define LL long long
#define ULL unsigned int
#define fo(i,j,k) for(int i=j;i<=k;i++)
#define fd(i,j,k) for(int i=j;i>=k;i--)
#define fr(i,j) for(int i=begin[j];i;i=next[i])
using namespace std;
int const mn=2*1e3+3,mo=1e9+7;
int n,K,tmp,u[mn],v[mn],gra,begin[mn],to[mn*2],next[... | a.cc: In function 'void insert(int, int)':
a.cc:13:5: error: reference to 'next' is ambiguous
13 | next[gra]=begin[u];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++... |
s348969394 | p04049 | C++ | #include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#define LF double
#define LL long long
#define ULL unsigned int
#define fo(i,j,k) for(int i=j;i<=k;i++)
#define fd(i,j,k) for(int i=j;i>=k;i--)
#define fr(i,j) for(int i=begin[j];i;i=next[i])
using namespace std;
int const mn=2*1e3+3,mo=1e9+7;
int n... | a.cc: In function 'void insert(int, int)':
a.cc:16:5: error: reference to 'next' is ambiguous
16 | next[gra]=begin[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/cmath:39... |
s609073562 | p04049 | C++ | #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
const int MAXN=2005;
int n,k,Ans=MAXN;
int son[MAXN],vis[MAXN];
vector<int>T[MAXN];
void Dfs(int u,int fa,int dep,int gra){
if(dep>k/2){
if(k%2)son[gra]++;
return ;
}
vis[u]=1;
int size=T[u].size();
for(int i=0;i<size;i++){
int v=T[u... | a.cc: In function 'int main()':
a.cc:31:17: error: 'memset' was not declared in this scope
31 | memset(vis,0,sizeof(vis));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
++... |
s407676720 | p04049 | C++ | #include<bits/stdc++.h>
using namespace std;
const int N=2005;
int head[N],ver[N*2],nxt[N*2],tot;
int n,k;
int dp[N];
int g[N];
void add(int x,int y)
{
ver[++tot]=y;
nxt[tot]=head[x];
head[x]=tot;
}
void dfs(int rt,int fa,int dep)
{
for(int i=head[rt]; i; i=nxt[i])
{
int y=ver[i];
if(y!=fa)
{
dfs(y,rt,dep... | a.cc: In function 'int main()':
a.cc:60:33: error: 'b' was not declared in this scope
60 | b[y]=1;
| ^
|
s279619983 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
const int maxn=2010;
int n,k,tans,ans,x,y;
bool vis[maxn];
vector <int> e[maxn];
priority_queue <int> Qmax;
void dfs(int root,int node,int dep){
//cout<<node<<endl;
Qmax.push(dep);
vis[node]=1;
for(int i=0;i<e[node].size();++i)
if(!vis[e[node][i]])dfs(root,e[node][i],... | a.cc: In function 'int main()':
a.cc:31:31: error: 'Q' was not declared in this scope
31 | for(;!Q[t].empty();Q[t].pop());
| ^
|
s276664750 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
... | a.cc: In function 'void DFS(int, int)':
a.cc:53:62: error: request for member 'size' in 'V[n].std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
53 | m=max(m,... |
s415676991 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cstdio>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#defi... | a.cc: In function 'int main()':
a.cc:74:24: error: no matching function for call to 'min(int&, long int)'
74 | ans=min(ans,N-(upper_bound(num,num+N,K)-num));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
fro... |
s904757657 | p04049 | C++ | #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#define INF 1000000
#define MAX_V 2010
using namespace std;
struct edge{int to,cost; };
vector<edge> G[MAX_V];
bool used[MAX_V];
bool c[MAX_V][MAX_V];
int d[MAX_V],h[MAX_V],f[MAX_V][MAX_V];
int V;
void dfs(int s){
used[s] = true;
int i = 0... | a.cc: In function 'int main()':
a.cc:82:28: error: 'g' was not declared in this scope
82 | if(g[j]>mx){
| ^
|
s910221965 | p04049 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;
const int MAXN = 2000 + 10;
int N, K;
vector<int> A[MAXN];
int ans;
inline int Dfs( int x, int p, int t, int y ) {
register int i;
int res = 1;
if(t != y)
for( i = 0; i < (int) A[x].size(); ++i )
... | a.cc:10:1: error: 'vector' does not name a type
10 | vector<int> A[MAXN];
| ^~~~~~
a.cc: In function 'int Dfs(int, int, int, int)':
a.cc:14:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
14 | register int i;
| ^
a.cc:17:39: error: 'A'... |
s487392396 | p04049 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;
const int MAXN = 2000 + 10;
int N, K;
vector<int> A[MAXN];
int ans;
inline int Dfs( int x, int p, int t, int y ) {
register int i;
int res = 1;
if(t != y)
for( i = 0; i < (int) A[x].size(); ++i )
... | a.cc:10:1: error: 'vector' does not name a type
10 | vector<int> A[MAXN];
| ^~~~~~
a.cc: In function 'int Dfs(int, int, int, int)':
a.cc:14:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
14 | register int i;
| ^
a.cc:17:39: error: 'A'... |
s967882610 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
bool e[2000][2000];
int main() {
cin.tie(0); ios::sync_with_stdio(false);
int n, k; cin >> n >> k;
int a[n - 1], b[n - 1];
for (int i = 0; i < n - 1; i++) {
cin >> a[i] >> b[i];
a[i]--; b[i]--;
e[a[i]][b[i]] = e[b[i]][a[i]] = 1;
}
long long res = 0;
... | a.cc: In function 'int main()':
a.cc:32:16: error: no matching function for call to 'max(long long int&, long int)'
32 | res = max(res, upper_bound(memo, memo + n, k) - lower_bound(memo, memo + n, 0));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file include... |
s898506426 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
bool e[2000][2000];
int main() {
cin.tie(0); ios::sync_with_stdio(false);
int n, k; cin >> n >> k;
int a[n - 1], b[n - 1];
for (int i = 0; i < n - 1; i++) {
cin >> a[i] >> b[i];
a[i]--; b[i]--;
e[a[i]][b[i]] = e[b[i]][a[i]] = 1;
}
int res = 0;
if (... | a.cc: In function 'int main()':
a.cc:32:16: error: no matching function for call to 'max(int&, long int)'
32 | res = max(res, upper_bound(memo, memo + n, k) - lower_bound(memo, memo + n, 0));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /us... |
s962187660 | p04049 | C++ | #include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#define LF double
#define LL long long
#define ULL unsigned int
#define fo(i,j,k) for(int i=j;i<=k;i++)
#define fd(i,j,k) for(int i=j;i>=k;i--)
#define fr(i,j) for(int i=begin[j];i;i=next[i])
using namespace std;
int const mn=2*1e3+3,mo=1e9+7;
int n... | a.cc: In function 'void insert(int, int)':
a.cc:16:5: error: reference to 'next' is ambiguous
16 | next[gra]=begin[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/cmath:39... |
s220446351 | p04049 | C++ | #include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#define LF double
#define LL long long
#define ULL unsigned int
#define fo(i,j,k) for(int i=j;i<=k;i++)
#define fd(i,j,k) for(int i=j;i>=k;i--)
#define fr(i,j) for(int i=begin[j];i;i=next[i])
using namespace std;
int const mn=2*1e3+3,mo=1e9+7;
int n... | a.cc: In function 'void insert(int, int)':
a.cc:16:5: error: reference to 'next' is ambiguous
16 | next[gra]=begin[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/cmath:39... |
s562891551 | p04049 | C++ | // see https://github.com/LumaKernel/vimfiles/tree/master/snippets/cp-cpp/temp.snip
/// --- .lumrc Template {{{ ///
// #define DEBUG
// #define assert(...)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = tuple<ll, ll>;
using P3 = tup... | a.cc: In function 'int dfs2(int, int, int)':
a.cc:105:10: error: reference to 'size' is ambiguous
105 | return size[x][i] = c;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bi... |
s075651706 | p04049 | C++ | #include<iostream>
#include<cstdio>
#define MN 2000
using namespace std;
inline int read()
{
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
int n,K,head[MN+5],f[MN+5][MN+5],cnt,ans,F[MN+5];
struct edg... | a.cc: In function 'void Solve(int, int)':
a.cc:26:13: error: 'memset' was not declared in this scope
26 | memset(F,200,sizeof(F));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cstdio>
+++ |... |
s557965296 | p04049 | C++ | #include <cstdio>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <stack>
#include <vector>
#include <algorithm>
#include <set>
#include <deque>
#include <utility>
#include <chrono>
#include <sstream>
#include <iomani... | a.cc: In function 'std::vector<int> Centroid(int, const std::vector<std::vector<int> >&, const std::vector<bool>&)':
a.cc:74:9: error: 'function' was not declared in this scope
74 | function<void (int, int)> count_alive = [&](int u, int prev) {
| ^~~~~~~~
a.cc:20:1: note: 'std::function' is def... |
s889236260 | p04049 | C++ | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair... | a.cc: In function 'int main()':
a.cc:11:12: error: request for member 'push_back' in 'g.std::vector<int>::operator[](((std::vector<int>::size_type)a.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}... |
s549326952 | p04049 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<vector>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
#include<iterator>
#include<set>
#include<stack>
#include<queue>
#include<fstream>
#include<iomanip>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include<cmath... | a.cc: In function 'bool check(int)':
a.cc:26:23: error: 'memset' was not declared in this scope
26 | #define FILL(a,value) memset(a, value, sizeof(a))
| ^~~~~~
a.cc:126:9: note: in expansion of macro 'FILL'
126 | FILL(D, -1);
| ^~~~
a.cc:19:1: note: 'memset' is def... |
s015269939 | p04049 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<vector>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
#include<iterator>
#include<set>
#include<stack>
#include<queue>
#include<fstream>
#include<iomanip>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include<cmath... | a.cc: In function 'int main()':
a.cc:26:23: error: 'memset' was not declared in this scope
26 | #define FILL(a,value) memset(a, value, sizeof(a))
| ^~~~~~
a.cc:83:25: note: in expansion of macro 'FILL'
83 | FILL(U, 0);
| ^~~~
a.cc:1... |
s053949444 | p04049 | C++ | #include<bits/stdc++.h>
using namespace std;
int n, k;
vector<int> edge[2002];
int ans = 2147483647;
int search(int now, int dis, int last) {
int ans = 0;
if (dis < 0) ans ++;
for (int i = 0; i < edge[now].size(); i ++)
if (edge[now][i] != last) {
ans += search(edge[now][i], dis - 1, now);
}... | a.cc: In function 'int main()':
a.cc:24:5: error: expected primary-expression before 'else'
24 | else
| ^~~~
a.cc:25:25: error: 'i' was not declared in this scope
25 | for (int i = 1; i <= n; i ++) ans = min(ans, search(i, k / 2, 0));
| ^
|
s119662346 | p04049 | C++ | #include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,k,w[N],head[N],next[N];
void add(int f,int t){
static int cnt=0;
w[++cnt]=t;
next[cnt]=head[f];
head[f]=cnt;
}
int ans,cnt,dep[N],num[N];
void dfs(int x,int fa){
if (dep[x]<=k/2) cnt++;
num[x]=0;
if (dep[x]==k/2+1) num[x]... | a.cc: In function 'void add(int, int)':
a.cc:8:5: error: reference to 'next' is ambiguous
8 | next[cnt]=head[f];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/b... |
s803720020 | p04049 | C++ | #pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
using namespace std;
#define TT1T2 template<class T1, class T2>
TT1T2... | a.cc: In function 'int main()':
a.cc:107:9: error: 'memset' was not declared in this scope
107 | memset(used, 0, sizeof(used));
| ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
10 | #include <array>
+++ |+#include <... |
s061885573 | p04049 | C++ | #include<cstdio>
#include<algorithm>
#include<cstring>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
const int N=5e3+5;
const int inf=1e9;
int n,m,head[N],next[N],go[N],sum;
int dis[2005][2005],tot;
inline void add(int x,int y)
{
go[++tot]=y;
next[tot]=head[x];
... | a.cc: In function 'void add(int, int)':
a.cc:14:9: error: reference to 'next' is ambiguous
14 | next[tot]=head[x];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/b... |
s723391172 | p04049 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <utility>
#include <list>
#include <ctime>
#include <memory>
using namespace std;
const int N=2050;
vector<int> E[... | a.cc: In function 'int main()':
a.cc:61:15: error: expected identifier before '<' token
61 | if(and<0)ans=0;
| ^
|
s372648580 | p04049 | C++ | #include <iostream>
//#include <algorithm>
//#include <cmath>
#include <vector>
//#include <stdlib.h>
#include <queue>
//#include <set>
//#include <string>
//#include <string.h>
//#include <cstring>
//#include <stdio.h>
//#include <fstream>
//#include <stack>
//#include <iomanip>
//#include <conio.h>
//#include <windo... | a.cc: In function 'void bfs(int)':
a.cc:49:52: error: cannot bind rvalue reference of type 'int&&' to lvalue of type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
49 | que.push(make_pair<int,int>(vec[nx][i],s+1));
| ~~~~~~... |
s078787088 | p04049 | C++ | #include <iostream>
//#include <algorithm>
//#include <cmath>
#include <vector>
//#include <stdlib.h>
#include <queue>
//#include <set>
//#include <string>
//#include <string.h>
//#include <cstring>
//#include <stdio.h>
//#include <fstream>
//#include <stack>
//#include <iomanip>
//#include <conio.h>
//#include <windo... | a.cc: In function 'void bfs(int)':
a.cc:38:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
38 | que.push(make_pair<int,int>(t,0));
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include... |
s055086973 | p04049 | C++ | #include <iostream>
//#include <algorithm>
//#include <cmath>
#include <vector>
//#include <stdlib.h>
#include <queue>
//#include <set>
//#include <string>
//#include <string.h>
//#include <cstring>
//#include <stdio.h>
//#include <fstream>
//#include <stack>
//#include <iomanip>
//#include <conio.h>
//#include <windo... | a.cc: In function 'void bfs(int)':
a.cc:38:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
38 | que.push(make_pair<int,int>(t,0));
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include... |
s473986613 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#define rep(N) for(int i=0;i<N;i++)
using namespace std;
vector <int> vec[2005];
vector <pair<int,int> >num[2005];
bool visit[2005];
int leaf[2005];
int dist[2005][2005];
int n,k;
vector <int> leave;
void bfs(... | a.cc: In function 'void bfs(int)':
a.cc:23:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
23 | que.push(make_pair<int,int>(t,0));
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include... |
s504990477 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stdlib.h>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <cstring>
#include <stdio.h>
#include <fstream>
#include <stack>
#include <iomanip>
//#include <conio.h>
//#include <windows.h>
//#include <time... | a.cc: In function 'void bfs(int)':
a.cc:37:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
37 | que.push(make_pair<int,int>(t,0));
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include... |
s227675766 | p04049 | 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;
int ... | a.cc: In function 'int solvebian()':
a.cc:61:14: error: 'v' was not declared in this scope
61 | dist[v]=dist[u]=1;
| ^
a.cc:61:22: error: 'u' was not declared in this scope
61 | dist[v]=dist[u]=1;
| ^
a.cc: In function 'int main()':
a.cc:89:54: error: ... |
s338066450 | p04049 | 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;
int ... | a.cc: In function 'int solvedian()':
a.cc:47:14: error: 'v' was not declared in this scope
47 | dist[v]=0;
| ^
a.cc: In function 'int solvebian()':
a.cc:61:14: error: 'v' was not declared in this scope
61 | dist[v]=dist[u]=1;
| ^
a.cc:61:22: error: 'u' was not... |
s574711903 | p04049 | 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;
int ... | a.cc: In function 'int solvedian()':
a.cc:47:14: error: 'v' was not declared in this scope
47 | dist[v]=0;
| ^
a.cc:51:9: error: 'itn' was not declared in this scope; did you mean 'int'?
51 | itn res=0;
| ^~~
| int
a.cc:54:25: error: 'res' was not dec... |
s419698647 | p04049 | C++ | #include <assert.h>
#include <ctype.h>
#include <errno.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.h>
#include <algor... | a.cc:53:10: fatal error: conio.h: No such file or directory
53 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s718630910 | p04049 | C++ | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cctype>
#include <set>
#inclu... | a.cc: In function 'int main()':
a.cc:95:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
95 | ans++;
| ^~~
| abs
a.cc:97:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
97 | cout<<ans;
| ... |
s009469223 | p04049 | C++ | v#include<stdio.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<queue>
#include<deque>
#include<stack>
using namespace std;
int n,l,ans;
vector<int> nei[2005];
int dfs(int x,int p,i... | a.cc:1:2: error: stray '#' in program
1 | v#include<stdio.h>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include<stdio.h>
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/... |
s818719744 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stdlib.h>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <cstring>
#include <stdio.h>
#include <fstream>
#include <stack>
#include <iomanip>
//#include <conio.h>
//#include <windows.h>
//#include <time... | a.cc: In function 'void bfs(int)':
a.cc:37:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
37 | que.push(make_pair<int,int>(t,0));
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include... |
s814336180 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stdlib.h>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <cstring>
#include <stdio.h>
#include <fstream>
#include <stack>
#include <iomanip>
//#include <conio.h>
//#include <windows.h>
//#include <time... | a.cc: In function 'void bfs(int)':
a.cc:37:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
37 | que.push(make_pair<int,int>(t,0));
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include... |
s266203411 | p04049 | C++ | #include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cs... | a.cc: In function 'int main()':
a.cc:62:25: error: expected ',' or ';' before 'for'
62 | for(int j=0;j<adj[i].size();j++){
| ^~~
a.cc:62:37: error: 'j' was not declared in this scope
62 | for(int j=0;j<adj[i].size();j++){
| ... |
s098657552 | p04049 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stdlib.h>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <cstring>
#include <stdio.h>
#include <fstream>
#include <stack>
#include <iomanip>
#include <conio.h>
#include <windows.h>
#include <time.h>
#d... | a.cc:15:10: fatal error: conio.h: No such file or directory
15 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s030768815 | p04049 | 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;
int ... | a.cc: In function 'int main()':
a.cc:35:21: error: request for member 'push_back' in 'cnt', which is of non-class type 'int'
35 | cnt.push_back(vec);
| ^~~~~~~~~
a.cc:38:19: error: 'class std::vector<int>' has no member named 'max'
38 | int q=vec.max;
| ... |
s401156982 | p04049 | 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: In function 'int main()':
a.cc:67:9: error: 'memset' was not declared in this scope
67 | memset(dis,-1,2050*2050);
| ^~~~~~
a.cc:21:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
20 | #include <functional>
+++ |+#include <c... |
s282344497 | p04049 | C++ | #include <bits/stdc++.h>
#define ll long long
#define uint unsigned long long
#define ls x << 1
#define rs x << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define rep(i, x, y) for(i... | a.cc: In function 'int main()':
a.cc:67:21: error: 're' was not declared in this scope; did you mean 'rs'?
67 | v = re ad();
| ^~
| rs
|
s487510022 | p04049 | C++ | #include <iostream>
#include <vector>
using namespace std;
int solve(int root, int N, int K, const vector<vector<int>> &Es){
if (K == 1) return N - 2;
if (K == 2){
int ans = 0;
for (const auto &e : Es) ans = max(ans, e.size());
return N - ans - 1;
}
int k = K / 2;
vector<int... | a.cc: In function 'int solve(int, int, int, const std::vector<std::vector<int> >&)':
a.cc:9:43: error: no matching function for call to 'max(int&, std::vector<int>::size_type)'
9 | for (const auto &e : Es) ans = max(ans, e.size());
| ~~~^~~~~~~~~~~~~~~
In file in... |
s880036671 | p04049 | C++ | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int N,K;
int dp[1005][1005];
int maxi[1005];
int s[1005];
int nr[1005];
vector<int> G[1005];
void dfs(int nod,int tata)
{
dp[nod][0]=1;
maxi[nod]=nr[nod]=1;
for(auto it:G[nod]){if(tata!=it){dfs(it,nod)nr[nod]+... | a.cc: In function 'void dfs(int, int)':
a.cc:16:49: error: expected ';' before 'nr'
16 | for(auto it:G[nod]){if(tata!=it){dfs(it,nod)nr[nod]+=nr[it];};}
| ^~
| ;
|
s374528167 | p04049 | C++ | # include <iostream>
# include <vector>
# define DIM 2010
using namespace std;
vector<int> Lista[DIM];
int Marcat[DIM],f[DIM],n,k,x,y,i,sol,maxim;
void dfs(int nc){
for(int i=0;i<Lista[nc].size();i++){
int nv=Lista[nc][i];
if(Marcat[nv]==0){
Marcat[nv]=Marcat[nc]+1;
dfs(nv);
... | a.cc: In function 'int main()':
a.cc:51:9: error: 'fout' was not declared in this scope
51 | fout<<x<<"\n";
| ^~~~
|
s929630596 | p04049 | C++ | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c)... | a.cc: In function 'int main()':
a.cc:13:28: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
13 | #define rep(n) for(int i=0;i<n;i++)
| ^
a.cc:60:17: note: in expansion of macro 'rep'
60 | rep... |
s622092738 | p04049 | C++ | #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
using namespace std;
const long long int MOD = 1000000007;
long long int N,K;
list <int>edge[2001];
int dis[2001][2001];
int s, e;
bool flag[2001] = {}... | a.cc: In function 'int main()':
a.cc:32:31: error: no matching function for call to 'std::__cxx11::list<int>::insert(int&)'
32 | edge[s].insert(e);
| ~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/list:65,
from a.cc:3:
/usr/include/c++/14/bits/stl_l... |
s477364428 | p04049 | C++ | #include<algorithm>
#include<iostream>
#include<vector>
#include<utility>
#define INF 10000
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
enum { MaxEdge = 2000 };
int dist[MaxEdge][MaxEdge];
int main() {
int n, k;
cin >> n >> k;
vector<int> edge[MaxEdge];
memset(dist, INF, sizeof(dist));
ve... | a.cc: In function 'int main()':
a.cc:16:9: error: 'memset' was not declared in this scope
16 | memset(dist, INF, sizeof(dist));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include<utility>
+++ |+#include ... |
s382058223 | p04049 | C++ | #ifdef LOCAL111
#define _GLIBCXX_DEBUG
#else
#define NDEBUG
#endif
#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
template<typename T, typename U> ostream& operator<< (ostream& os, const pair<T,U>& p) { cout << '(' << p.first << ' ' << p.second << ')'; return os; }
//library
typedef long long cos... | a.cc: In lambda function:
a.cc:253:43: error: 'erased' was not declared in this scope
253 | if(e.to == par or erased[e.to]) continue;
| ^~~~~~
a.cc: In function 'std::tuple<long long int, int, int> getTreeDiameter(const Graph&)':
a.cc:262:18: err... |
s472407233 | p04049 | C++ | #include <bits/stdc++.h>
#define N 2002
#define PB push_back
#define MP make_pair
#define F first
#define S second
using namespace std;
int n, m, k, i, j, l, r, t, fix[N], fox[N], a[N][N], d, ans;
vector<int>v[N];
queue<int>q;
int main() {
cin>>n>>k;
if(k==1){
cout<n-2<<endl;
return 0;
}
... | a.cc: In function 'int main()':
a.cc:14:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
14 | cout<n-2<<endl;
| ~~~^~~~~~
|
s465743046 | p04049 | Java | import java.util.*;
public class Main
{
private final Map<Long, Vertex> vertices = new HashMap<Long, Vertex>();
private final Map<Long, List<Long>> edges = new HashMap<Long, List<Long>>();
private final int N, K;
Diameter(String input)
{
String[] lines = input.split("\n");
String[]... | Main.java:9: error: invalid method declaration; return type required
Diameter(String input)
^
1 error
|
s987755960 | p04049 | Java | import java.util.*;
public class Main
{
private final Map<Long, Vertex> vertices = new HashMap<Long, Vertex>();
private final Map<Long, List<Long>> edges = new HashMap<Long, List<Long>>();
private final int N, K;
Diameter(String input)
{
String[] lines = input.split("\n");
String[]... | Main.java:9: error: invalid method declaration; return type required
Diameter(String input)
^
1 error
|
s182527784 | p04049 | Java | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.lang.*;
import java.util.Iterator;
public class Main
{
private static class Edge
{
Vertex from, to;
long fromDepth, toDepth;
long fromCost, toCost;
... | Main.java:196: error: cannot find symbol
System.out.println(result);
^
symbol: variable result
location: class Main
1 error
|
s642759520 | p04049 | Java | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Iterator;
public class Main
{
private static class Edge
{
Vertex from, to;
long fromDepth, toDepth;
long fromCost, toCost;
public Ed... | Main.java:196: error: cannot find symbol
System.out.println(result);
^
symbol: variable result
location: class Main
1 error
|
s863936723 | p04049 | Java | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Iterator;
public class Main
{
private static class Edge
{
Vertex from, to;
long fromDepth, toDepth;
long fromCost, toCost;
public Edge(Vertex from, Vertex to)
... | Main.java:132: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:132: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:194: error:... |
s379961036 | p04049 | Java | import java.util.*;
public class Main
{
private static class Edge
{
Vertex from, to;
long fromDepth, toDepth;
long fromCost, toCost;
public Edge(Vertex from, Vertex to)
{
this.from = from;
this.to = to;
this.from.edges.add(this);
... | Main.java:190: error: cannot find symbol
System.out.println(result);
^
symbol: variable result
location: class Main
1 error
|
s575248021 | p04049 | Java | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Main
{
private static class Edge
{
Vertex from, to;
long fromDepth, toDepth;
long fromCost, toCost;
public Edge(Vertex from, Vertex to)
... | Main.java:190: error: ';' expected
throw new RuntimeException("test")
^
1 error
|
s557775881 | p04049 | Java | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Diameter
{
private static class Edge
{
Vertex from, to;
long fromDepth, toDepth;
long fromCost, toCost;
public Edge(Vertex from, Vertex to)
... | Main.java:7: error: class Diameter is public, should be declared in a file named Diameter.java
public class Diameter
^
1 error
|
s078468845 | p04049 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int NMAX = 2000 + 5;
int n, k;
int h[NMAX];
int sz[NMAX];
int dp[NMAX][NMAX]; //dp[node][h] = numarul minim de noduri care trebuie
//eliminate pentru a obtine inaltimea maxim h in
//subarbor... | a.cc: In function 'void dfs(int, int)':
a.cc:60:41: error: 'K' was not declared in this scope
60 | for (int j = 0; j < h[node] && j <= K; ++ j)
| ^
|
s768842945 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
vector<int> edges[2010];
int dist[2010][2010];
void dfs(int now, int fa, int depth,int root) {
dist[root][now] = depth;
for(int next: edges[now]) {
if(next == fa) {
continue;
}
... | a.cc: In function 'void count()':
a.cc:23:16: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
23 | cin<<u<<v;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_... |
s638298814 | p04049 | C++ | #include<iostream>
#include<vector>
#include<cstdio>
#include<algorithm>
using namespace std;
vector<int> edge[2010];
int dis[2010];
bool used[2010];
int n, k;
int main() {
int a, b,ma=100000;
cin >> n >> k;
for (int i = 0; i < n - 1; i++) {
scanf("%d %d", &a, &b);
a--; b--;
edge[a].push_back(b);
edge[b].p... | a.cc: In function 'int main()':
a.cc:22:25: error: 'evencalc' was not declared in this scope
22 | evencalc(i, i, 0);
| ^~~~~~~~
a.cc:31:53: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp... |
s237422931 | p04049 | C++ | #include <bits/stdc++.h>
#define endl '\n'
#define Int long long
#define Double long double
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define CLR(a, b) memset(a, b, sizeof a)
#define debug(x) cerr << #x << " " << x << endl;
#define MOD 1000000007
#define MAXN 2002
using namespace std;
int n, k;
i... | a.cc: In function 'int main()':
a.cc:62:50: error: expected ';' before 'mark'
62 | depth[0][i] = depth[1][i] = 0
| ^
| ;
63 |
64 | mark[net[i][j]] = 1;
| ... |
s329967213 | p04049 | C++ | #include <bits/stdc++.h>
#define endl '\n'
#define Int long long
#define Double long double
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define CLR(a, b) memset(a, b, sizeof a)
#define debug(x) cerr << #x << " " << x << endl;
#define MOD 1000000007
#define MAXN 2002
using namespace std;
int n, k;
i... | a.cc: In function 'int main()':
a.cc:47:32: error: expected ';' before 'dfs'
47 | depth[0][i] = 0
| ^
| ;
48 |
49 | dfs(i, 0, 0);
| ~~~
a.cc:62:50: error: expected ';' befor... |
s161444394 | p04049 | C++ | #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <stdio.h>
#include <set>
#include <string.h>
typedef long long ll;
using namespace std;
int dfs(int me, vector<int> &visited, vector<vector<int> > &table, int left) {
if (left<0) return 0;
if (visited[me]==1) return 0;
in... | a.cc: In function 'int main()':
a.cc:45:48: error: 'visite' was not declared in this scope; did you mean 'visited'?
45 | int tmp=0; for (int j=0; j<n; j++) if (visite[j]==0) tmp++;
| ^~~~~~
| visited
|
s338628903 | p04049 | Java | package AGC001;
import java.util.ArrayDeque;
import java.util.ArrayList;
\import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
solver();
}
static void solver() {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();// mo... | Main.java:5: error: illegal character: '\'
\import java.util.Arrays;
^
Main.java:5: error: class, interface, enum, or record expected
\import java.util.Arrays;
^
Main.java:6: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
|
s817723224 | p04049 | C++ | x | a.cc:1:1: error: 'x' does not name a type
1 | x
| ^
|
s625552395 | p04049 | C++ | #include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
using namespace std;
#define... | a.cc:33:29: error: ISO C++ forbids declaration of 'amax' with no type [-fpermissive]
33 | template <class T, class U> amax(T& x, U y) {if (x < y) x = y;}
| ^~~~
a.cc: In function 'int amax(T&, U)':
a.cc:33:63: warning: no return statement in function returning non-void [-Wreturn-typ... |
s988188749 | p04049 | C++ | //
/*
ID: kfoozmi1
LANG: C++
TASK:
*/
#include <bits/stdc++.h>
using namespace std;
#ifdef kfoozminus
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu() {
cerr << endl;
}
template <typename T>
void faltu(T a[], int n) {
for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
cerr << end... | a.cc:108:19: error: 'm' was not declared in this scope
108 | vector<int> v[2] (m, 0);
| ^
a.cc:108:23: error: expression list treated as compound expression in initializer [-fpermissive]
108 | vector<int> v[2] (m, 0);
| ^
|
s454964354 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF INT_MAX/3
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cout<<#x<<":"<<x<<endl
#define... | In file included from /usr/include/c++/14/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
from a.cc:1:
a.cc: In function 'int main()':
a.cc:62:28: error: expected ')' before '!' token
62 | assert(d[q]!|=INF);
| ... |
s948489429 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF INT_MAX/3
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cout<<#x<<":"<<x<<endl
#define... | a.cc: In function 'int main()':
a.cc:82:17: error: redeclaration of 'int t'
82 | int t=0;
| ^
a.cc:77:24: note: 'int t' previously declared here
77 | int s=A[i],t=B[i];
| ^
|
s736703566 | p04049 | C++ | 5555 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5555
| ^~~~
|
s197825051 | p04049 | C++ | //GRL_5A
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstdio>
using namespace std;
#define INF (1<<30)
static const int MAX=100000;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
... | a.cc: In function 'int main()':
a.cc:86:17: error: void value not ignored as it ought to be
86 | int now = solve();
| ~~~~~^~
a.cc:93:12: error: no match for 'operator[]' (operand types are 'std::vector<Edge> [100000]' and '__gnu_cxx::__alloc_traits<std::allocator<Edge>, Edge>::value_type' {aka 'Ed... |
s255794591 | p04049 | C++ | #include <cmath>
#include <map>
#include<fstream>
#include<algorithm>
#include <iostream>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>
#include<bitset>
#include <cassert>
#include <stack>
#include <ctime>
#include <vector>
#include <cstdlib>
#include <... | a.cc: In function 'int main()':
a.cc:191:16: error: 'n' was not declared in this scope
191 | parent[n - 1] = n - 1;
| ^
|
s931118063 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T> using Graph = vector<vector<T>>;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (__typeof(a.begin()) x = a.begin(); x != a.end... | a.cc: In function 'std::pair<int, int> solve(int, int)':
a.cc:38:16: error: 'mx' was not declared in this scope
38 | return {res, mx + 1};
| ^~
a.cc:38:22: error: could not convert '{res, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<int, int>'
38 | return {r... |
s453307086 | p04049 | Java | import java.io.BufferedReader;
import java.io.FileReader;
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.HashSet;
import java.util.LinkedList;
import java.util.StringTokenizer;
... | Main.java:13: error: class ShortenDiameter is public, should be declared in a file named ShortenDiameter.java
public class ShortenDiameter {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s708918595 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
void init_ios() {ios_base::sync_with_stdio(false); cin.tie(nullptr);}
int N, K;
vector<int> G[2000];
int main() {
scanf("%d%d", &N, &K);
for (int i = 0, A,B; i < N-1; ++i) {
scanf("%d%d", &A, &B);
--A, --B;
G[A].push_back(B);
G[B].push_back(A);
}
int res = 1<... | a.cc: In function 'int main()':
a.cc:25:36: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
25 | auto v = q.top(); q.pop();
| ^~~
| pop
|
s383335047 | p04049 | C++ | #include "inspect.hpp"
#include <vector>
#include <map>
#include <iostream>
using namespace std;
typedef vector<vector<int>> Graph;
void dfs(const Graph &g,vector<int>&v,int cur,int d){
v[cur]=d;
for(auto &e:g[cur])if(!v[e])dfs(g,v,e,d+1);
}
typedef pair<int, int> Result;
Result visit(int p, int v, const Graph &g) ... | a.cc:1:10: fatal error: inspect.hpp: No such file or directory
1 | #include "inspect.hpp"
| ^~~~~~~~~~~~~
compilation terminated.
|
s694540399 | p04049 | C++ |
#include <iomanip>
#include <utility>
#include <algorithm>
#include <type_traits>
#include <set>
#include <string>
#include <iostream>
#include <fstream>
#include <cassert>
#include <memory>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <queue>
#include <vector>
#include <array>
#include <... | a.cc:27: error: unterminated #else
27 | #if 0
|
s192780961 | p04049 | C++ | #include "inspect.hpp"
#include <vector>
#include <map>
#include <iostream>
using namespace std;
typedef vector<vector<int>> Graph;
void dfs(const Graph &g,vector<int>&v,int cur,int d){
v[cur]=d;
for(auto &e:g[cur])if(!v[e])dfs(g,v,e,d+1);
}
typedef pair<int, int> Result;
Result visit(int p, int v, const Graph &g) ... | a.cc:1:10: fatal error: inspect.hpp: No such file or directory
1 | #include "inspect.hpp"
| ^~~~~~~~~~~~~
compilation terminated.
|
s764292203 | p04049 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#define int long long
using namespace std;
int N, K... | a.cc: In function 'long long int dfs(long long int, long long int, long long int)':
a.cc:29:25: error: reference to 'next' is ambiguous
29 | for (int i = 0; i < next[now].size(); i++) {
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c+... |
s087010688 | p04049 | C++ | #include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int n,k;
vector<int> e[2222];
int dp[2222][2222];
int tmp[2222];
void upd(int&x,int y){
if(x==-1 || x>y)x=y;
}
void dfs(int x,int f){
dp[x][0] = 1;
for(int i=1; i<=k; i++)
dp[x][i] = 0;
for(vector<int>::iterator it = e[x].begin(); it!=e[x... | a.cc: In function 'void dfs(int, int)':
a.cc:21:17: error: 'memset' was not declared in this scope
21 | memset(tmp,-1,sizeof(tmp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<vector... |
s121730252 | p04049 | C++ | #include <bits/stdc++.h>
#define REP(i, a, b) for (int i = a; i <= b; ++i)
#define RVC(i, S) for (int i = 0; i < S.size(); ++i)
using namespace std;
set<int>::iterator it;
int n, k, dep[2005], sz[2005];
set<int> Tree[2005];
void dfs(int x, int fa){
dep[x] = dep[fa] + 1;
for (it = Tree[x].begin(); it != Tree[x].end(... | a.cc: In function 'int main()':
a.cc:37:21: error: 'r' was not declared in this scope
37 | while (diam(r, l, r) > k){
| ^
a.cc:37:24: error: 'l' was not declared in this scope
37 | while (diam(r, l, r) > k){
| ^
a.cc:38:19: error: 'ans' was no... |
s314440566 | p04049 | C++ | #include <bits/stdc++.h>
using namespace std;
#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl
#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)
#def... | a.cc: In function 'int main()':
a.cc:69:16: error: no matching function for call to 'min(ll&, int&)'
69 | a = min(a, ans);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from... |
s245344118 | p04050 | C++ | import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); } bool DEBUG = 0;
void log(A ...)(lazy A a){ if(DEBUG) print(a); }
voi... | a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import std.math, std.random, std.bigi... |
s840622564 | p04050 | C++ | netman
TLE
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ld EPS = 1e-11;
const ld PI = acos(-1.0);
const int INF = (int)1e9 + 5;
const ll LINF = (ll)1e18 + 5;
template<class T>
ll abs(const T & x) { return x < 0 ? -x : x; }
... | a.cc:1:1: error: 'netman' does not name a type
1 | netman
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:5:
/usr/include/c... |
s244183752 | p04050 | C++ | #include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
const int MAX_N = 1e5 + 5;
int n, m;
int Arr[MAX_N];
int main() {
ios::sync_with_stdio(false), cin.tie(0);
cin >> n >> m;
for (int i = 0; i < n; i++)
cin >> Arr[i];
assert(n % 2);
if (n % 2) {
int num = 0;
f... | a.cc: In function 'int main()':
a.cc:17:9: error: 'assert' was not declared in this scope
17 | assert(n % 2);
| ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
4 | #include <vector>
+++ |+#include <cassert>
5 | ... |
s300935899 | p04050 | C++ | #include <algorithm>
#include <iostream>
#include <cstirng>
#include <vector>
using namespace std;
const int MAX_N = 1e5 + 5;
int n, m;
int Arr[MAX_N];
int main() {
ios::sync_with_stdio(false), cin.tie(0);
cin >> n >> m;
for (int i = 0; i < n; i++)
cin >> Arr[i];
assert(n % 2);
if (n % 2) {
int num = 0;
f... | a.cc:3:10: fatal error: cstirng: No such file or directory
3 | #include <cstirng>
| ^~~~~~~~~
compilation terminated.
|
s145150281 | p04050 | C++ | #include <iostream>
#include <sstream>
#include <vector>
#define MAX_N 100000
#define MAX_M 100
using namespace std;
int N, M;
int A[MAX_N];
vector<int> solve()
{
vector<int> B;
vector<int> O; // 奇数のインデックス
for ( int i = 0; i < M; i++ )
if ( A[i] % 2 ) O.push_back( i );
switch ( O.size() )
... | a.cc: In function 'int main(int, char**)':
a.cc:60:25: error: 'ostream_iterator' was not declared in this scope
60 | copy( A, A + M, ostream_iterator<int>( cout, " " ) );
| ^~~~~~~~~~~~~~~~
a.cc:4:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probab... |
s078788968 | p04050 | C++ | #include <iostream>
#include <vector>
#define MAX_N 100000
#define MAX_M 100
using namespace std;
int N, M;
int A[MAX_N];
vector<int> solve()
{
vector<int> B;
vector<int> O; // 奇数のインデックス
for ( int i = 0; i < M; i++ )
if ( A[i] % 2 ) O.push_back( i );
switch ( O.size() )
{
case 2:
... | a.cc: In function 'int main(int, char**)':
a.cc:59:25: error: 'ostream_iterator' was not declared in this scope
59 | copy( A, A + M, ostream_iterator<int>( cout, " " ) );
| ^~~~~~~~~~~~~~~~
a.cc:3:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.