submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s670532139 | p04008 | C++ | to be implemented | a.cc:1:1: error: 'to' does not name a type; did you mean 'auto'?
1 | to be implemented
| ^~
| auto
|
s257675824 | p04008 | C++ | #include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>
using namespa... | a.cc: In function 'int main()':
a.cc:128:17: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
128 | for(j=0;j<=100:j++){
| ^
a.cc:128:23: error: expected ';' before ':' token
128 | for(j=0;j<=100:j++){
... |
s406309433 | p04008 | C++ | st[dep[x]].push_back(x);
for (int p=now[x];p;p=pre[p])
{
int child=son[p];
fa[child]=x;dep[child]=dep[x]+1;
dfs(child);
}
}
void solve(int x)
{
for (int i=1;i<=k;i++)
{
if (vis[x]) return;
vis[x]=1;
x=fa[x];
}
ans+=(x!=1);
}
int main()
{
n=read(),k=read();
int... | a.cc:1:5: error: 'st' does not name a type
1 | st[dep[x]].push_back(x);
| ^~
a.cc:2:5: error: expected unqualified-id before 'for'
2 | for (int p=now[x];p;p=pre[p])
| ^~~
a.cc:2:23: error: 'p' does not name a type
2 | for (int p=now[x];p;p=pre[p])
| ... |
s187890892 | p04008 | C++ | st[dep[x]].push_back(x);
for (int p=now[x];p;p=pre[p])
{
int child=son[p];
fa[child]=x;dep[child]=dep[x]+1;
dfs(child);
}
}
void solve(int x)
{
for (int i=1;i<=k;i++)
{
if (vis[x]) return;
vis[x]=1;
x=fa[x];
}
ans+=(x!=1);
}
int main()
{
n=read(),k=read();
int... | a.cc:1:5: error: 'st' does not name a type
1 | st[dep[x]].push_back(x);
| ^~
a.cc:2:5: error: expected unqualified-id before 'for'
2 | for (int p=now[x];p;p=pre[p])
| ^~~
a.cc:2:23: error: 'p' does not name a type
2 | for (int p=now[x];p;p=pre[p])
| ... |
s806990713 | p04008 | C++ | #include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9,MOD = 1e9+7,ohara = 1e6;
const ll LINF = 1e18;
using namespace std;
#define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrrep(i,a,b) for(ll i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#defin... | a.cc: In function 'void dfs(ll, ll)':
a.cc:32:19: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
32 | if(depth==k&&a[now]!=0)ans++,depth=1;
| ^
a.cc: In function 'int main()':
a.cc:47:15: error: invalid types 'll {aka long long int}[ll {aka long ... |
s556503210 | p04008 | C++ | #include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9,MOD = 1e9+7,ohara = 1e6;
const ll LINF = 1e18;
using namespace std;
#define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrrep(i,a,b) for(ll i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#defin... | a.cc: In function 'void dfs(ll, ll)':
a.cc:32:19: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
32 | if(depth==k&&a[now]!=0)ans++,depth=1;
| ^
|
s434914330 | p04008 | C++ | #include<bits/stdc++.h>
vector<int> v[1<<17];int n,k,a,y,t,i;
int s(int x,int p){int r=0;for(t:v[x])r=max(r,s(t,x));a+=++r>=k&&p;return r%k;}
int main(){std::cin>>n>>k>>y;for(a=(y!=1);std::cin>>y;v[y-1].push_back(++i));s(0,0);std::cout<<a;} | a.cc:2:1: error: 'vector' does not name a type
2 | vector<int> v[1<<17];int n,k,a,y,t,i;
| ^~~~~~
a.cc: In function 'int s(int, int)':
a.cc:3:33: error: found ':' in nested-name-specifier, expected '::'
3 | int s(int x,int p){int r=0;for(t:v[x])r=max(r,s(t,x));a+=++r>=k&&p;return r%k;}
| ... |
s757567487 | p04008 | C++ | #include<bits/stdc++.h>
using namespace std;
vector<int> v[1e6];int n,k,a,y,i=1;
int s(int x,int p=0){int r=0;for(int to:v[x])r=max(r,s(to,x));if(++r>=k&&p)a++,r=0;return r;}
int main(){cin>>n>>k>>y;if(y!=1)a++;for(;i<n;i++){cin>>y;v[y-1].push_back(i);}s(0);cout<<a;} | a.cc:3:15: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
3 | vector<int> v[1e6];int n,k,a,y,i=1;
| ^~~
a.cc:3:15: error: could not convert '1.0e+6' from 'double' to 'long unsigned int'
3 | vector<int> v[1e6];int n,k,a,y,i=1;
| ^... |
s387196985 | p04008 | C++ | #include<bits/stdc++.h>
using namespace std;
vector<int> v[101010];
int n,k,a,y,i=1;
int s(int x,int p=0){
int r=0;
for(auto to:v[x])r=max(r,s(to,x));
if(++r>=k&&p)a++,r=0;
return r;
}
int main(){
cin>>n>>k>>y;
if(y!=1)a++;
for(;i<n;i++){
cin>>y;
v[x-1].push_back(i);
}
... | a.cc: In function 'int main()':
a.cc:17:11: error: 'x' was not declared in this scope
17 | v[x-1].push_back(i);
| ^
a.cc:20:10: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
20 | puts(a);
| ^
| |
| int
In file included... |
s957603171 | p04008 | C++ | #pragma GCC optimize(2)
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
typedef long long ll;
const int MAXN = 1e5 + 5;
const int mod = 1e9 + 7;
using namespace std;
int cot[MAXN];
int nex[MAXN];
int deq[MAXN];
int main() {
int n, k;
cin >> n >> k;
int ans = 0;
for(int i = 1; i <= n; i++... | a.cc: In function 'int main()':
a.cc:18:21: error: expected primary-expression before ')' token
18 | scanf("%d",&);
| ^
|
s744183184 | p04008 | C++ | #pramga GCC optimize(2)
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
typedef long long ll;
const int MAXN = 1e5 + 5;
const int mod = 1e9 + 7;
using namespace std;
int cot[MAXN];
int nex[MAXN];
int deq[MAXN];
int main() {
int n, k;
cin >> n >> k;
int ans = 0;
for(int i = 1; i <= n; i++... | a.cc:1:2: error: invalid preprocessing directive #pramga; did you mean #pragma?
1 | #pramga GCC optimize(2)
| ^~~~~~
| pragma
a.cc: In function 'int main()':
a.cc:18:21: error: expected primary-expression before ')' token
18 | scanf("%d",&);
| ^
|
s395471203 | p04008 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <utility>
#define MAX_V 100010
using namespace std;
vector<int> G[MAX_V];
vector<pair<int,int>> toi;
stack<int> st;
bool used[MAX_V];
int d[MAX_V],a[MAX_V],c;
void dfs(int s){
used[s] = true;
st.push(s);
while(!st.empty()){
int ... | a.cc: In function 'int main()':
a.cc:49:16: error: 'V' was not declared in this scope
49 | cin >> V >> k;
| ^
|
s428354231 | p04008 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
const int N=1e5+10;
int n,k,sum=0,count[N],q[N],h=1,t=0,fa[N],ll[N];
int read(){
int f=1,ans=0;char c=getchar();
while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
while(c>='0'&&c<='9'){ans=ans*10+c-48;c=getchar();}
return ans*f;
}
int main(){
n=r... | a.cc:31:1: error: 'agc004' does not name a type
31 | agc004 D
| ^~~~~~
|
s185462970 | p04008 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;
const int MAXN = 1e5 + 10;
int N, K;
vector<int> E[MAXN];
int ans;
inline int Dfs(int x) {
int res = 1, d;
for(register int i : E[x])
(d = Dfs(i)) == K ? ++ans : res = max(res, d + 1);
return res;
... | a.cc:10:1: error: 'vector' does not name a type
10 | vector<int> E[MAXN];
| ^~~~~~
a.cc: In function 'int Dfs(int)':
a.cc:15:30: error: 'E' was not declared in this scope
15 | for(register int i : E[x])
| ^
a.cc:15:26: warning: ISO C++17 does not allow 'register' s... |
s580985819 | p04008 | C++ | # include <bits/stdc++.h>
using namespace std;
# define REP(i, a, b) for(int i = a; i <= b; ++ i)
# define CLR(i, a) memset(i, a, sizeof(i))
# define REPD(i, a, b) for(int i = a; i >= b; -- i)
# define REPG(i, h, x) for(int i = h[x], v; ~i; i = edge[i].next)
const int N = 1e5 + 5;
int n, k;
int head[N], cnt;
struct... | a.cc: In function 'int main()':
a.cc:30:35: error: 'a' was not declared in this scope
30 | REP(i, 1, n) scanf("%d", &a[i]);
| ^
a.cc:31:26: error: 'a' was not declared in this scope
31 | REP(i, 2, n) add(a[i], i);
| ^
a.cc:33:2... |
s420712236 | p04008 | C++ | #include<bits/stdc++.h>
using namespace std;
const int N=2e5;
int m,ans;
int head[N],nxt[N];
inline void dfs(int k,int s) {
if (s>m) s=1,ans++;
for (int i=head[k];i;i=nxt[i])
dfs(i,s+1);
}
int main()
{
int n=gi(),i,k;m=gi();
ans=gi()!=1;
for (i=2;i<=n;i++) nxt[i]=head[k=gi()],head[k]=i;
dfs(1,0);
printf("%d\n"... | a.cc: In function 'int main()':
a.cc:13:15: error: 'gi' was not declared in this scope
13 | int n=gi(),i,k;m=gi();
| ^~
a.cc:15:14: error: 'i' was not declared in this scope
15 | for (i=2;i<=n;i++) nxt[i]=head[k=gi()],head[k]=i;
| ^
a.cc:15:40: error: 'k' was... |
s971448668 | p04008 | C++ |
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long
using namespace std;
int N,K;
int a[100000];
int ans = 0;
int rank[100000];
int DFS(int v){
if(rank[v]>=0)return rank[v];
int res = rank[a[v]]+1;
if(res>K)ans++,res=1;
ret... | a.cc: In function 'int DFS(int)':
a.cc:16:8: error: reference to 'rank' is ambiguous
16 | if(rank[v]>=0)return rank[v];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/alg... |
s328212953 | p04008 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
void dfs(int no,int d,int k);
vector<int> ed[100001];
int visit[100001];
int ans=0;
int main(){
int i,j;
int n,k;
cin>>n>>k;
int a[n+1];
for(i=1;i<=n;i++)
{cin>>a[i];
if(i==1){
if(a[1]!=1)
{a[1]=1... | a.cc: In function 'void dfs(int, int, int)':
a.cc:40:1: error: reference to 'visit' is ambiguous
40 | visit[no]=1;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visito... |
s719303086 | p04008 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;
int N, K;
int ans;
vector<vector<int>> rev;
// int dfs(int v, int prev){
// int depth = 0;
// for(int to : rev[v]){
// if(to == prev) continue;
// depth = max(depth, 1 + dfs... | a.cc: In function 'int dfs(int, int)':
a.cc:30:18: error: 'm' was not declared in this scope
30 | if (e == m - 1) {
| ^
|
s394317410 | p04008 | C++ | #include <set>
#include <map>
#include <queue>
#include <ctime>
#include <cmath>
#include <cstdio>
#include <vector>
#include <string>
#include <cctype>
#include <bitset>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <iostream>
#include <algorithm>
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#defin... | a.cc: In function 'void dfs(int, int, int)':
a.cc:61:17: error: 'ds' was not declared in this scope; did you mean 'd'?
61 | RAL(i,x) if(ds[e[i].to]==ds[x]+1) {
| ^~
| d
a.cc: In function 'void bfs(int)':
a.cc:68:12: error: 'ds' was not declared in this scope; did you m... |
s317924463 | p04008 | C++ | #include<iostream>
#include<queue>
#include<functional>
using namespace std;
int n, k, a[200000], dist[200000], dist2[200000], cnt, r[200000];
vector<int>G[200000], H[200000], U[200000]; int T;
queue<pair<int, int>>Q;
vector<pair<int, int>>V;
void bfs1() {
for (int i = 1; i <= n; i++)dist2[i] = 999999999;
queue<int>R... | a.cc: In function 'void sorts()':
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'sorts'?
24 | sort(V.begin(), V.end(), greater<pair<int, int>>());
| ^~~~
| sorts
|
s915224147 | p04008 | C++ | #include <stdlib.h>
#include <stdio.h>
typedef int bool;
#define true 1
#define false 0
int main(int argc, char* argv[]){
int N, K;
scanf("%d %d", &N, &K);
int a[N];
int i,j;
for(i=0; i<N; ++i){
scanf("%d",&a[i]);
}
int ans = 0;
if(a[0] != 1){
a[0] = 1;
++ans;
}
int count[N];
bool co... | a.cc:4:13: error: redeclaration of C++ built-in type 'bool' [-fpermissive]
4 | typedef int bool;
| ^~~~
|
s711121952 | p04008 | Java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main_Other {
/**
* 整数K
*/
private static int K;
/**
* ある町へ転送するテレポータが設置されている町のリスト
*/
private static List<List<Integer>> vec = new ArrayList<>();
/**
* 転送先を変えなければならないテレポータの数
*/
... | Main.java:5: error: class Main_Other is public, should be declared in a file named Main_Other.java
public class Main_Other {
^
1 error
|
s914737665 | p04008 | Java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
private static long K;
private static List<List<Long>> vec;
private static int ans;
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
... | Main.java:34: error: incompatible types: possible lossy conversion from long to int
height = Math.max(height, dfs(j, v));
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
|
s945193996 | p04008 | Java | import ru.ifmo.niyaz.io.FastScannerTokenizer;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.util.*;
import java.io.InputStreamReader;
import java.io.Writer;
import java.io.BufferedRea... | Main.java:1: error: package ru.ifmo.niyaz.io does not exist
import ru.ifmo.niyaz.io.FastScannerTokenizer;
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s795107876 | p04008 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
typedef long long ll;
ll N,K,ans=0;
int a[100010];
vector<int> p[100010];
void dfs(ll h,int v) {
if (h == K && a[v] != 1) {
ans++; h = 0;
}
for (int i = 0; i < p[v].size(); i++) {
dfs(h + 1, p[v][i]);
}
}
int main() {
cin >> N >> K;
... | a.cc: In function 'int main()':
a.cc:25:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
25 | scanf_s("%d", &a[i]);
| ^~~~~~~
| scanf
|
s673882193 | p04008 | Java | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author Denis Nedelyaev
... | Main.java:91: error: invalid method declaration; return type required
public FastScanner(InputStream inputStream) throws IOException {
^
1 error
|
s537869142 | p04008 | C++ |
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
ll n, k;
ll a[123456];
vector<ll>child[123456];
ll rem[123456];
ll ans = 0;
ll calcrem(ll v)
{
if (rem[v] >= 0)return rem[v];
ll ans = 0;
if (child[v].size() == 0)
{
return rem[v] = 0;
}
... | a.cc:60:1: error: '::main' must return 'int'
60 | ll main()
| ^~
|
s868882833 | p04008 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100055];
int d[100055];
bool used[100055];
bool in[100055];
vector<int> rg[100055];
int tail[100055];
void dfs(int v, int dep = 0) {
d[v] = dep;
used[v] = true;
for (auto u : rg[v]) {
if (used[u]) continue;
dfs(u, dep + 1);
}
}
int rdfs(int v) {
... | a.cc: In function 'int main()':
a.cc:86:24: error: expected ',' or ';' before '!' token
86 | int res = a[0] !+ 0;
| ^
|
s124343408 | p04008 | C++ | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author RiaD
*/
#include <iostream>
#include <fstream>
#include <iostream>
#include <vector>
#include <iterator>
#include <string>
#include <stdexcept>
#ifndef SPCPPL_ASSERT
#ifdef SPCPPL_DEBUG
#define SPCPPL_ASSERT(c... | a.cc:48:36: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
48 | class IntegerIterator: public std::iterator<std::input_iterator_tag, T, std::ptrdiff_t, T*, T> {
| ... |
s597533425 | p04008 | C++ | #include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define mp make_pair
#define pb push_back
#define x first
#define y second
typedef long long ll;
typedef vector<int> vi;
typedef pair<int... | a.cc: In function 'int dfs(int, int)':
a.cc:33:11: error: reference to 'next' is ambiguous
33 | p=next[p];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/bits/stl_tree.h:63,
from /usr/include/c++/14/map:62,
... |
s082734107 | p04009 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
const int N = 101;
int n, m;
string a[N];
s... | a.cc: In function 'int main()':
a.cc:75:50: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'short int'
75 | upd(dp[lx - 1][ly][rx][ry], cur + cnt);
| ~~~~~~~~~~~~~~~~~~~~~^
a.cc:16:15: note: initializing argument 1 of 'void ... |
s532141423 | p04009 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cassert>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
ty... | a.cc: In function 'int main()':
a.cc:68:47: error: no matching function for call to 'max(short int&, int)'
68 | dp[il-1][ir][jl][jr] = max(dp[il-1][ir][jl][jr], tmp + cnti(il,ir,jl,jr,il-1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
s371078858 | p04009 | C | #include <bits/stdc++.h>
using std::max;
char s[105];
int a[205][205],dp[105][105][105][105],ans,h,w,sx,sy;
int sh[105][105],sl[105][105];
#define ch(x,l,r) sh[x][r]-sh[x][l-1]
#define cl(x,l,r) sl[x][r]-sl[x][l-1]
#define m(x,y) x=max(x,y)
int main(){
scanf("%d%d",&h,&w);
for (int i=1;i<=h;i++) {
scanf("%s",s+1);
... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s942624095 | p04009 | C++ | #include<cstdio>
#include<iostream>
#include<cstring>
#define RG register
using namespace std;
const int N=101;
short n,m,x,y,ans,dp[N][N][N][N],sum[N][N];
char g[N][N];
template<typename I> inline void read(I &ot){
I ch=getchar(), x=0, f=1;
while(ch<'0' || ch>'9'){if(ch=='-') f=-1; ch=getchar(); }
while(ch>='0' && ... | a.cc: In function 'int main()':
a.cc:45:56: error: no matching function for call to 'mx(short int&, int)'
45 | if(i-1>=us) dp[i-1][j][k][l]=mx(dp[i-1][j][k][l],dp[i][j][k][l]+s(i-1,mx(li,j),i-1,mi(ri,l)));
| ~~^~~~~~~~~~~~~~~~~~~~~~~~... |
s413990945 | p04009 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
short line[103][103],list[103][103],f[103][103][103][103],n,m,op,sx,sy;
char s[103][103];
inline short min(short a,short b){
if(a<b) return a;
return b;
}
inline short max(short a,short b){
if(a>b) return a;
return b;
}... | a.cc: In function 'int main()':
a.cc:36:59: error: 'ans' was not declared in this scope; did you mean 'abs'?
36 | op=max(op,ans[i-1][j][k][p]);
| ^~~
| ... |
s182108003 | p04009 | C++ | #include <bits/stdc++.h>
#define y1 __zzd001
using namespace std;
const int N=105;
int n,m,ax,ay,bx,by;
char s[N][N];
short g[N][N],dp[N][N][N][N];
short Get(int x1,int y1,int x2,int y2){
return g[x2][y2]-g[x2][y1-1]-g[x1-1][y2]+g[x1-1][y1-1];
}
short max(short a,short b){
return a>b?a:b;
}
short DP(int x1,int y1,int... | a.cc: In function 'short int DP(int, int, int, int)':
a.cc:27:82: error: expected ')' before ';' token
27 | DP(x1+1,y1,x2,y2)+((xL==x1)?Get(x1,yL,x1,yR):0)));
| ^
| ... |
s689751534 | p04009 | C++ | #include<bits/stdc++.h>
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
using namespace std;
const int N=105;
char mp[N][N];
int n,m,ex,ey,ans;
int sr[N][N],sc[N][N];
int dp[N][N][N];
void mx(int &x,int y){
x<y?x=y:0;
}
int main(){
scanf("%d%d",&n,&m); CLR(dp,-1);
For(i,1,n) scanf("%s",mp[i]+1);
For(i,1,n) ... | a.cc: In function 'int main()':
a.cc:13:30: error: 'CLR' was not declared in this scope
13 | scanf("%d%d",&n,&m); CLR(dp,-1);
| ^~~
|
s350091572 | p04009 | C++ | /*+lmake
* STD = c++14
* DEFINE += WAAUTOMATON
*/
#include <bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#ifdef WAAUTOMATON
#define debug(args...) \
{ ... | a.cc: In function 'int query(int, int, int, int)':
a.cc:34:16: error: 'sum' was not declared in this scope
34 | return sum[x2][y2]-sum[x1-1][y2]-sum[x2][y1-1]+sum[x1-1][y1-1];
| ^~~
a.cc: In function 'int main()':
a.cc:50:40: error: expected ';' before '{' token
50 | ... |
s752101114 | p04009 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
using namespace std;
#define re return
#define in inline
#define inc(l, i, r) for(i=l; i<r; ++i)
const short mxn=1<<7;
short h, w, xe, ye, a[mxn][mxn], s[mxn][mxn], f[mxn][mxn][mxn][mxn]; char str[mxn];
in void upd(short& a, short b){a<b? a=b:... | cc1plus: error: '::main' must return 'int'
|
s188096505 | p04009 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
using namespace std;
#define re return
#define in inline
#define inc(l, i, r) for(i=l; i<r; ++i)
const int mxn=1<<7;
int h, w, xe, ye, a[mxn][mxn], s[mxn][mxn], f[mxn][mxn][mxn][mxn]; char str[mxn];
in void upd(int& a, int b){a<b? a=b: 0;}
in... | a.cc: In function 'int main()':
a.cc:26:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
26 | gets(str);
| ^~~~
| getw
|
s381940955 | p04009 | C++ | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define forE(i,x) for(int i=head[x];i!=-1;i=ne[i])
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned u32;
typedef pair<int,int> pin;
#define mk(a,b) make_pair(a,b)
#define lowbit(x) ((... | a.cc:8:9: error: 'pair' does not name a type
8 | typedef pair<int,int> pin;
| ^~~~
|
s270028567 | p04009 | C++ | Expand
Copy
#include<bits/stdc++.h>
#define N 105
using namespace std;
int n,m,x,y,f[N][N][N],g[N][N][N],r[N][N],c[N][N]; char st[N];
void maxself(int &x,int y){ x=max(x,y);}
int main()
{
int i,j,k,l;
scanf("%d %d\n",&n,&m);
for(i=1;i<=n;i++){
scanf("%s",st+1);
for(j=1;j<=m;j++){
c[j][i]=c[j][i-1],r[i][j]=r[... | a.cc:1:1: error: 'Expand' does not name a type
1 | Expand
| ^~~~~~
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:4:
/usr/include/c... |
s916252735 | p04009 | C++ | /*{{{*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#incl... | a.cc:112:12: error: redefinition of 'int ri()'
112 | inline int ri() {int x; scanf("%d", &x); return x;}
| ^~
a.cc:33:12: note: 'int ri()' previously defined here
33 | inline int ri() {int x; scanf("%d", &x); return x;}
| ^~
a.cc:120:33: error: redefinition of 'template<class T> b... |
s144705791 | p04009 | C++ | //start of jonathanirvings' template v3.0.3 (BETA)
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<LL> vl;
typedef vector<vl>... | a.cc: In function 'int main()':
a.cc:106:5: error: reference to 'data' is ambiguous
106 | data[i] = GetString();
| ^~~~
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/bits/stdc++.h:52,
... |
s975260248 | p04010 | C++ | #include <iostream>
#include <algorithm>
#include <cmath.h>
using namespace std;
#define int long long
void read(int &x) {
int r = 0, ne = 1;
char c;
while (c < '0' || c > '9') {
chtholly2317 if (c == '-')
ne = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
r ... | a.cc:3:10: fatal error: cmath.h: No such file or directory
3 | #include <cmath.h>
| ^~~~~~~~~
compilation terminated.
|
s037152291 | p04010 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
void read(int &x) {
int r = 0, ne = 1;
char c;
while (c < '0' || c > '9') {
chtholly2317 if (c == '-')
ne = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
r = r * 10 + c - '0';
c = get... | a.cc: In function 'void read(long long int&)':
a.cc:8:6: error: 'chtholly2317' was not declared in this scope
8 | chtholly2317 if (c == '-')
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:73:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
73 | for ... |
s474549955 | p04010 | C++ | //khodaya khodet komak kon
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vect... | a.cc: In function 'int32_t main()':
a.cc:109:51: error: no match for 'operator+=' (operand types are 'std::vector<std::pair<long long int, long long int> >' and 'long long int')
109 | if (i % 2 == 0) E += Ev[pth[i]], a[i] = Ev[pth[i]] - Od[pth[i]];
| ... |
s758452310 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
// #define int long long
void read(int &x)
{
int r = 0, ne = 1;
char c;
while (c < '0' || c > '9')
{
if (c == '-')
ne = -1;
c = getchar();
}
while (c >= '0' && c <= '9')
{
r = r * 10 + c - '0';
c = getch... | a.cc: In function 'int main()':
a.cc:74:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
74 | for(register int i=0;i<m;++i){
| ^
a.cc:108:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
108 | for(register ... |
s947791743 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
void read(int &x)
{
int r = 0, ne = 1;
char c;
while (c < '0' || c > '9')
{
if (c == '-')
ne = -1;
c = getchar();
}
while (c >= '0' && c <= '9')
{
r = r * 10 + c - '0';
c = getchar(... | a.cc: In function 'int main()':
a.cc:74:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
74 | for(register int i=0;i<m;++i){
| ^
a.cc:106:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
106 | for(register ... |
s643472058 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
void read(int &x)
{
int r = 0, ne = 1;
char c;
while (c < '0' || c > '9')
{
if (c == '-')
ne = -1;
c = getchar();
}
while (c >= '0' && c <= '9')
{
r = r * 10 + c - '0';
c = getchar(... | a.cc: In function 'int main()':
a.cc:72:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
72 | for(register int i=0;i<m;++i){
| ^
a.cc:104:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
104 | for(register ... |
s675338139 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
void read(int &x)
{
int r = 0, ne = 1;
char c;
while (c < '0' || c > '9')
{
if (c == '-')
ne = -1;
c = getchar();
}
while (c >= '0' && c <= '9')
{
r = r * 10 + c - '0';
c = getchar(... | a.cc: In function 'void dfs(long long int, long long int)':
a.cc:49:50: error: 'o' was not declared in this scope
49 | for(int i=h[x];i!=0;i=e[i].nxt){ if(w[o]){
| ^
a.cc:57:10: error: '\U00007eff\U00008272' was not declared in this scope
57 | ... |
s869177399 | p04010 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define D(a) cerr << #a << " = " << a << endl
#else
#define D(a)
#define cerr false && cerr
#endif
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n)... | a.cc: In function 'int main()':
a.cc:109:5: error: 'g' was not declared in this scope
109 | g
| ^
a.cc:133:2: error: expected '}' at end of input
133 | }
| ^
a.cc:81:12: note: to match this '{'
81 | int main() {
| ^
|
s032772688 | p04010 | C++ | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef pair <int, int> pii;
#define V first
#define U second
#define ID second
const int N = 1e5 + 5;
int n, m;
int deep[N];
int token[N];
int capa[N];
pii edge[N];
bool in_cycle[N];
bool mark[N];
int id_e = -1;
vector <int> path;
vector... | a.cc: In function 'int main()':
a.cc:100:9: error: 'memset' was not declared in this scope
100 | memset(mark, 0, sizeof mark);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |+#include <c... |
s796965552 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
inline int gi()
{
char c=getchar(); int x=0;
for(;c<'0'||c>'9';c=getchar());
for(;c>='0'&&c<='9';c=getchar())x=(x<<1)+(x<<3)+c-'0';
return x;
}
const int N=1e5+5;
vector<int> e[N];
int col[N],f[N],s[N],ban[N],n,m,cu,cv;
void dfs1(int u, int fa)
{
for(auto v:e[u]) if(v!=... | a.cc: In function 'int main()':
a.cc:40:38: error: continue statement not within a loop
40 | if(n&1) {puts("-1"); continue;}
| ^~~~~~~~
a.cc:45:47: error: continue statement not within a loop
45 | if(f[1]) {puts("-1"); continue;}
... |
s260715910 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
inline int gi()
{
char c=getchar(); int x=0;
for(;c<'0'||c>'9';c=getchar());
for(;c>='0'&&c<='9';c=getchar())x=(x<<1)+(x<<3)+c-'0';
return x;
}
const int N=1e5+5;
vector<int> e[N];
int col[N],f[N],ban[N],n,m,cu,cv;
void dfs1(int u, int fa)
{
for(auto v:e[u]) if(v!=fa&&b... | a.cc: In function 'int main()':
a.cc:40:38: error: continue statement not within a loop
40 | if(n&1) {puts("-1"); continue;}
| ^~~~~~~~
a.cc:44:47: error: continue statement not within a loop
44 | if(f[1]) {puts("-1"); continue;}
... |
s821763803 | p04010 | C++ | #include<cstdio>
using namespace std;
const int N=1e5+5;
struct Link{int to,nxt;}l[N<<1];
int n,m,a[N],head[N],tot=1;
int fa[N],edge,rt;
inline int read(){
int s=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9') f=ch=='-'?-1:f,ch=getchar();
while(ch>='0'&&ch<='9') s=(s<<1)+(s<<3)+(ch^48),ch=getchar();
return s*f;
}
in... | a.cc: In function 'void dfs(int, int, int)':
a.cc:25:20: error: too few arguments to function 'void dfs(int, int, int)'
25 | dfs(y,x);a[x]+=a[y];
| ~~~^~~~~
a.cc:20:6: note: declared here
20 | void dfs(int x,int fa,int opt){
| ^~~
a.cc: In function 'void get_roof(i... |
s392630612 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define I int
#define GG(x) if(x)printf("-1\n"),exit(0);
const I N=1e6+5;struct G{I o,r;}e[N];I h[N],w=1;E(I x,I y){e[w]=(G){y,h[x]};h[x]=w++;}I S[N],d[N],K[N],V[N],X,Y,L,T=0,Q[N],P;ll A=0;D(I u,I f){V[u]=((d[u]&1)?1:-1);P+=V[u];for(I i=h[u];i;i=e[i].r){... | a.cc:6:49: error: ISO C++ forbids declaration of 'E' with no type [-fpermissive]
6 | const I N=1e6+5;struct G{I o,r;}e[N];I h[N],w=1;E(I x,I y){e[w]=(G){y,h[x]};h[x]=w++;}I S[N],d[N],K[N],V[N],X,Y,L,T=0,Q[N],P;ll A=0;D(I u,I f){V[u]=((d[u]&1)?1:-1);P+=V[u];for(I i=h[u];i;i=e[i].r){I v=e[i].o;if(v^f)d[v]?(X=u,Y=v,L=... |
s779266336 | p04010 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;
int h[100011];
int d[100011];
int can[100011];
vector<int>tab[100011];
ll ans=0;
int maxHNode=0;
int maxH=0;
void dfs1(int now,int fa)
{
h[now]=0;
int sz=tab[now].size();
int mx=0,lmx=... | a.cc:11:1: error: 'vector' does not name a type
11 | vector<int>tab[100011];
| ^~~~~~
a.cc: In function 'void dfs1(int, int)':
a.cc:18:16: error: 'tab' was not declared in this scope; did you mean 'tan'?
18 | int sz=tab[now].size();
| ^~~
| tan
a.cc: In func... |
s884865917 | p04010 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;
#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define FILE(s) freopen(s"in", "r", std... | a.cc: In function 'll Dfs(int, int, int)':
a.cc:52:24: error: 'Dfs1' was not declared in this scope; did you mean 'Dfs'?
52 | res += Dfs1(u, x, -d), col[x] += col[u];
| ^~~~
| Dfs
|
s787564154 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memse... | a.cc: In function 'int main()':
a.cc:84:15: error: 'cirlce' was not declared in this scope; did you mean 'circle'?
84 | a=cirlce[0],b=cirlce[1];
| ^~~~~~
| circle
|
s897502590 | p04010 | C++ | #include <bits/stdc++.h>
const int N = 1e5 + 54;
int n, m;
namespace Tree {
struct node { int u, v; } edge[N << 1];
int head[N], v[N], col[N], cnt;
long long sum, ans;
inline void add(int x, int y) { edge[cnt].u = head[x], edge[cnt].v = y, head[x] = cnt++; }
void dfs(int x, int fa) {
int i;
for (i = head[x]; ~... | a.cc: In function 'void BRT::SOLVE()':
a.cc:104:17: error: 'll' was not declared in this scope
104 | ll mid = p[(tot + 1) >> 1];
| ^~
a.cc:105:62: error: 'mid' was not declared in this scope
105 | for (i = 1; i <= tot; ++i) ans += abs(v[i] - mid);
| ... |
s009361291 | p04010 | C++ | //minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
template<class T>inline bool cm... | a.cc:12:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
12 | inline void add(R int u,R int v){e[++tot]={v,head[u]},head[u]=tot;}
| ^
a.cc:12:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
12 | inline void add(... |
s965225195 | p04010 | C++ | //minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
template<class T>inline bool cm... | a.cc:12:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
12 | inline void add(R int u,R int v){e[++tot]={v,head[u]},head[u]=tot;}
| ^
a.cc:12:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
12 | inline void add(... |
s798319673 | p04010 | C++ | #include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
const int MAX_N = 1e5 + 5;
int n, m;
vector <int> G[MAX_N];
bool dfsTree (int v = 0, int p = 0) {
int size = 1;
}
int main() {
ios::sync_with_stdio(false), cin.tie(0);
cin >> n >> m;
for (int i = 0; i < m; i++) {
... | a.cc: In function 'bool dfsTree(int, int)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
13 | }
| ^
a.cc: In function 'int main()':
a.cc:30:9: error: 'assert' was not declared in this scope
30 | assert(false);
| ^~~~~~
a.cc:5:1: note: 'assert' ... |
s769518547 | p04010 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#define rep(i,l,r) for(int i=(l);i<=(r);++i)
#define per(i,r,l) for(int i=(r);i>=(l);--i)
#define pb push_back
using namespace std;
const int ... | a.cc:17:21: error: 'll' does not name a type
17 | vector<int> G[maxn];ll ans;
| ^~
a.cc: In function 'int main()':
a.cc:38:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
38 | rep(i,1,n) ans+=abs(f[i]);
| ^~~
| ... |
s376274319 | p04010 | C++ | #include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef d... | a.cc:150:44: error: stray '#' in program
150 | for(int k = 0 ; k <= 1 ; ++k) {#include <bits/stdc++.h>
| ^
a.cc:330:2: error: stray '#' in program
330 | }#include <bits/stdc++.h>
| ^
a.cc: In function 'void Solve()':
a.cc:150:45: error: 'include' w... |
s516010929 | p04010 | C++ | #include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef d... | a.cc: In function 'void Solve()':
a.cc:177:36: error: unable to find numeric literal operator 'operator""LL'
177 | for(int64 i = 1 ; i <= 1e18LL ; ++i) a <<= 1LL;
| ^~~~~~
|
s852257402 | p04010 | C++ | #include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
typedef long long ll;
const int maxn=100000+10;
int h[maxn],go[maxn*2],nxt[maxn*2],fa[maxn],co[maxn],kk[maxn],bb[maxn],sta[maxn];
vector<int>G[maxn];
bool bz[maxn];
int i,j,k,l,t,n,m,u,v,a,b,x... | a.cc: In function 'void travel(int, int)':
a.cc:30:15: error: 'xx' was not declared in this scope; did you mean 'x'?
30 | go[t]=xx;
| ^~
| x
a.cc: In function 'void dfs(int, int)':
a.cc:47:15: error: 'xx' was not declared in this scope; did you mean 'x'?
47 | ... |
s283869115 | p04010 | C++ | #include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#define DCSB {printf("-1");exit(0);}
using namespace std;
vector<int>G[100010];
struct edge{
int v,next;
}a[500001];
int n,m,u,v,ans=0,els,huanu,huanv,tot=0,q[500001],head[500001],fa[500001],dep[500001],f[500001];
void add(int... | a.cc:8:1: error: 'vector' does not name a type
8 | vector<int>G[100010];
| ^~~~~~
a.cc: In function 'void dfs(int, int, int)':
a.cc:22:24: error: 'G' was not declared in this scope
22 | for(int i=0;i<(int)G[u].size();i++){
| ^
a.cc: In function 'int main()':
a.cc:69:9: erro... |
s084995274 | p04010 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=100005;
int N,M;
vector<int> adj[MAXN];
int dep[MAXN],sum[MAXN],k[MAXN];
bool vis[MAXN];
int cU,cV,clen;
vector<int> num;
void dfs(int u,int fa=0)
{
vis[u]=true;
for(auto v:adj[u])
{
if(v==fa)
continue;
if(vis[v])
{... | a.cc:8:1: error: 'vector' does not name a type
8 | vector<int> adj[MAXN];
| ^~~~~~
a.cc:12:1: error: 'vector' does not name a type
12 | vector<int> num;
| ^~~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:17:20: error: 'adj' was not declared in this scope
17 | for(auto v:adj[u])
| ... |
s754350595 | p04010 | C++ | #include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<ctime>
#define cmin(a,b) (a>(b)?a=(b),1:0)
#define cmax(a,b) (a<(b)?a=(b),1:0)
#define dmin(a,b) ((a)<(b)?(a):(b))
#define dmax(a,b) ((a)>(b)?(a):(b))
namespace io
{
int F()
{
int n=0,F=1;
char ch;
... | a.cc: In function 'void dfs(int, int)':
a.cc:45:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
45 | for(register int p=e[o].next;p;p=e[p].next)
| ^
a.cc: In function 'void dfs2(int, int)':
a.cc:62:26: warning: ISO C++17 does not allow 'reg... |
s523514812 | p04010 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
struct Edge {
int v, n;
} e[MAXN << 1];
int G[MAXN], edgeCnt;
void _add_edge(int u, int v)
{
e[++edgeCnt].n = G[u];
G[u] = edgeCnt;
e[edgeCnt].v = v;
}
void add_edge(int u, int v)
{
_add_edge(u, v);
_add_edge(v, u);... | a.cc: In function 'void dfs1(int, int)':
a.cc:36:5: error: reference to 'size' is ambiguous
36 | size[u] = f[u] ? -1 : 1;
| ^~~~
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/bits/stdc... |
s586762747 | p04010 | C++ | #include <bits/stdc++.h>
#define F(i,j,k) for(int i=(j);i<=(k);++i)
using namespace std;
const int N=100005;
struct V{int head;}v[N];
struct E{int u,v,next;}e[N*2];
int n,m,ecnt=1,degree[N];
inline void add(int x,int y){
e[++ecnt].u=x,e[ecnt].v=y;
e[ecnt].next=v[x].head,v[x].head=ecnt;
e[++ecnt].u=y,e[ecnt].v=x;
e[... | a.cc: In function 'void dfs(int, int, int)':
a.cc:19:9: error: reference to 'size' is ambiguous
19 | size[x]+=fl,vis[x]=1;
| ^~~~
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/... |
s164445449 | p04010 | C++ | #include<iostream>
#include<cstring>
#include<cstdio>
#define MN 100000
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,m,head[MN+5],cnt=1,ans=0,f[MN+5],g[M... | a.cc: In function 'int main()':
a.cc:77:13: error: 'sort' was not declared in this scope; did you mean 'short'?
77 | sort(q+1,q+top+1);
| ^~~~
| short
|
s158034552 | p04010 | C++ | // +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+ \\
#include <bits/stdc++.h>
#define F first
#define S second
#define _sz(x) (int)x.size()
using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;
int const N = 1e5 + 20 ;
int n , m ;
ve... | a.cc:132:11: error: redefinition of 'const int N'
132 | int const N = 1e5 + 20 ;
| ^
a.cc:14:11: note: 'const int N' previously defined here
14 | int const N = 1e5 + 20 ;
| ^
a.cc:133:5: error: redefinition of 'int n'
133 | int n , m ;
| ^
a.cc:15:5: note: 'int n' previo... |
s306369395 | p04010 | C++ | // +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+ \\
#include <bits/stdc++.h>
#define F first
#define S second
#define _sz(x) (int)x.size()
using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;
int const N = 1e5 + 20 ;
int n , m ;
vector... | a.cc: In function 'int main()':
a.cc:113:23: error: 'x' was not declared in this scope
113 | ans = x ;
| ^
a.cc:117:17: error: expected primary-expression before 'int'
117 | int x = vec[(n - 1) / 2] ;
| ^~~
|
s223535972 | p04010 | C++ | // Namori
// * frank_c1
// * 2017 / 12 / 18
#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)(1e5) + 5;
vector<int> nxt[maxn];
int fa[maxn], dfn[maxn], siz[maxn], su[maxn];
int ci[maxn], cc[maxn], va[maxn];
int cnt, idx;
inline int iabs(int x) {
return x >= 0 ? x : -x;
}
void dfs(int x, int f, ... | a.cc: In function 'int main()':
a.cc:47:41: error: return-statement with no value, in function returning 'int' [-fpermissive]
47 | printf("-1\n"); return;
| ^~~~~~
a.cc:51:41: error: return-statement with no value, in function returning 'int' [-fp... |
s270744947 | p04010 | C++ | // Namori
// * frank_c1
// * 2017 / 12 / 18
#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)(1e5) + 5;
vector<int> nxt[maxn];
int fa[maxn], dfn[maxn], siz[maxn];
int cnt;
void dfs(int x, int f) {
fa[x] = f; siz[x] = 1; dfn[x] = ++idx;
for (int i = 0; i < (int)nxt[x].size(); ++i)
if (nxt[x][i... | a.cc: In function 'void dfs(int, int)':
a.cc:14:43: error: 'idx' was not declared in this scope
14 | fa[x] = f; siz[x] = 1; dfn[x] = ++idx;
| ^~~
|
s140077807 | p04010 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int n,m,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 c1[N],c2[N];ll dp[N];
void dfs(int x,int h,int fa){
(h&1?c1[x]:c2[x])=1;
for (int i=head[x];i;i=next[i])
... | a.cc: In function 'void add(int, int)':
a.cc:9:9: error: reference to 'next' is ambiguous
9 | 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/... |
s356701935 | p04010 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
using namespace std;
typedef long long LL;
const int N=2e5;
int gi() {
int w=0;bool q=1;char c=getchar();
while ((c<'... | a.cc: In function 'int dfs(int)':
a.cc:29:32: error: reference to 'next' is ambiguous
29 | for (int i=head[k];i;i=next[i])
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from... |
s846741793 | p04010 | C++ | #include <bits/stdc++.h>
using namespace std;
const int Maxn=1e5+10;
struct EDGE{int x,y,next;}edge[Maxn*2]; int len,first[Maxn];
void ins(int x,int y){len++; edge[len].x=x; edge[len].y=y; edge[len].next=first[x]; first[x]=len;}
int N,M; int C[Maxn];
int u,v,opt; bool vis[Maxn];
void Find_Cir(int x,int fa,int col)
{
... | a.cc: In function 'int main()':
a.cc:46:3: error: expected ',' or ';' before 'while'
46 | while(Tcase--)
| ^~~~~
|
s441988981 | p04010 | C++ | #include<set>
#include<map>
#include<deque>
#include<queue>
#include<stack>
#include<cmath>
#include<ctime>
#include<bitset>
#include<string>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<complex>
#include<iostream>
#include<algorithm>
#define ll long long
#define inf ... | a.cc: In function 'int main()':
a.cc:116:62: error: continue statement not within a loop
116 | if(num[0]!=num[1]) { printf("-1\n"); continue; }
| ^~~~~~~~
a.cc:128:78: error: continue statement not within a loop
128 | ... |
s572809305 | p04010 | C++ | /+ dub.sdl:
name "A"
dependency "dcomp" version=">=0.4.0"
+/
import std.stdio, std.algorithm, std.conv, std.range;
import std.typecons, std.math;
// import dcomp.scanner, dcomp.graph.namori;
alias E = Tuple!(int, "to");
long solve(E[][] g) {
int n = g.length.to!int;
if (n % 2) return 10L^^18;
in... | a.cc:41:17: error: too many decimal points in number
41 | foreach (i; 0..m) {
| ^~~~
a.cc:82:21: error: too many decimal points in number
82 | foreach (i; 0..n) {
| ^~~~
a.cc:112:21: error: too many decimal points in number
112 | foreach (i; 0.... |
s538307757 | p04010 | C++ | #define DEB
#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
using namespace std;
#ifdef DEB
#define d... | a.cc: In function 'pi dfs(int, int)':
a.cc:57:5: error: 'cost' was not declared in this scope; did you mean 'cosl'?
57 | cost+=nxt.fr;
| ^~~~
| cosl
a.cc:58:5: error: 'sign' was not declared in this scope; did you mean 'sin'?
58 | sign^=nxt.sc;
| ^~~~
| sin
a.cc:60:... |
s116212536 | p04010 | C++ | #include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef ... | a.cc: In function 'int main()':
a.cc:152:23: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}]' for array subscript
152 | res -= abs[pos[i]] - abs(pos[i] - num);
| ... |
s814996789 | p04010 | C++ | #include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef pa... | a.cc: In function 'int main()':
a.cc:154:18: error: request for member 'size' in 'zero', which is of non-class type 'int'
154 | if (zero.size() > all.size()) {
| ^~~~
a.cc:158:37: error: request for member 'size' in 'zero', which is of non-class type 'int'
158 | int idx = all.... |
s862768919 | p04010 | C++ | #include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int inf = 1e9+7;
int n, m, f[N][2];
vector<int> g[N];
void dfs(int v, int pr = -1) {
f[v][0] = 0;
f[v][1] = inf;
for (auto& to : g[v]) {
if (to == pr) continue;
dfs(to, v);
int b[2] = {f[v][0], f[v][1]};
... | a.cc:23:1: error: expected declaration before '}' token
23 | }
| ^
|
s677081015 | p04010 | C++ | #include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<cstring>
... | a.cc: In function 'int main()':
a.cc:141:22: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
141 | else cout<n-1<<endl;
| ~~~^~~~~~
|
s157104958 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,K,X,Y;
cin >> N >> K >> X >> Y;
if(N<K){
cout << X*K << endl;
}
else {cout << X*K+(N-K)*Y << endl;
} | a.cc: In function 'int main()':
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s032547616 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N >> K >> X >> Y;
if(N<K){
cout << X*K << endl;
}
else {cout << X*K+(N-K)*Y << endl;
} | a.cc: In function 'int main()':
a.cc:6:14: error: 'K' was not declared in this scope
6 | cin >> N >> K >> X >> Y;
| ^
a.cc:6:19: error: 'X' was not declared in this scope
6 | cin >> N >> K >> X >> Y;
| ^
a.cc:6:24: error: 'Y' was not declared in this scope
6 | c... |
s405245652 | p04011 | C | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,k,x,y,c=0;
cin >> n >> k >> x >> y;
c = k * x + (n - k) * y;
cout << c;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s593820103 | p04011 | C++ | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#... | a.cc: In function 'int main()':
a.cc:29:32: error: no matching function for call to 'max(int, ll)'
29 | cout << min(N, K) * X + max(0, N - K) * Y << endl;
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/usr/include/c++/14/bi... |
s694055406 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,k,x,y;
cin >> n >> k >> x >> y;
if(n<=k) cout << n*x;
else cout << k*x + (n-k)*y;
return;
} | a.cc: In function 'int main()':
a.cc:9:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
9 | return;
| ^~~~~~
|
s775732807 | p04011 | C++ | #include <iostream>
#include <string.h>
using namespace std;
string c;
int ara[26] = {},j;
cin>>c;
int len = c.size();
for(int i = 0; i< len; i++)
{
//j = 0;
//j = c[i] - 'a';
ara[c[i]]++;
}
// cout<<ara[j]<<endl;
bool ok = true;
for(int j = 0; j<26; j++)
... | a.cc:7:5: error: 'cin' does not name a type
7 | cin>>c;
| ^~~
a.cc:9:5: error: expected unqualified-id before 'for'
9 | for(int i = 0; i< len; i++)
| ^~~
a.cc:9:20: error: 'i' does not name a type
9 | for(int i = 0; i< len; i++)
| ^
a.cc:9:28: error: ... |
s962817328 | p04011 | C++ | else if(a==5&&b==5&&c==7) cout << YES;
| a.cc:1:1: error: expected unqualified-id before 'else'
1 | else if(a==5&&b==5&&c==7) cout << YES;
| ^~~~
|
s475477921 | p04011 | Java | public class Abc_044 {
public static void main(String args[]) {
int N=5;
int K=3;
int X=10000;
int Y=9000;
int yen;
yen= K*X+(N-K)*Y;
System.out.println(yen);
}
} | Main.java:1: error: class Abc_044 is public, should be declared in a file named Abc_044.java
public class Abc_044 {
^
1 error
|
s349449876 | p04011 | Java | public class Abc_044 {
public static void main(String args[]) {
int N;
int K;
int X;
int Y;
int yen;
yen= K*X+(N-K)*Y;
System.out.println(yen);
}
} | Main.java:1: error: class Abc_044 is public, should be declared in a file named Abc_044.java
public class Abc_044 {
^
1 error
|
s854259678 | p04011 | C | #include <stdio.h>
int main(void){
int N,K,X,Y,total;
scanf("%d%d%d%d",&N,&K,&X,&Y);
total=(K*X)+(N-K)*Y;
printf("%d\n",total)
return 0;
}
| main.c: In function 'main':
main.c:9:29: error: expected ';' before 'return'
9 | printf("%d\n",total)
| ^
| ;
10 | return 0;
| ~~~~~~
|
s257451052 | p04011 | C | #include <stdio.h>
int main(void){
int N,K,X,Y,total;
scanf("%d%d%d%d",&N,&K,&X,%Y);
total=(K*X)+(N-K)*Y;
printf("%d\n",total)
return 0;
} | main.c: In function 'main':
main.c:6:35: error: expected expression before '%' token
6 | scanf("%d%d%d%d",&N,&K,&X,%Y);
| ^
main.c:9:29: error: expected ';' before 'return'
9 | printf("%d\n",total)
| ^
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.