submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s297158111
p04048
Java
vimport java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { static PrintWriter out; static InputReader ir; static boolean debug = false; static void solve() { ...
Main.java:1: error: class, interface, enum, or record expected vimport java.io.IOException; ^ Main.java:2: error: class, interface, enum, or record expected import java.io.InputStream; ^ Main.java:3: error: class, interface, enum, or record expected import java.io.PrintWriter; ^ Main.java:4: error: class, interface, en...
s643726217
p04048
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long int n = sc.nextInt(); n++; long int x = sc.nextInt(); //1:point 0:not point long int field[][] = new int[n][2*n-1]; for(long int i=0; i<n; i++){ for(long int j=0; j<2*n-1; j++){ ...
Main.java:5: error: not a statement long int n = sc.nextInt(); ^ Main.java:5: error: ';' expected long int n = sc.nextInt(); ^ Main.java:7: error: not a statement long int x = sc.nextInt(); ^ Main.java:7: error: ';' expected long int x = sc.nextInt(); ^ Main.java:9: error: not a statement long...
s532517104
p04048
C++
#include<bits/stdc++.h> using namespace std; #define int long long int n, x, t; int32_t main(){ scanf("%lld %lld", &n, &x); t = 3*(n-1); if(t&1) return !printf(t); printf("%lld", t-3*(min(x, n-x)-1)); }
a.cc: In function 'int32_t main()': a.cc:8:28: error: invalid conversion from 'long long int' to 'const char*' [-fpermissive] 8 | if(t&1) return !printf(t); | ^ | | | long long int In file included from /usr/inclu...
s451435321
p04048
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a[100],b=0; cin>>a[0]>>a[1]; int i=1 for(;;i++){ a[i+1]=a[i-1]%a[i]; if(a[i]<a[i+1])swap(a[i],a[i+1]); if(a[i+1]==0) break; } for(int j=1;j<i;j+=2) b+=a[j]; cout<<b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: expected ',' or ';' before 'for' 7 | for(;;i++){ | ^~~ a.cc:7:14: error: expected ';' before ')' token 7 | for(;;i++){ | ^ | ;
s098648558
p04048
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,x; inline ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); } int main() { cin>>n>>x; cout<<3*(n-gcd(n,x)); return 0; } #include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,x; inline ll gcd(ll a,ll b) { return b==...
a.cc:18:4: error: redefinition of 'll n' 18 | ll n,x; | ^ a.cc:4:4: note: 'll n' previously declared here 4 | ll n,x; | ^ a.cc:18:6: error: redefinition of 'll x' 18 | ll n,x; | ^ a.cc:4:6: note: 'll x' previously declared here 4 | ll n,x; | ^ a.cc:19:11: error: red...
s895623471
p04048
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,x; inline ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); } int main() { cin>>n>>x; cout<<3*(n-gcd(n,x)); return 0; } #include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,x; inline ll gcd(ll a,ll b) { return b==...
a.cc:18:4: error: redefinition of 'll n' 18 | ll n,x; | ^ a.cc:4:4: note: 'll n' previously declared here 4 | ll n,x; | ^ a.cc:18:6: error: redefinition of 'll x' 18 | ll n,x; | ^ a.cc:4:6: note: 'll x' previously declared here 4 | ll n,x; | ^ a.cc:19:11: error: red...
s355071731
p04048
C++
#include <iostream> using namespace std; int gcd(LLI a,LLI b){ if(a==0||b==0) return a+b; else if(a>=b) return gcd(a%b,b); else return gcd(a,b%a); } int main(){ LLI n,x; cin>>n>>x; cout<<3*(n-gcd(n,x)); }
a.cc:3:9: error: 'LLI' was not declared in this scope 3 | int gcd(LLI a,LLI b){ | ^~~ a.cc:3:15: error: 'LLI' was not declared in this scope 3 | int gcd(LLI a,LLI b){ | ^~~ a.cc:3:20: error: expression list treated as compound expression in initializer [-fpermissive] 3 | in...
s683952697
p04048
C++
#include<stdio.h> #include<algorithm> long n,m,a; main(){ scanf("%ld%ld",&n,&m); a=3*(n-std::__gcd(n,m); printf("%ld",a); }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:27: error: expected ')' before ';' token 8 | a=3*(n-std::__gcd(n,m); | ~ ^ | )
s488825638
p04048
C++
#include<stdio.h> #include<algorithm> long n,m,a; main(){ scanf("%ld%ld",&n,&m); a=3*(n-std::__gcd(n,m); printf("%ld",a); }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:27: error: expected ')' before ';' token 8 | a=3*(n-std::__gcd(n,m); | ~ ^ | )
s626955073
p04048
C++
#include<bits/stdc++.h> long n,m;main(){std::cin>>n>>m;std::cout<<3*(n-__gcd(n,m));}
a.cc:2:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | long n,m;main(){std::cin>>n>>m;std::cout<<3*(n-__gcd(n,m));} | ^~~~ a.cc: In function 'int main()': a.cc:2:48: error: '__gcd' was not declared in this scope 2 | long n,m;main(){std::cin>>n>>m;std::cout<<3*(...
s533036074
p04048
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; long long n = 0, length = 0; void Go_Ray(long long rayActual, long long rayPasado) { if (rayActual == rayPasado) { length += rayActual; return; } if (rayPasado < rayActual) { length += (2 * rayPasado); G...
a.cc: In function 'int main()': a.cc:36:14: error: expected '}' at end of input 36 | return 0; | ^ a.cc:28:1: note: to match this '{' 28 | { | ^
s137262786
p04048
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = (a), i##_end_ = (b); i <= i##_end_; ++i) #define clear(a, b) memset((a), (b), sizeof(a)) typedef long long LL; LL n, x; LL f(LL a, LL b) { if(a > b) swap(a, b); if(a == 1) return b * 2 - 1; return 1ll * f(b - a, a) + 2 * a; } LL ans; int m...
a.cc: In function 'int main()': a.cc:15:30: error: expected ';' before 'printf' 15 | ans = n + f(x, n - x) | ^ | ; 16 | printf("%lld\n", ans); | ~~~~~~
s891643852
p04048
C++
#include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { #ifdef HOME freopen("agc1b.in", "r", stdin); freopen("agc1b.out", "w", stdout); #endif ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); i64 sum(0); int a, b; cin >> a >> b; a = a - b; sum = a + b; while (a && b) { if ...
a.cc: In function 'int main()': a.cc:24:43: error: 'l' was not declared in this scope 24 | sum+= b / a * a * l, b%= a; } | ^
s687226338
p04048
C++
#include "bits/stdc++.h" #define int long long #define range(i, a, b) for(int i = a; i < b; i++) #define rep(i, a) range(i, 0, a) #define all(a) (a).begin(),(a).end() using namespace std; const int MOD = 1e9 + 7, INF = 1e9; using vi = vector <int>; using vvi = vector <vi>; //g++ -std==c++14 signed main(){ int n, x; ...
a.cc: In function 'int main()': a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:12:14: note: to match this '{' 12 | signed main(){ | ^
s495543192
p04048
C++
#include "bits/stdc++.h" #define int long long #define range(i, a, b) for(int i = a; i < b; i++) #define rep(i, a) range(i, 0, a) #define all(a) (a).begin(),(a).end() using namespace std; const int MOD = 1e9 + 7, INF = 1e9; using vi = vector <int>; using vvi = vector <vi>; //g++ -std==c++14 signed main(){ int n, x; ...
a.cc: In function 'int main()': a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:12:14: note: to match this '{' 12 | signed main(){ | ^
s440481416
p04048
C++
#include <iostream> using namespace std; int main(){ int n,x,s=0; cin >>n; cin >>x; while(x!=0){ s+=x; if( x>n-x) { int a=x; x=t-x; t=a; } else { x=t-x; } cout <<s; } }
a.cc: In function 'int main()': a.cc:13:27: error: 't' was not declared in this scope 13 | x=t-x; | ^ a.cc:18:27: error: 't' was not declared in this scope 18 | x=t-x; | ^
s387961476
p04048
C++
#include <iostream> using namesspace std; int main(){ int n,x,s=0; cin >>n; cin >>x; while(x!=0){ s+=x; if( x>n-x) { int a=x; x=t-x; t=a; } else { x=t-x; } cout <<s; } }
a.cc:2:7: error: expected nested-name-specifier before 'namesspace' 2 | using namesspace std; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >>n; | ^~~ | std::cin In file include...
s338211058
p04048
C++
#include <bits/stdc++.h> long long n, x; int main() { scanf("%lld%lld", &n, &x); printf("%lld\n", 3 * (n - __gcd(n, x))); return 0; }
a.cc: In function 'int main()': a.cc:7:29: error: '__gcd' was not declared in this scope 7 | printf("%lld\n", 3 * (n - __gcd(n, x))); | ^~~~~ a.cc:7:29: note: suggested alternatives: In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64...
s400184207
p04048
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 'long long int dfs(long long int, long long int)': a.cc:29:21: error: no matching function for call to 'get(long long int&, long long int)' 29 | ll res = get(a, b % a) + (a + a) * (b / a); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:6...
s467629674
p04048
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 'long long int dfs(long long int, long long int)': a.cc:29:21: error: no matching function for call to 'get(long long int&, long long int)' 29 | ll res = get(a, b % a) + (a + a) * (b / a); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:6...
s787945613
p04048
C++
#include<bits/stdc++.h> #define int long long using namespace std; signed main(){ int a,b;cin>>a>>b; cout<<3*(a-_gcd(a,b))<<endl; }
a.cc: In function 'int main()': a.cc:7:12: error: '_gcd' was not declared in this scope 7 | cout<<3*(a-_gcd(a,b))<<endl; | ^~~~
s084986561
p04048
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,x) for(int i=0;i<x;++i) int calc(int a, int b) { if (a < b) swap(a, b); if (a == b) return a; return 2 * b + calc(b, a - b); } int main() { int N, X; cin >> N >> X; cout << N + calc(X, N - X) << endl; }
cc1plus: error: '::main' must return 'int'
s143266882
p04048
Java
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.Scanner; public class Main { private enum Direction { FLT, ASC, DSC } private static class Vertex { static AtomicLong counter = new AtomicLong(0); fi...
Main.java:4: error: cannot find symbol import java.util.concurrent.Scanner; ^ symbol: class Scanner location: package java.util.concurrent Main.java:164: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:164...
s641512046
p04048
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cstdio> #include <queue> #include "math.h" #include <complex> #include <iomanip> #define ifor(i,a,b) for (int i=(a);i<(b);i++) #define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--) #define rep(i,n) for (int i=0;i<(n);i++) #define rrep(i,n...
a.cc: In function 'int main()': a.cc:28:18: error: expression cannot be used as a function 28 | cout << 3(N-gcd(N,X))<<endl; | ~^~~~~~~~~~~~
s742212888
p04048
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cstdio> #include <queue> #include "math.h" #include <complex> #include <iomanip> #define ifor(i,a,b) for (int i=(a);i<(b);i++) #define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--) #define rep(i,n) for (int i=0;i<(n);i++) #define rrep(i,n...
a.cc: In function 'int main()': a.cc:28:18: error: expression cannot be used as a function 28 | cout << 3(N-gcd(N,X))<<endl; | ~^~~~~~~~~~~~
s778307210
p04048
C++
#include<stdio.h> int main(){ long long n, k; scanf("%lld %lld", &n, &k); long long r=n%k; long long res=n; while(r>0){ res+=(n/k-1)*k n=k;k=r;r=n%k; } res+=(k-1)*2+1; printf("%lld", res); }
a.cc: In function 'int main()': a.cc:8:16: error: expected ';' before 'n' 8 | res+=(n/k-1)*k | ^ | ; 9 | n=k;k=r;r=n%k; | ~
s930046833
p04048
C++
#include <iostream> using namespace std; int main() {
a.cc: In function 'int main()': a.cc:4:2: error: expected '}' at end of input 4 | { | ~^
s492967325
p04048
C++
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996) #include <iostream> #include <algorithm> #include <vector> #include <string> #include <functional> #include <sstream> #include <cmath> using namespace std; #define rep(i,a,b) for(int i=(a);i<(b);i++) #define pb push_back #define mp(a,b) make_pair(a,b) #...
a.cc: In function 'int main()': a.cc:34:9: error: 'retur' was not declared in this scope 34 | retur | ^~~~~ a.cc:34:14: error: expected '}' at end of input 34 | retur | ^ a.cc:28:1: note: to match this '{' 28 | { | ^
s346632065
p04048
C
#include<stdio.h> int main() { long N, X; scanf("%ld %ld", &N, &X); long L = X > N - X ? X : N - X; long S = N - L; printf("%ld\n",(N + f(L, S))); return 0; } long f(long L, long S) { if (S == 0) return -L; return 2 * S * (L / S) + f(S, L % S); }
main.c: In function 'main': main.c:8:25: error: implicit declaration of function 'f' [-Wimplicit-function-declaration] 8 | printf("%ld\n",(N + f(L, S))); | ^ main.c: At top level: main.c:11:6: error: conflicting types for 'f'; have 'long int(long int, long int)' 11 | long f(lon...
s902210176
p04048
C++
#include <iostream> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <algorithm> #include <numeric> #include <functional> #include <set> #include <sstream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cctype> #include <climits> #include ...
a.cc:57:19: error: extended character 
 is not valid in an identifier 57 | cin >> N >> X;
 | ^ a.cc: In function 'int main()': a.cc:57:19: error: '\U00002028' was not declared in this scope 57 | cin >> N >> X;
 | ^ a.cc:59:10: error: 'ans' was not declared i...
s686792726
p04048
Java
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.HashMap; public class New4 { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in))...
Main.java:7: error: class New4 is public, should be declared in a file named New4.java public class New4 { ^ 1 error
s114292946
p04048
C++
#include <bits/stdc++.h> using namespace std; #define DEBUG_ON 1 // 0 = off, 1 = on namespace { #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(),(x).rend() #define LEN(x) (int)((x).size()) #define FI first #define SE second #define PB push_back #define MP make_pair #define OP minmax #define FOR(i, ...
a.cc:21:10: fatal error: debug.h: No such file or directory 21 | #include "debug.h" | ^~~~~~~~~ compilation terminated.
s668671023
p04048
C++
#include<string.h> #include<iostream> #include<string> #include<algorithm> #include<cstdio> #include<math.h> using namespace std; int main() { unsigned long long n, x; cin >> n >> x; if (n / 2.0 != x) { int a = (n - x) / x; int b = (n - x) % x; cout << x * 3 * ( b + a); } }else { cout << x * 3; } return ...
a.cc:15:18: error: expected unqualified-id before 'else' 15 | } }else { | ^~~~ a.cc:18:9: error: expected unqualified-id before 'return' 18 | return 0; | ^~~~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s497610149
p04048
C++
#include<string.h> #include<iostream> #include<string> #include<algorithm> #include<cstdio> #include<math.h> using namespace std; int main() { unsigned long long n, x; cin >> n >> x; if (n / 2.0 != x) { int a = (n - x) / x; int b = (n - x) % x; cout << x * 3 * ( b + a); } }else { cout << x * 3; } return ...
a.cc:15:18: error: expected unqualified-id before 'else' 15 | } }else { | ^~~~ a.cc:18:9: error: expected unqualified-id before 'return' 18 | return 0; | ^~~~~~
s856791613
p04048
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.stream.Stream; public class Main { static int count = 0; public static int[] func(int[] ar) { //System.out.println(Arrays.toString(ar)); Arrays.sort(ar); if (ar[0] == 0) { //int[] result = {count, 0}...
Main.java:32: error: incompatible types: int cannot be converted to int[] int poi = func(ar[1]); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s773137502
p04048
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<array> #include<bitset> #include<cassert> #include<cctype> #include<cmath> #include<cstdio> #include<cstring> #include<functional> #include<limits> #include<list> #include<map> #include<numeric> #include<set> #include<stack> #include<string> #include<sst...
cc1plus: error: '::main' must return 'int'
s573995522
p04048
C++
include <iostream> using namespace std; int mod_gcd(int a, int b, int &l){ if(a%b!=0){ l=l+2*( a - (a % b)); return mod_gcd(b,a%b,l); } else { l=l+b*(a/b+1); } } int main(int argc, char *argv[]) { int n,x,l=0; cin >> n >> x; mod_gcd(n-x,x,l); cout << l+n; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main(int, char**)': a.cc:16:9: error: 'cin' was not declared in this scope 16 | cin >> n >> x; | ^~~ a.cc:18:9: error: 'cout' was not declared in this scope 18 | cout << ...
s425734590
p04048
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int X = sc.nextInt(); int ans = X + (N - X); if(N % 2 == 0) { ans += (X - (N / 2) + 1) * 3; } else { ans += ((N -...
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s025543942
p04048
C++
#define REP(i,n) for (int i=0;i<(n);i++) #define ll long long using namespace std; int dx[] ={0,1,0,-1}; int dy[]= {1,0,-1,0}; int c=0; long long solve(long long N,long long X){ if(c==1){ c++; if(2*N%X==0){ return X*(2*N/X); } int ans = X*(2*N/X); return ans + solve(X,N%X); }else if(c%2==0){ c+...
a.cc: In function 'int main()': a.cc:39:3: error: 'cin' was not declared in this scope 39 | cin>>N>>X; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:44:3: error: 'cout' was not declared ...
s845671833
p04048
C++
int dx[] ={0,1,0,-1}; int dy[]= {1,0,-1,0}; int c=0; long long solve(long long N,long long X){ if(c==1){ c++; if(2*N%X==0){ return X*(2*N/X); } int ans = X*(2*N/X); return ans + solve(X,N%X); }else if(c%2==0){ c++; if(N%X==0){ return (N/X)*2*X-X; } int an = (N/X)*2*X; retur...
a.cc: In function 'int main()': a.cc:34:3: error: 'cin' was not declared in this scope 34 | cin>>N>>X; | ^~~ a.cc:39:3: error: 'cout' was not declared in this scope 39 | cout<<ans<<endl; | ^~~~ a.cc:39:14: error: 'endl' was not declared in this scope 39 | cout<<ans<<endl; | ...
s658873592
p04048
C++
#include <iostream> using namespace std; int main() { int n,x,length; int a[2]; cin>>n>>x; a[0]=n-x; a[1]=x; length=x; while(a[0]!=a[1]){ if(a[0]>a[1]){ length=length+((a[0]-1)/a[1])*a1; a[0]=(a[0]-1)%a[1]+1; } if(a[0]<a[1]){ a[1]=(a[1]-1)%a[0]+1; } } cout<<length*3; }
a.cc: In function 'int main()': a.cc:13:47: error: 'a1' was not declared in this scope; did you mean 'a'? 13 | length=length+((a[0]-1)/a[1])*a1; | ^~ | a
s702459655
p04048
C++
#include<string.h> #include<iostream> #include<string> #include<algorithm> #include<cstdio> #include<math.h> using namespace std; int main() { unsigned long long n, x; cin >> n >> x; if (n / 2 < x) { cout << 6 * x; } else { cout << 3 * x; } return 0;
a.cc: In function 'int main()': a.cc:17:18: error: expected '}' at end of input 17 | return 0; | ^ a.cc:8:12: note: to match this '{' 8 | int main() { | ^
s119140318
p04048
C++
// scanf 等でエラーを出さないように追加 #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <math.h> #include <limits.h> #include <iostream> #include <string> #include <vector> #include <memory> #include <algorithm> #include <numeric> #include <set> #include <fun...
a.cc: In function 'int main()': a.cc:39:25: error: return-statement with no value, in function returning 'int' [-fpermissive] 39 | return; | ^~~~~~ a.cc:48:25: error: return-statement with no value, in function returning 'int' [-fpermissive] 48 | ...
s905614504
p04048
Java
import java.util.Arrays; import java.util.Scanner; public class MainB { MyScanner sc = new MyScanner(); Scanner sc2 = new Scanner(System.in); long start = System.currentTimeMillis(); long fin = System.currentTimeMillis(); final int MOD = 1000000007; int[] dx = { 1, 0, 0, -1 }; int[] dy = { 0, 1, -1, 0 }; void...
Main.java:4: error: class MainB is public, should be declared in a file named MainB.java public class MainB { ^ 1 error
s120202974
p04048
C++
#include <bits/stdc++.h> using namespace std; long long n, x, ans, prev, cur; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cin >> n >> x; x = min(x, n - x); ans += x; ans += n - x; prev = n - x; cur = x; while(cur > 0) { ans += 2 * (prev / cur) * cur; prev %= cur; swap(prev, cur); }...
a.cc: In function 'int main()': a.cc:18:9: error: reference to 'prev' is ambiguous 18 | prev = n - x; | ^~~~ 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/bits/...
s979054351
p04048
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: In function 'int main()': a.cc:24:12: error: 'class std::queue<int>' has no member named 'push_back' 24 | #define pb push_back | ^~~~~~~~~ a.cc:54:15: note: in expansion of macro 'pb' 54 | q.pb(k); | ^~ a.cc:24:12: error: 'class std::queue<int>' has no member...
s831148812
p04048
C++
#include<iostream> #include<string> #include<iomanip> #include<vector> #include<algorithm> #include<utility> using namespace std; void swarp(long long *a,long long *b){ long long c; c = *a; *a = *b; *b = c; } long long solve(long long l,long long s){ if (l == (l/s)*s) return 2*(l-s); else return ((l/s) *...
a.cc: In function 'int main()': a.cc:33:31: error: expected ')' before 'x' 33 | } else if (n>2*x &&(x>n-2*x) x % (n-2*x)==0){ | ~ ^~ | )
s184260761
p04048
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(){ long long n,x,a,res; cin >> n >> x; a = max(n-x,x) if(n%x == 0)cout << a*3 <<endl; else cout << a*4 <<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:23: error: expected ';' before 'if' 10 | a = max(n-x,x) | ^ | ; 11 | if(n%x == 0)cout << a*3 <<endl; | ~~ a.cc:12:9: error: 'else' without a previous 'if' 12 | else...
s163807260
p04048
C
#include<stdio.h> long long gcd(long long a,long long b){ while(b ^= a ^= b ^= a%=b); return a; } long long main(){ long long n,x; long long i,j,g; scanf("%lld%lld",&n,&x); g = gcd(n,x); n /= g; x /= g; prlong longf("%lld\n",(n-1)*3*g); return 0; }
main.c: In function 'main': main.c:18:9: error: unknown type name 'prlong'; did you mean 'long'? 18 | prlong longf("%lld\n",(n-1)*3*g); | ^~~~~~ | long main.c:18:22: error: expected declaration specifiers or '...' before string constant 18 | prlong longf("%lld\n",(n-1)*...
s938619845
p04048
C++
#include <iostream> #include <string> #include <map> #include <vector> #include <set> #include <fstream> #include <stdint.h> #include <cmath> #include <algorithm> #include <utility> #include <numeric> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) #define RREP(i,n) for(int i = (n)-1; i >= 0; i--) #d...
a.cc: In function 'int main()': a.cc:31:5: error: 'else' without a previous 'if' 31 | else if( 2 * x == n) | ^~~~
s740009807
p04048
Java
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long x = sc.nextLong(); System.out.println(x*3 + (n-x-1)*3); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s167833323
p04048
C++
#include<iostream> #include<vector> #include<algorithm> #define REP(i,n) for(int i=0; i<n; ++i) using namespace std; typedef long long int ll; int main(){ ll n, x; cin >> n >> x; x = min(x, n-x); if(n%x){ cout << 3*(n-1) << endl; } else { cout << 3*(n/x-1)*x << endl; } return 0; } [yuri] 16-...
a.cc:17:1: error: expected unqualified-id before '[' token 17 | [yuri] 16-07-16 21:37:43> ~/agc | ^
s417025699
p04048
C++
#include<vector> #include<algorithm> int main() { std::size_t N,X; std::cin >> N >> X; auto res{0}; if (2 * X < N) { res = X * 6; } else { res = X * 3; } std::cout << res<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:6:14: error: 'cin' is not a member of 'std' 6 | std::cin >> N >> X; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<algorithm> +++ |+#include <iostream> ...
s094535807
p04048
C++
#include<cstdio> #define ll long long using namespace std; int main() { ll n,x; while(~scanf("%I64d%I64d",&n,&x)) { if(x*2==n)printf("%I64d\n",3*(n/2)); else printf("%I64d\n",3*(n-1)); }
a.cc: In function 'int main()': a.cc:11:2: error: expected '}' at end of input 11 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s654128501
p04048
C++
#include <iostream> #include <iomanip> #include <stdio.h> #include <set> #include <vector> #include <map> #include <cmath> #include <algorithm> #include <memory.h> #include <string> #include <sstream> #include <cstdlib> #include <ctime> #include <cassert> using namespace std; typedef long long LL; typedef pair<int,in...
a.cc: In function 'int main()': a.cc:47:9: error: cannot bind non-const lvalue reference of type 'LL&' {aka 'long long int&'} to a value of type 'int' 47 | GLL(n); GLL(x); | ^ a.cc:36:13: note: initializing argument 1 of 'int GLL(LL&)' 36 | int GLL(LL& x) { | ~~~~^ a.cc:47:17: er...
s197658919
p04048
Java
// package atcoder.agc.agc001; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; /** * Created by hama_du on 2016/07/16. */ public class B { public static void main(String[] args) { InputReader in = new I...
Main.java:12: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s234946588
p04049
C++
â
a.cc:1:1: error: '\U000000e2' does not name a type 1 | â | ^
s020205521
p04049
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s991694756
p04049
C++
// It works until it doesn't #ifndef NOBITS #include <bits/stdc++.h> #endif using namespace std; // pre #include "debug/deb.cpp" #include "io/ion.cpp" // ctvl, ctvl2, read, write, writeln, ~, div_ceil, div_floor, min_heap, max_heap, d+=d, +-d, --d--, lbi, ubi, // vecnd, vec1, vec2, vec3, log2_floor, log2_ceil #include...
a.cc:7:10: fatal error: debug/deb.cpp: No such file or directory 7 | #include "debug/deb.cpp" | ^~~~~~~~~~~~~~~ compilation terminated.
s240175954
p04049
C++
#include <iostream> #include <iomanip> #include <algorithm> #include <string> #include <vector> #include <map> #include <set> #include <queue> #include <cstdio> #include <cstring> using namespace std; int n, k; vector<int> g[4000]; int cnt(int cur, int prev) { // cout << cur << ", " << prev << endl; int ret ...
a.cc: In function 'int main()': a.cc:49:7: error: request for member 'resize' in 'g', which is of non-class type 'std::vector<int> [4000]' 49 | g.resize(n); | ^~~~~~
s269681628
p04049
C++
#include <map> #include <set> #include <cmath> #include <ctime> #include <cstdio> #include <vector> #include <cstring> #include <cstdlib> #include <algorithm> #include <iostream> 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;...
a.cc: In function 'int main()': a.cc:77:16: error: 'v' was not declared in this scope; did you mean 'vi'? 77 | memset(v,0,sizeof(v)); | ^ | vi
s566587615
p04049
Java
import java.util.*; import java.io.*; import java.text.*; class AtCoder_AGC01_C{ //SOLUTION BEGIN //Into the Hardware Mode void pre() throws Exception{} void solve(int TC) throws Exception{ int N = ni(), K = ni(); int[] from = new int[N-1], to = new int[N-1]; for(int i = 0; i< N...
Main.java:5: error: duplicate class: AtCoder_AGC01_C class AtCoder_AGC01_C{ ^ Main.java:73: error: cannot access Main if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start(); ...
s970590406
p04049
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef pair<int,int> pii; const int inf = 0x3f3f3f3f,oo = inf; #define pi 3.14159265358979323846 #define IL inline #define rep(i,a,b) for(int i=(a);i<(b);++i) #define Rep(i,a,b) for(int i=(a);i<=(...
a.cc: In function 'void init(int, int)': a.cc:54:34: error: reference to 'size' is ambiguous 54 | mxdep[u] = 0;wson[u] = 0;size[u] = 1; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from...
s079297074
p04049
C++
#include<bits/stdc++.h> #pragma GCC optimize("Ofast") using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef pair<int,int> pii; const int inf = 0x3f3f3f3f,oo = inf; #define pi 3.14159265358979323846 #define IL inline #define rep(i,a,b) for(int i=(a);i<(b);++i) #define...
a.cc: In function 'void init(int, int)': a.cc:55:34: error: reference to 'size' is ambiguous 55 | mxdep[u] = 0;wson[u] = 0;size[u] = 1; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from...
s324151596
p04049
C++
#include<bits/stdc++.h> #pragma GCC optimize("Ofast") using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef pair<int,int> pii; const int inf = 0x3f3f3f3f,oo = inf; #define pi 3.14159265358979323846 #define IL inline #define RG register #define rep(i,a,b) for(RG int i...
a.cc: In function 'll read()': a.cc:18:11: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 18 | RG ll x=0;char f=0;RG char c=gc(); | ^ a.cc:18:32: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 18 | RG ll x=0;char f=0;RG ...
s254050543
p04049
C++
//BadWaper gg #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<queue> #include<vector> #include<deque> #include<bitset> #include<map> #include<set> #define inf 1e9 #define eps 1e-6 #define mp make_pair #define N 2020 using namespace std; typedef long long ll; typedef un...
a.cc: In function 'void dfs(int, int)': a.cc:39:9: error: reference to 'size' is ambiguous 39 | size[now]=1;int flag=0; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/...
s251458719
p04049
C++
//BadWaper gg #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<queue> #include<vector> #include<deque> #include<bitset> #include<map> #include<set> #define inf 1e9 #define eps 1e-6 #define mp make_pair #define N 2020 using namespace std; typedef long long ll; typedef un...
a.cc: In function 'void dfs(int, int)': a.cc:39:9: error: reference to 'size' is ambiguous 39 | size[now]=1;int flag=0; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/...
s267515729
p04049
C++
// In the name of god #include <bits/stdC++.h> #pragma GCC optimze("02") using namespace std; using ll =long long; const ll maxn=2e3+5,inf=1e18; ll n,m=inf,k,x,y,h[maxn],num[2][maxn]; bool mark[maxn]; vector <ll> adj[maxn]; pair <ll,ll> p[maxn]; void dfs(int u,int v){ mark[u]=1; for(int j:adj[u]){ if(!mark[j]&&j!=...
a.cc:2:10: fatal error: bits/stdC++.h: No such file or directory 2 | #include <bits/stdC++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s816248367
p04049
C++
#include <bits/stdc++.h> #define pb push_back #define ll long long #define si short int #define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) #define pill pair<ll,ll> #define f first #define s second #define pilc pair<ll,char> #define all(a) (a).begin(),(a).end() #define rep(s,e,step) for(int i = (s); i < (...
a.cc: In function 'std::pair<long long int, std::pair<long long int, long long int> > bfs(long long int)': a.cc:45:33: error: expected primary-expression before ';' token 45 | rstM.T++; | ^ a.cc: In function 'std::pair<long long int, long long int> dia()'...
s478627316
p04049
C++
#include <bits/stdc++.h> #define pb push_back #define ll long long #define si short int #define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) #define pill pair<ll,ll> #define f first #define s second #define pilc pair<ll,char> #define all(a) (a).begin(),(a).end() #define rep(s,e,step) for(int i = (s); i < (...
a.cc: In function 'std::pair<long long int, std::pair<long long int, long long int> > bfs(long long int)': a.cc:45:33: error: expected primary-expression before ';' token 45 | rstM.T++; | ^ a.cc: In function 'std::pair<long long int, long long int> dia()'...
s779725992
p04049
C++
#include <bits/stdc++.h> #define pb push_back #define ll long long #define si short int #define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) #define pill pair<ll,ll> #define f first #define s second #define pilc pair<ll,char> #define all(a) (a).begin(),(a).end() #define rep(s,e,step) for(int i = (s); i < (...
a.cc: In function 'std::pair<long long int, std::pair<long long int, long long int> > bfs(long long int)': a.cc:45:33: error: expected primary-expression before ';' token 45 | rstM.T++; | ^ a.cc: In function 'std::pair<long long int, long long int> dia()'...
s802978187
p04049
C++
s
a.cc:2:1: error: 's' does not name a type 2 | s | ^
s374143347
p04049
C++
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; namespace io { #define SIZ (1 << 21 | 1) #define gc() (io::iS == io::...
a.cc: In function 'void dfs(int, int, int)': a.cc:75:20: error: too few arguments to function 'void dfs(int, int, int)' 75 | dfs(e[i].b, x); | ~~~^~~~~~~~~~~ a.cc:69:13: note: declared here 69 | inline void dfs(int x, int y, int z) | ^~~
s549959540
p04049
C++
#include <iostream> //#include <bits/stdc++.h> #include <cstdlib> #include <cstring> #include <cstdio> #include <vector> #include <queue> #include <algorithm> #define loop(i,a,b) for(int i=a;i<b;i++) #define pb(x) push_back(x) #define F first #define S second using namespace std; const int N=2000; vector<int> g[N]; int...
a.cc:22:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive] 22 | dfs(int u,int level){ | ^~~ a.cc: In function 'int dfs(int, int)': a.cc:34:1: warning: no return statement in function returning non-void [-Wreturn-type] 34 | } | ^
s898531467
p04049
C++
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #define inf 0x7f7f7f7f using namespace std; typedef long long ll; #define maxn 5000010 void read(int &x) { int f = 1; x = 0; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f =...
a.cc:73:1: error: 'cout' does not name a type 73 | cout << n - ans << endl; | ^~~~ a.cc:74:1: error: expected declaration before '}' token 74 | } | ^
s115842694
p04049
C++
#include <bits/stdc++.h> using namespace std; const int N = 2000 + 7; int n, k, mindel[N][N], dep[N][N]; vector<int> g[N]; bool vis[N]; void dfs(int a) { mindel[a][0] = 1; vector<int> kids; vis[a] = 1; for (auto &b : g[a]) { if (vis[b] == 0) { dfs(b); mindel[a][0] += mindel[b][0]; kids....
a.cc: In function 'void dfs(int)': a.cc:28:32: error: 'i' was not declared in this scope 28 | mindel[a][len] = mindel[a][i - 1]; | ^
s970249183
p04049
C++
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = std::int_fast64_t; using std::cout; using std::cerr; using std::endl; using std::cin; template<typename T> std::vector<T> make_v(size_t a){return std::vector<T>(a);} template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){...
a.cc: In function 'int main()': a.cc:31:27: error: 'id' was not declared in this scope; did you mean 'i'? 31 | int v = a[id] ^ b[id] ^ i; | ^~ | i
s866680360
p04049
C++
#include<bits/stdc++.h> #define pb emplace_back using namespace std; using ll = long long; const int maxn = 2010; bool bye[maxn]; vector<int> edge[maxn]; int n, k; vector<int> dp[maxn]; int sz[maxn]; void dfs1(int now, int last = -1){ sz[now] = 1; for(int u : edge[now])if(u != last) dfs1(u, now), sz[now] += sz[u]; ...
a.cc: In function 'void dfs2(int, int)': a.cc:46:29: error: expected ';' before 'signed' 46 | dfs2(u, now) | ^ | ; 47 | signed main(){ | ~~~~~~ a.cc:58:2: error: expected '}' at end of input 58 | } ...
s672684745
p04049
C++
#include<bits/stdc++.h> #define ll long long using namespace std; inline ll read() { ll ans=0;ll a=1;char c=getchar(); for(;c<'0'||c>'9';c=getchar())if(c=='-')a=-1; for(;c>='0'&&c<='9';c=getchar())ans=ans*10+c-48; return ans*a; } ll a[2001][2001],maxx; vector<ll> p[2001]; ll se[2001],fi[2001],n,k,cnt; void dfs(ll r...
a.cc: In function 'int main()': a.cc:31:14: error: 'll_MAX' was not declared in this scope 31 | maxx=ll_MAX; | ^~~~~~
s119212965
p04049
C++
#include <iostream> #include <vector> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<bool> vb; typedef vector<vb> vvb; vvi graph(100); vvi lineDistances(100, vi(100)); vvb visited(100, vb(100, false)); vi vertexA, vertexB; int number, diameter; void dfs(int root, int start, int dist...
a.cc: In function 'int main()': a.cc:93:26: error: 'setprecision' was not declared in this scope 93 | cout << fixed << setprecision(16); | ^~~~~~~~~~~~ a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' ...
s516442803
p04049
C++
#include<bits/stdc++.h> using namespace std; int main() { int V, K; cin >> V >> K; vector<vector<int>> g(n); for (int i = 0; i < V-1; i++) { int u, v; cin >> u >> v; u--; v--; g[u].push_back(v); g[v].push_back(u); } int res = 0; auto dfs = [&](auto f, int n, int p, int d) -> int { if (d == 0...
a.cc: In function 'int main()': a.cc:5:25: error: 'n' was not declared in this scope 5 | vector<vector<int>> g(n); | ^
s129970063
p04049
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> Pii; typedef pair<ll,ll> Pll; #define rep(i,n) for (ll i=0;i<(n);++i) #define rep2(i,a,b) for (ll i=(a);i<(b);++i) #define debug(x) cout << #x << '=' << x << endl #define all(v) (v).begin(),(v).end() const ll MOD=1e9+7; //const ll...
a.cc:39:30: error: stray '\16' in program 39 | if (p==r) chmax(ans,cnt),<U+000E>cnt=0; | ^~~~~~~~
s292964027
p04049
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,K;cin>>N>>K; vector<vector<int>> A(N); for(int i=0;i<N;i++){ int a,b;cin>>a>>b; A[a-1].push_back(b-1); A[b-1].push_back(a-1); } int diameter=0,best_s=-1; for(int s=0;s<N;s++){ queue<int> q; vector<int> dist(N,-1); q.pu...
a.cc: In function 'int main()': a.cc:63:38: error: expected ';' before '}' token 63 | if(dist2[i]>t||dist2[i+N]>t)ans++ | ^ | ; 64 | } | ~ a.cc:65:18: error: lvalue required as le...
s070195508
p04049
C++
/* #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #pragma GCC optimize("Os") #pragma GCC target("avx2,fma") #pragma GCC optimize("Ofast") #pragma GCC optimize("Os") */ #include <bits/stdc++.h> #include <windows.h> #define ll long long #define X first #define Y second #define MP ...
a.cc:11:10: fatal error: windows.h: No such file or directory 11 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s005815628
p04049
C++
///supercalifragilisticexpialidocious. #include <cstdio> #include <cstring> #include <cmath> #include <cassert> #include <cstdlib> #include <cctype> #include <ctime> #include <iostream> #include <iomanip> #include <sstream> #include <numeric> #include <utility> #include <string> #include <algorithm> #include <vector> #...
a.cc: In function 'int32_t main()': a.cc:63:24: error: 'INT_MAX' was not declared in this scope 63 | input() , mn = INT_MAX; | ^~~~~~~ a.cc:23:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 22 | #include <complex> ...
s626406921
p04049
C++
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=2005; int n,m,t,p,ans; int d[N],first[N],v[N],w[N],next[N]; struct Node{ int u,v; }e[N]; void add(int x,int y) { t++; next[t]=first[x]; first[x]=t; v[t]=y; } void dfs(int x,int father) { int i,j; for(i=first[x];i;i=next[i]...
a.cc: In function 'void add(int, int)': a.cc:14:9: error: reference to 'next' is ambiguous 14 | next[t]=first[x]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bi...
s055557354
p04049
C++
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=2005; int n,m,t,p,ans; int d[N],first[N],v[N],w[N],next[N]; struct Node{ int u,v; }e[N]; void add(int x,int y) { t++; next[t]=first[x]; first[x]=t; v[t]=y; } void dfs(int x,int father) { int i,j; for(i=first[x];i;i=next[i]...
a.cc: In function 'void add(int, int)': a.cc:14:9: error: reference to 'next' is ambiguous 14 | next[t]=first[x]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bi...
s305320909
p04049
C++
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <math.h> using namespace std; typedef long long int ll; int n,k; vector<int> G[2100]; int dfs(int t,int f,int k,int depth=0){ int cnt=0; if(depth>=k)cnt++; for(auto d:G[t]){ if(d==f)continue; cnt+=dfs(d,t,k,depth+1); } retur...
a.cc: In function 'int main()': a.cc:40:56: error: 's' was not declared in this scope 40 | int cnt=dfs(t,i,(k+1)/2)+dfs(t,s,(k+1)/2); | ^
s306229540
p04049
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #in...
a.cc: In function 'void solve()': a.cc:76:28: error: 'res' was not declared in this scope; did you mean 'rec'? 76 | ans = min(ans, res); | ^~~ | rec
s911513904
p04049
C++
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define int ll //#define int unsigned __int128 //#define ll unsigned __int128 typedef pair<int, int > pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector< v...
a.cc: In function 'void smain()': a.cc:179:18: error: no matching function for call to 'min(ll&, long long unsigned int)' 179 | ans = min(ans, n - st[i].size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-l...
s934899211
p04049
C++
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define int ll //#define int unsigned __int128 //#define ll unsigned __int128 typedef pair<int, int > pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector< v...
a.cc: In function 'void smain()': a.cc:31:28: error: no matching function for call to 'min(ll&, long long unsigned int)' 31 | #define inmin(a, b) a = min(a, (b)) | ~~~^~~~~~~~ a.cc:179:9: note: in expansion of macro 'inmin' 179 | inmin(ans, n - st[i].size()); | ^...
s510905105
p04049
C++
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <queue> #include <deque> #include <map> #include <stack> #include<bitset> #include<list> #include<cassert> #include<numeric> using namespace std; const int Maxn = 4000 + 100; int Begin[Maxn], To[Maxn], Next[Maxn], e;...
a.cc: In function 'int main()': a.cc:59:9: error: 'memset' was not declared in this scope 59 | memset(sum, 0, sizeof(sum)); | ^~~~~~ a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | #include<numeric> +++ |+#include <cs...
s351829924
p04049
C++
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <queue> #include <deque> #include <map> #include <stack> #include<bitset> #include<list> #include<cassert> #include<numeric> using namespace std; using namespace std; const int mod = 1000 * 1000 * 1000 + 7; const in...
a.cc: In function 'int main()': a.cc:59:17: error: 'memset' was not declared in this scope 59 | memset(mark, 0, sizeof mark); | ^~~~~~ a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | #include<numeric> ...
s730233535
p04049
C
#include <iostream> #include <cstdio> #include <vector> #include <cstring> #include <string> #include <set> #include <map> #include <queue> #include <cmath> #include <algorithm> #include <iomanip> #include <sstream> using namespace std; typedef long long ll; typedef unsigned long long ull; const int INF = 1e9; vector<i...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s442984377
p04049
C++
#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; const int N = 2010; vector<int> edge[N]; pair<int,int> e[N]; bool vis[N]; int cnt; void dfs(int n,int k){ vis[n]=1;cnt++; if(k==0) return ; for(int i=0;i<edge[n].size();i++){ if(!vis[edge[n][i]]) dfs(edg...
a.cc: In function 'int main()': a.cc:30:13: error: 'memset' was not declared in this scope 30 | memset(vis,0,sizeof vis); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <cmath> +++ |+#include...
s583083431
p04049
C++
#include<iostream> #include<vector> #include<algorithm> #using namespace std; struct Unionfind{ vector<int> par; Unionfind(int n):par(n){ for(int i=0;i<n;i++){ par[i]=i; } } /*int root(int x){ if(par[x]==x) return x; return par[x]=root(par[x]); }*/ int root(int x){ i...
a.cc:4:2: error: invalid preprocessing directive #using 4 | #using namespace std; | ^~~~~ a.cc:7:3: error: 'vector' does not name a type 7 | vector<int> par; | ^~~~~~ a.cc:45:4: error: expected ';' after struct definition 45 | } | ^ | ; a.cc: In constructor 'Unionfind::Un...
s761212225
p04049
C++
#include <bits/stdc++.h> using namespace std; int n,d,hed[2010],cnt,k,fa[2010],dep[2010],ans=2e9,book[2010]; struct node { int from,to,next; }a[100010]; void add(int from,int to) { a[cnt++].to=to; a[cnt].from=from; a[cnt].next=hed[from]; hed[from]=cnt; } void dfs(int x) { for(int i=hed[x];i;i=a[i].next) { int...
a.cc: In function 'int main()': a.cc:51:36: error: expected ';' before 'i' 51 | j++i; | ^ | ; a.cc:61:36: error: expected ';' before 'i' 61 | j++i; | ...
s135064672
p04049
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<vector> #include<queue> #include<deque> #include<stack> #include<map> #include<set> using namespace std; const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右 const int N=100005,M=1000005,m...
a.cc: In function 'int main()': a.cc:36:24: error: 'x' was not declared in this scope 36 | q.push(x); | ^ a.cc:37:21: error: expected primary-expression before ')' token 37 | for() | ^ a.cc:38:9: error: expected primary-express...
s272183171
p04049
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<queue> #include<map> #include<math.h> #include<iomanip> #include<set> #include<numeric> #include<cstring> #include<cstdio> #include<functional> #include<bitset> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;...
a.cc: In function 'void init2(long long int)': a.cc:55:53: error: 'INT_MAX' was not declared in this scope 55 | for (int i = 0; i < 2 * n - 1; i++)dat[i] = INT_MAX; | ^~~~~~~ a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probabl...
s734993467
p04049
C++
#include<iostream> #include<algorithm> #include<vector> 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 an...
a.cc:5:17: error: 'acos' was not declared in this scope 5 | const double pi=acos(-1); | ^~~~