submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s656765882
p03821
C++
#include<string> #include<iostream> #include<algorithm> #include<set> #include<math.h> #include<vector> #include<sstream> #include<queue> #include<functional> #include<bitset> #include<cstdio> #include<iomanip> #include <cstring> #include <climits> using namespace std; #define REP(i,n) for(int i=0;i < n; i++) #define R...
a.cc: In function 'bool cmp(const int&, const int&)': a.cc:23:54: error: 'f' was not declared in this scope 23 | inline bool cmp(const int &a, const int &b) { return f[a]>f[b]; } | ^
s487779099
p03821
C
#include <stdio.h> int main(){ int count = 0; int N=0; int i,j; scanf("%d\n",&N); int A[N]; int B[N]; for(i=0;i<N;i++){ scanf("%d %d\n",&A[i],&B[i]); } int d=0; for(i = N-1;i>=0;i--){ d = B[i] - (A[i]%B[i]); if(A[i]%B[i]==0) continue; for(j=0;j<=i;j++){ A[j]+=d; } count...
main.c:25:5: error: redefinition of 'main' 25 | int main(){ | ^~~~ main.c:2:5: note: previous definition of 'main' with type 'int()' 2 | int main(){ | ^~~~
s967618306
p03821
C++
#include <iostream> #include <vector> #define int unsigned long long using namespace std; int n; int a[100000], b[100000]; unsigned main(void) { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } int ans = 0; for (int i = n - 1; i >= 0; i--) { a[i] += ans; if (a[i] % b[i] == 0) { ...
cc1plus: error: '::main' must return 'int'
s408633477
p03821
C++
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, m, n) for (int i = m, i < n; ++i) #define INF 1000 * 1000 using namespace std; int main() { long long a[100000], b[100000]; long long c;...
a.cc:44:3: error: 'cout' does not name a type 44 | cout << count << endl; | ^~~~ a.cc:46:3: error: expected unqualified-id before 'return' 46 | return 0; | ^~~~~~ a.cc:48:1: error: expected declaration before '}' token 48 | } | ^
s409506769
p03821
Java
//package com.grand9; import java.util.Scanner; public class Main1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long A[] =new long [N]; long B[] = new long [N]; for(int i=0;i<N;i++){ A[i]= sc.nextInt(); ...
Main.java:5: error: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ 1 error
s106211357
p03821
C++
#include<stdio.h> #include<vector> #include<queue> #include<algorithm> #include<string.h> #include<string> #include<stack> #include<set> #include<map> #include<iostream> #include<assert.h> #include<unordered_map> //#define Min(a,b,c) min((a),min((b),(c))) #define mp(a,b) make_pair((a),(b)) #define pii pair<int,int> #d...
a.cc: In function 'int main()': a.cc:37:32: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<long long int, long long int>; _Tp = int; _Hash = std::hash<std::pair<long long int, long long int> >; _Pred = std::equal_to<std::pair<long long int, lo...
s891592443
p03821
C++
#include<stdio.h> #include<vector> #include<queue> #include<algorithm> #include<string.h> #include<string> #include<stack> #include<set> #include<map> #include<iostream> #include<assert.h> #include<unordered_map> //#define Min(a,b,c) min((a),min((b),(c))) #define mp(a,b) make_pair((a),(b)) #define pii pair<int,int> #d...
a.cc: In function 'int main()': a.cc:37:32: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<long long int, long long int>; _Tp = int; _Hash = std::hash<std::pair<long long int, long long int> >; _Pred = std::equal_to<std::pair<long long int, lo...
s896206165
p03821
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d%d",&a[i],&b[i]); } int s=0; for(int i=n;i>=1;i--){a[i]+=s; if...
a.cc: In function 'int main()': a.cc:20:17: error: expected '}' before 'else' 20 | else{ | ^~~~ a.cc:19:26: note: to match this '{' 19 | if(a[i]<b[i]){ans+=b[i]-a[i];s+=b[i]-a[i]; | ^
s389950141
p03821
C
#include <stdio.h> int main(){ int i, j, n; int counter = 0; scanf("%d", &n); int buttonA[n]; int buttonB[n]; for(i = 0; i < n; i++){ int a, b; scanf("%d %d", &a, &b); buttonA[i] = a; buttonB[i] = b; } for(i = n - 1; i >= 0; i--){ ...
main.c: In function 'main': main.c:26:11: error: expected '}' before 'else' 26 | else if(buttonA[i] == 0) | ^~~~
s570595217
p03821
C++
#include <iostream> using namespace std; int main() { long long n,x,s=0; cin>>n; int a[n],b[n]; for(long long i=0;i<n;i++) cin>>a[i]>>b[i]; for(long long i=n-1;i>=0;i--){ x=a[i]+s; if(x<b[i])swap(b[i],x); int aux=x%b[i]; s+=(aux==0?0:b[i]-aux); //co...
a.cc: In function 'int main()': a.cc:14:23: error: no matching function for call to 'swap(int&, long long int&)' 14 | if(x<b[i])swap(b[i],x); | ~~~~^~~~~~~~ In file included from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41, from...
s332697790
p03821
C
include <stdio.h> #include <string.h> #include <math.h> int main(){ int N,i; long long int A,B; long long int count=0; scanf("%lld",&N); for(i=0;i<N;i++){ scanf("%lld%lld",&A,&B); if((A+count)%B!=0) count+=(B-(A+count)%B); } printf("%lld\n",count); return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ...
s219565120
p03821
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a=new long[n]; long[] b=new long[n]; long ans=0; for(int i=0; i<n; i++){ a[i] = sc.nextLong(); b[i] = sc.nextLong(); } for(int i=n-1;i>=0;i--){ if...
Main.java:18: error: bad operand types for binary operator '&' }else if( (a[i]%b[i] + ans%b[i]) &b[i] != 0 ){ ^ first type: long second type: boolean 1 error
s563577275
p03821
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]>>b[i]; } for(int i=1;i<=n;i++){ if(a[i]<b[i]){ c[i]=b[i]-a[i]; } else{ ...
a.cc: In function 'int main()': a.cc:24:49: error: expected ';' before '}' token 24 | c[i]=x*b[i]-a[i] | ^ | ; 25 | } | ...
s825784317
p03821
C++
/************************************************************************* > File Name: A.cpp > Author: yxg ************************************************************************/ #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<set> #include<map> #include<queue>...
/tmp/ccIKiBFd.o: in function `main': a.cc:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccIKiBFd.o a.cc:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccIKiBFd.o a.cc:(.text+0x9c): relocation trunc...
s957478559
p03821
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ scanf("%d",n); for(int i=1;i<=n;i++){ scanf("%d%d",&a[i],&b[i]); } for(int i=1;i<=n;i++){ if(a[i]<b[i]){ c[i]=b[i]-a[i...
a.cc: In function 'int main()': a.cc:24:49: error: expected ';' before '}' token 24 | c[i]=x*b[i]-a[i] | ^ | ; 25 | } | ...
s514535338
p03821
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ scanf("%d",nd); for(int i=1;i<=n;i++){ scanf("%d%d",&a[i],&b[i]); } for(int i=1;i<=n;i++){ if(a[i]<b[i]){ c[i]=b[i]-a[...
a.cc: In function 'int main()': a.cc:13:20: error: 'nd' was not declared in this scope; did you mean 'n'? 13 | scanf("%d",nd); | ^~ | n a.cc:24:49: error: expected ';' before '}' token 24 | c[i]=x*b[i]-a[i] | ...
s824456252
p03821
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ scanf("%d",&d); for(int i=1;i<=n;i++){ scanf("%d%d",&a[i],&b[i]); } for(int i=1;i<=n;i++){ if(a[i]<b[i]){ c[i]=b[i]-a[...
a.cc: In function 'int main()': a.cc:13:21: error: 'd' was not declared in this scope 13 | scanf("%d",&d); | ^ a.cc:24:49: error: expected ';' before '}' token 24 | c[i]=x*b[i]-a[i] | ^ | ...
s685775547
p03821
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ scanf("%d",&d); for(int i=1;i<=n;i++){ scnaf("%d%d",&a[i],&b[i]); } for(int i=1;i<=n;i++){ if(a[i]<b[i]){ c[i]=b[i]-a[...
a.cc: In function 'int main()': a.cc:13:21: error: 'd' was not declared in this scope 13 | scanf("%d",&d); | ^ a.cc:15:17: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 15 | scnaf("%d%d",&a[i],&b[i]); | ^~~~~ | ...
s570735525
p03821
C++
#include<iostream> #include<cstring> #include<ccstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ scanf("%d",&d); for(int i=1;i<=n;i++){ scnaf("%d%d",&a[i],&b[i]); } for(int i=1;i<=n;i++){ if(a[i]<b[i]){ c[i]=b[i]-a...
a.cc:3:9: fatal error: ccstdio: No such file or directory 3 | #include<ccstdio> | ^~~~~~~~~ compilation terminated.
s412821075
p03821
C++
#include<iostream> #include<cstring> #include<ccstdio> #include<algorithm> #include<map> using namespace std; int n; int a[100005]; int b[100005]; int c[100005]; long long ans=0; int main(){ scanf("%d",&d); for(int i=1;i<=n;i++){ scnaf("%d%d",&a[i],&b[i]); } for(int i=1;i<=n;i++){ if(a[i]<b[i]){ c[i]=b[i]-a...
a.cc:3:9: fatal error: ccstdio: No such file or directory 3 | #include<ccstdio> | ^~~~~~~~~ compilation terminated.
s637313839
p03821
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a=new long[n]; long[] b=new long[n]; long ans=0; for(int i=0; i<n; i++){ a[i] = sc.nextLong(); b[i] = sc.nextLong(); } for(int i=n-1;i>=0;i--){ a[...
Main.java:20: error: ';' expected ans -= a[i]%b[i] ^ 1 error
s042803458
p03821
C++
#include<stdio.h> int a[100005],b[100005]; int main() { int t,i,j,c; while(scanf("%d",&n)!=EOF) { c=0; for(i=0;i<n;i++) scanf("%d%d",&a[i],&b[i]); for(i=n-1;i>=0;i--) { while(a[i]%b[i]!=0) { for(j=0;j<=i;j++) a[j]++; } c++; } printf("%d\n",c); } return 0; }
a.cc: In function 'int main()': a.cc:6:27: error: 'n' was not declared in this scope 6 | while(scanf("%d",&n)!=EOF) | ^
s625703891
p03821
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n]; boolean[] used = new boolean[n]; int[] appear = new int[n]; int ans = 0; int max = 0; int p = 0; for(int i=0; i<n; i++){ a[i] = sc.next...
Main.java:19: error: illegal start of expression } ^ Main.java:34: error: reached end of file while parsing } ^ 2 errors
s515228088
p03821
C++
#include<stdio.h> int a[100005],b[100005]; int main() { int t,i,j,c; while(scanf("%d",&n)!=EOF) { c=0; for(i=0;i<n;i++) scanf("%d%d",&a[i],&b[i]); for(i=n-1;i>=0;i++) { while(a[i]%b[i]!=0) { for(j=0;j<=i;j++) a[j]++; } c++; } printf("%d\n",c); } return 0; }
a.cc: In function 'int main()': a.cc:6:27: error: 'n' was not declared in this scope 6 | while(scanf("%d",&n)!=EOF) | ^
s707415861
p03821
C
#include<stdio.h> int main(void) { int i, j, count = 0,; long int a[100000], b[100000],n; scanf("%ld", &n); for (i = 0; i < n; i++) scanf("%ld %ld", &a[i], &b[i]); i = n - 1; while (i >= 0) { if (a[i] % b[i] == 0) { i--; } else { for (j = 0; j <= i; j++) { if (i == j)count++; a[j]++; }...
main.c: In function 'main': main.c:4:29: error: expected identifier or '(' before ';' token 4 | int i, j, count = 0,; | ^
s271016727
p03821
Java
import java.util.*; public class Main{ public static void main(String[] args){ int i,tmp; long ans=0l; Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] a=new int[n]; int[] b=new int[n]; for(i=0;i<n;i++){ a[i]=sc.nextInt(); b[i]=sc.nextInt(); } for(i=n-1;i>=0...
Main.java:15: error: incompatible types: possible lossy conversion from long to int tmp=(a[i]+ans)%b[i]; ^ 1 error
s756436675
p03821
C++
#pragma GCC optimize ("O3"); #include <cstdlib> #include <iostream> #include <valarray> long long div_ceil(long long a, long long b) { return (a + b - 1) / b; } int main(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int n; std::cin >> n; std::valarray<long long> xs(n); std::valarray<long long> ...
a.cc:1:28: error: '#pragma GCC optimize' string is badly formed 1 | #pragma GCC optimize ("O3"); | ^
s845181497
p03821
C
#include <stdio.h> int main(){ int i, n; scanf("%d", &n); int buttonA[n]; int buttonB[n]; for(i = 0; i < n; i++){ int a, b; scanf("%d %d", &a, &b); buttonA[i] = a; buttonB[i] = b; } int counter = 0; for(i = n - 1; i >= 0; i--){ ...
main.c: In function 'main': main.c:37:20: error: expected ';' before '}' token 37 | return counter | ^ | ; 38 | } | ~
s878876814
p03821
C++
#include <stdio.h> #include <math.h> void main(){ int i, n; scanf("%d", &n); int buttonA[n]; int buttonB[n]; for(i = 0; i < n; i++){ int a, b; scanf("%d %d", &a, &b); buttonA[i] = a; buttonB[i] = b; } int counter = 0; for(i = n ...
a.cc:3:1: error: '::main' must return 'int' 3 | void main(){ | ^~~~
s345031326
p03821
C++
#include <stdio.h> void main(){ int i, n; scanf("%d", &n); int buttonA[n]; int buttonB[n]; for(i = 0; i < n; i++){ int a, b; scanf("%d %d", &a, &b); buttonA[i] = a; buttonB[i] = b; } int counter = 0; for(i = n - 1; i >= 0; i--){ ...
a.cc:3:1: error: '::main' must return 'int' 3 | void main(){ | ^~~~
s964984012
p03821
C++
#include<iostream> #include<cctype> #include<vector> #include<ctype.h> #include<algorithm> #include<queue> #include<string> #include<math.h> #include<iomanip> using namespace std; long long n, m; vector<long long> a; int main() { cin >> n; for (size_t i = 0; i < n + 1; i++) { a.push_back(0); } for (size_t i = 2;...
a.cc: In function 'int main()': a.cc:29:18: error: expected '}' at end of input 29 | return 0; | ^ a.cc:12:12: note: to match this '{' 12 | int main() { | ^
s551353090
p03821
C++
#include<iostream> using namespace std; #define int __int64 signed main(){ int N; cin>> N; int a[N], b[N]; for(int i=0; i<N; i++){ cin>> a[i]>> b[i]; } int s=0, t=0; for(int i=N-1; i>=0; i--){ if(a[i]+s<=b[i]){ s+=b[i]-(a[i]+s); }else{ if(b[i]==1){ ...
a.cc: In function 'int main()': a.cc:4:13: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 4 | #define int __int64 | ^~~~~~~ a.cc:8:4: note: in expansion of macro 'int' 8 | int N; | ^~~ a.cc:9:10: error: 'N' was not declared in this scope 9 | cin>>...
s405237904
p03821
C++
//インクルード #include <cstdlib> #include <iostream> #include <string> #include <vector> //メイン関数 int main() { //入力の取得 int N; std::cin >> N; std::vector<int> A; std::vector<int> B; for(int i=0; i<N; ++i) { int tempA; int tempB; std::cin >> tempA >> tempB; A.push_back(tempA); B.push_back(tempB); } //入力の反...
a.cc: In function 'int main()': a.cc:25:14: error: 'reverse' is not a member of 'std' 25 | std::reverse(A.begin(), A.end()); | ^~~~~~~ a.cc:26:14: error: 'reverse' is not a member of 'std' 26 | std::reverse(B.begin(), B.end()); | ^~~~~~~
s278865416
p03821
Java
import java.util.*; public class Main{ public static void main(String[] args){ int i,tmp; int ans=0; Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] a=new int[n]; int[] b=new int[n]; for(i=0;i<n;i++){ a[i]=sc.nextInt(); b[i]=sc.nextInt(); } for(i=n-1;i>=0;i...
Main.java:16: error: ';' expected if(tmp!=0)ans+=n-tmp ^ 1 error
s999100523
p03821
C++
int main(){ vector<int> A,B; int N; cin>>N; for(int i=0;i<N;i++){ int a,b; cin>>a>>b; A.push_back(a); B.push_back(b); } int ans=0; for(int i=N-1;i>=0;i--){ if (A[i]%B[i]!=0){ int d=(B[i]-(A[i]%B[i])); ans+=d; for(int j=0;j<i;j++) A[j]+=d; } } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:2:9: error: 'vector' was not declared in this scope 2 | vector<int> A,B; | ^~~~~~ a.cc:2:16: error: expected primary-expression before 'int' 2 | vector<int> A,B; | ^~~ a.cc:4:9: error: 'cin' was not declared in this scope ...
s294877569
p03821
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll big = 1000000007ll; ll n,m,k,x,y; vector<ll> A; vector<ll> B; ll mod(ll i , ll b){ if(i < 0)return mod(b - mod(-i),b); return i%b; } int main() { //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); ll c1,c...
a.cc: In function 'll mod(ll, ll)': a.cc:13:32: error: too few arguments to function 'll mod(ll, ll)' 13 | if(i < 0)return mod(b - mod(-i),b); | ~~~^~~~ a.cc:12:4: note: declared here 12 | ll mod(ll i , ll b){ | ^~~
s653428682
p03821
C++
#include<bits/stdc++.h> #define F first #define S second #define pb push_back #define ll long long #define int long long using namespace std ; const int MAXN = 101 * 1001 ; int a[MAXN] , b[MAXN] ; int32_t main() { ios::sync_with_stdio(0) ; cin.tie(0) ; int n ; cin >> n ; for(int i = 0 ; i < n; i ++...
a.cc:32:2: error: expected class-name at end of input 32 | ~ | ^
s847420517
p03821
Java
import java.io.*; import java.math.*; import java.util.*; import static java.util.Arrays.*; public class A { private static final int mod = (int)924844033; final Random random = new Random(0); final IOFast io = new IOFast(); /// MAIN CODE public void run() throws IOException { // int TEST_CASE = Integer.pars...
Main.java:8: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s269091641
p03822
C++
#include <iostream> #include <vector> #include <tuple> #include <deque> #include <set> #include <map> #include <cmath> #include <string> #include <algorithm> #include <unordered_set> #define int long long #define all(x) (x).begin(), (x).end() #define allr(x) (x).rbegin(), (x).rend() using namespace std; const int MOD...
a.cc: In function 'long long int dfs(long long int, long long int)': a.cc:37:1: warning: no return statement in function returning non-void [-Wreturn-type] 37 | } | ^ a.cc: In function 'int main()': a.cc:56:17: error: no matching function for call to 'max(long long int&, long long unsigned int)' 56 | ...
s554997455
p03822
C++
#include<iostream> #include<iomanip> #include<cstdio> #include<algorithm> #include<cassert> #include<cmath> #include<vector> #include<map> #include<set> #include<string> #include<queue> #include<stack> #include<list> #include <cstring> #include <functional> #include<unordered_map> #include<unordered_set> #include<bitse...
a.cc: In function 'void dfs(int, int)': a.cc:51:28: error: no matching function for call to 'min(unsigned int&, std::vector<int>::size_type)' 51 | dp[x] = min(dp[x], (int)tmp[i] + tmp.size() + 1 - i); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /...
s647854493
p03822
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(i = 0;i < n;++i) #define all(v) v.begin(), v.end() using ll = long long; ll dfs(ll now, vector<vector<ll>>& graph) { int i; vector<ll> v; for(i = 0;i < graph.at(now).size();++i){ v.push_back(dfs(graph.at(now).at(i), graph)); } ...
a.cc: In function 'll dfs(ll, std::vector<std::vector<long long int> >&)': a.cc:18:18: error: no matching function for call to 'max(ll&, long long unsigned int)' 18 | res = max(res, v.at(i) + v.size() - i); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algor...
s554777876
p03822
C++
#include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.hpp> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("O3") #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) #define ALL(obj) (obj).begin(), (obj).end() #define EPS (1e-9)...
a.cc: In function 'int dfs(int, std::vector<int>&, int)': a.cc:82:31: error: expected primary-expression before ')' token 82 | sort(ALL(temp), greater<int>); | ^ a.cc: At global scope: a.cc:90:1: error: expected initializer before 'int' 90 | int main(){ | ^~~
s452925512
p03822
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(ll i=0;i<n;i++) #define repl(i,l,r) for(ll i=(l);i<(r);i++) #define per(i,n) for(ll i=n-1;i>=0;i--) #define perl(i,r,l) for(ll i=r-1;i>=l;i--) #define fi first #define se second #define pb push_back #define ins insert #define all(x) (x).begin(),(x).end()...
a.cc: In function 'void dfs(const Graph&, ll, ll, ll)': a.cc:161:30: error: no matching function for call to 'min(long long unsigned int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)' 161 | subtree_size[v] = min(subtree_size[c]+G[v].size()-1,subtree_size[v]); // 子のサイズを...
s914347473
p03822
C++
#include<bits/stdc++.h> #define for0(i, n) for(int i = 0; i < (n); i++) #define all(x) x.begin(),x.end() #define puts(x) cout << x << "\n" using namespace std; int input() { int r; cin >> r; return r; } vector<int>v[123456]; int n; int f(int i) { vector<int>v1; for (int t : v[i])v1.push_back(f(t)); sort(all(v1), gre...
a.cc: In function 'int main()': a.cc:17:27: error: 'i' was not declared in this scope 17 | n = input(); for1(i, n)if (i != 1)v[input()].push_back(i); puts(f(1)); | ^ a.cc:17:22: error: 'for1' was not declared in this scope; did you mean 'fork'? 17 | n = input(); for...
s057657281
p03822
C++
#include<bits/stdc++.h> #define for0(i, n) for(int i = 0; i < (n); i++) #define all(x) x.begin(),x.end() #define puts(x) cout << x << "\n" using namespace std; int input() { int r; cin >> r; return r; } vector<int>v[123456]; int n; int f(int i) { vector<int>v1; for (int t : v[i])v1.push_back(f(t)); sort(all(v1), gre...
a.cc: In function 'int main()': a.cc:17:27: error: 'i' was not declared in this scope 17 | n = input(); for1(i, n)if (i != 1)v[input()].push_back(i); puts(f(1)); | ^ a.cc:17:22: error: 'for1' was not declared in this scope; did you mean 'fork'? 17 | n = input(); for...
s852035949
p03822
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define REP(i,n) for (ll i = 0; i < (n); ++i) #define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i) #define ALL(v) (v).begin(), (v).end() void dfs(ll cur, vector<ll>& depth, vector<vector<ll>>& net){ for(ll nxt : net...
a.cc: In function 'int main()': a.cc:30:8: error: too few arguments to function 'void dfs(ll, std::vector<long long int>&, std::vector<std::vector<long long int> >&)' 30 | dfs(0, depth); | ~~~^~~~~~~~~~ a.cc:9:6: note: declared here 9 | void dfs(ll cur, vector<ll>& depth, vector<vector<ll>>& net){ ...
s313490539
p03822
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define FOR(i, n, m) for (ll i = n; i < (ll)(m); i++) #define pb push_back #define all(a) (a).begin(), (a).end() typedef long long ll; typedef pair<int, int> p; #define MAX_N 100010 vector<int> child[MAX_N]; ll dfs(...
a.cc: In function 'll dfs(ll)': a.cc:30:18: error: no matching function for call to 'max(ll&, long long unsigned int)' 30 | tmp = max(tmp, 1 + (v.size()- 1 - i) + v[i]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from ...
s373548561
p03822
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define FOR(i, n, m) for (ll i = n; i < (ll)(m); i++) #define pb push_back #define all(a) (a).begin(), (a).end() typedef long long ll; typedef pair<int, int> p; #define MAX_N 100010 vector<int> child[MAX_N]; ll dfs(...
a.cc: In function 'll dfs(ll)': a.cc:30:18: error: no matching function for call to 'max(ll&, long long unsigned int)' 30 | tmp = max(tmp, 1 + (v.size()- 1 - i) + v[i]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from ...
s434843502
p03822
C++
#include <cmath> #include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <map> #include <list> #include <time.h> #include <math.h> #include <random> #include <deque> #include <queue> #include <cassert> #include <unordered_map> #include <unordered_set> #include <iomanip> #inc...
a.cc: In function 'int main()': a.cc:53:3: error: 'function' was not declared in this scope 53 | function<int(int)>solve=[&](int i){ | ^~~~~~~~ a.cc:22:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>' 21 | #include <cstring> +++ |...
s120751823
p03822
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<un...
a.cc: In function 'void solve()': a.cc:79:14: error: 'class std::vector<int>' has no member named 'push_bacK'; did you mean 'push_back'? 79 | G[i].push_bacK(a); | ^~~~~~~~~ | push_back a.cc:82:16: error: too few arguments to function 'int dfs(int, int)' 82 | cout ...
s630322622
p03822
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < n; i++) #define rep2(i, x, n) for(int i = x; i < n; i++) #define elif else if typedef long long ll; typedef pair<ll, ll> P; const ll MOD = 1e9+7; const ll MOD2 = 998244353; const ll INF = 1e15; int main(){ int N; cin >> N; i...
a.cc: In function 'int main()': a.cc:43:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 43 | if(count<n) //まだn人出ていなかったら更新しない | ~~~~~^~
s984733056
p03822
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(long long i=0;i<(long long)(n);i++) #define REP(i,k,n) for(long long i=k;i<(long long)(n);i++) #define all(a) a.begin(),a.end() #define eb emplace_back #define pb push_back #define lb(v,k) (lower_bound(all(v),k)-v.begin()) #define ub(v,k) (upper_bound...
a.cc:21:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts' 21 | bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;} | ^~~~ a.cc:21:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts' ...
s769400617
p03822
C++
#include <iostream> #include <cstdlib> #include <cmath> #include <vector> #include <map> #include <set> #include <algorithm> #include <queue> #include <stack> #include <functional> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef pair<ll,ll> P; typedef vector<P> vpl; #d...
a.cc: In function 'int main()': a.cc:57:32: error: no matching function for call to 'max(ll&, long long unsigned int)' 57 | if(d[i]!=inf) ans = max(ans,d[i] + G[i].size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, fr...
s121183641
p03822
C++
#include <bits/stdc++.h> #define ll long long #define sz size #define pb push_back using namespace std; const ll MAXN = 1e5 + 100; vector <ll> g[MAXN]; bool used[MAXN]; ll n, len[MAXN]; void dfs(ll v) { used[v] = 1; len[v] = 1; for(auto to : g[v]) { if(!used[to]) { dfs(to); ...
a.cc: In function 'int main()': a.cc:60:14: error: no matching function for call to 'max(long long int&, long long unsigned int)' 60 | ans = max(ans, g[i].sz() * 1ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-lin...
s996601994
p03822
C++
#include<bits/stdc++.h> #define INF 1e9 #define llINF 1e18 #define MOD 1000000007 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long #define ull unsigned long long #define vi vector<ll> #define vvi vector<vi> #define DBG_N(hoge) cerr<<" "<<(hoge)<<endl; #define DBG cerr<<"!...
a.cc: In function 'long long int dfs(long long int, long long int)': a.cc:32:35: error: 'cnt' was not declared in this scope; did you mean 'int'? 32 | num=(a.F>num)?a.F+a.S-1:num+cnt; | ^~~ | int
s668697644
p03822
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n+1); set<int> s; set<int> btm; for(int i = 2; i <= n; i++) { btm.insert(i); } for(int i = 2; i <= n; i++) { cin >> a[i]; if(a[i] == 1) { s.insert(i...
a.cc: In function 'int main()': a.cc:43:16: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'? 43 | int size = all.size(); | ^~~ | std::filesystem::perms::all In file included from /usr/include/c++/14/filesystem:51, ...
s678773824
p03822
C++
#include <algorithm> #include <assert.h> #include <bitset> #include <cfloat> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <...
a.cc: In function 'int main()': a.cc:52:26: error: no matching function for call to 'max(long long int&, long long unsigned int)' 52 | ans = max(ans, depth[i] + vec[i].size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s691952984
p03822
C++
#include <bits/stdc++.h> using namespace std; #define lli long long int #define REP(i,s,n) for(int i=s;i<n;i++) #define DEBUG 0 #define mp(a,b) make_pair(a,b) vector<lli> v[100010]; lli index1[100010]; int main(){ lli n; cin>>n; for(lli i=2;i<=n;i++){ lli tmp; cin>>tmp; v[tmp].push_back(i); } queue<ll...
a.cc: In function 'int main()': a.cc:43:30: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript 43 | index[top]++; | ^
s023716272
p03822
C++
#include <bits/stdc++.h> using namespace std; #define lli long long int #define REP(i,s,n) for(int i=s;i<n;i++) #define DEBUG 0 #define mp(a,b) make_pair(a,b) vector<lli> v[100010]; lli index[100010]; int main(){ lli n; cin>>n; for(lli i=2;i<=n;i++){ lli tmp; cin>>tmp; v[tmp].push_back(i); } queue<lli...
a.cc:11:17: error: 'long long int index [100010]' redeclared as different kind of entity 11 | lli index[100010]; | ^ In file included from /usr/include/string.h:462, from /usr/include/c++/14/cstring:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:12...
s731821134
p03822
C++
#include <iostream> #include <string> #include <utility> #include <stack> #include <vector> #include <queue> #include <algorithm> #include <map> #include <climits> #include <set> #include <cmath> #include <numeric> using namespace std; vector <int> edges[100000]; vector <int> reverse_edges[100000]; int in_degree[1000...
a.cc: In function 'int main()': a.cc:58:22: error: no matching function for call to 'min(int&, std::vector<int>::size_type)' 58 | dp[cur] = min(max_depth, min_depth + reverse_edges[cur].size() - 1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr...
s577423308
p03822
C++
#if 1 #include <iostream> #include <cmath> #include <string> #include <vector> #include <climits> #include <algorithm> #include <unordered_set> #include <unordered_map> #include <functional> #include <set> #include <numeric> #include <cassert> using namespace std; #define int long long #define uint unsigned long long ...
a.cc: In function 'void proc()': a.cc:70:29: error: redeclaration of 'long long int child' 70 | int child = *childs2[v].begin(); | ^~~~~ a.cc:69:27: note: 'long long int child' previously declared here 69 | for (auto child : childs2[v]) { ...
s212105678
p03822
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> using namespace std; typedef l...
a.cc: In function 'll dfs(ll)': a.cc:89:25: error: 'x' was not declared in this scope 89 | x[i] = dfs(G[a][i]); | ^ a.cc:91:22: error: 'x' was not declared in this scope 91 | sort(x,x+num); | ^
s998506556
p03822
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> using namespace std; typedef l...
a.cc: In function 'll dfs(ll)': a.cc:89:25: error: 'x' was not declared in this scope 89 | x[i] = dfs(G[a][i]); | ^ a.cc:91:22: error: 'x' was not declared in this scope 91 | sort(x,x+num); | ^
s104701297
p03822
C++
#include "bits/stdc++.h" #define ll long long #define rep2(i,a,b) for(int i=a;i<=b;++i) #define rep(i,n) for(int i=0;i<n;i++) #define pii pair<int,int> #define tii tuple<int,int,int> #define pq priority_queue<int> #define pqg priority_queue<int,vector<int>,greater<int>> #define pb push_back ll int MOD=998244353; #defin...
a.cc: In function 'int depth(int)': a.cc:29:9: error: 'temp' was not declared in this scope; did you mean 'tm'? 29 | temp--; | ^~~~ | tm a.cc: At global scope: a.cc:33:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 33 | main(){ | ^~~~
s849714063
p03822
C++
#include "bits/stdc++.h" #define ll long long #define rep2(i,a,b) for(int i=a;i<=b;++i) #define rep(i,n) for(int i=0;i<n;i++) #define pii pair<int,int> #define tii tuple<int,int,int> #define pq priority_queue<int> #define pqg priority_queue<int,vector<int>,greater<int>> #define pb push_back ll int MOD=998244353; #defin...
a.cc: In function 'int depth(int)': a.cc:28:16: error: no matching function for call to 'max(int&, std::vector<int>::size_type)' 28 | ans=max(ans,w[i]+w.size()-i); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-li...
s947020455
p03822
C++
#include "bits/stdc++.h" #define ll long long #define rep2(i,a,b) for(int i=a;i<=b;++i) #define rep(i,n) for(int i=0;i<n;i++) #define pii pair<int,int> #define tii tuple<int,int,int> #define pq priority_queue<int> #define pqg priority_queue<int,vector<int>,greater<int>> #define pb push_back ll int MOD=998244353; #defin...
a.cc: In function 'int depth(int)': a.cc:28:28: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?) 28 | ans=max(ans,w[i]+w.size-i); |...
s329893718
p03822
C++
#include <bits/stdc++.h> using namespace std; const int N = 100010; int _w; int n, a[N], in[N], d[N]; int q[N], begin, end; vector<int> v[N]; bool cmp( int i, int j ) { return d[i] < d[j]; } int main() { ios::sync_with_stdio(false); cin >> n; for( int i = 2; i <= n; ++i ) { cin >> a[i]; ++in[a[i]]; v[a[i]...
a.cc: In function 'int main()': a.cc:25:27: error: reference to 'end' is ambiguous 25 | q[end++] = i; | ^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/valarray:1265:5: note: ca...
s268353887
p03822
C++
#include<bits/stdc++.h> const int MX=100005; using namespace std; int n,f[MX],x[MX]; vector<int>G[MX]; void dfs(int k){ int c=0; for(auto i:G[k])dfs(i),x[++c]=f[i]; if(c){sort(x+1,x+c+1);for(int i=1;i<=c;i++)f[k]=max(f[k],x[c-i+1]+i);} } int main(){ cin>>n; for(int i=2,u;i<=n;i++)cin>>u,G[u].pb(i); dfs(1); cou...
a.cc: In function 'int main()': a.cc:15:44: error: 'class std::vector<int>' has no member named 'pb' 15 | for(int i=2,u;i<=n;i++)cin>>u,G[u].pb(i); | ^~
s462348733
p03822
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 'void dfs(int)': a.cc:27:28: error: reference to 'next' is ambiguous 27 | for (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 /usr/i...
s059753318
p03822
C++
#include <bits/stdc++.h> using namespace std; int N; int ans; vector <int> G[100001]; int sum = 0; int dfs(int v,int p) { for(int i = 0; i < G[v].size(); i++) { int u = G[v][i]; if(u != p) { sum = dfs(u,v); //cout <<v<<" "<< sum <<endl; } } return sum + 1; } int ma...
a.cc:48:5: error: redefinition of 'int N' 48 | int N; | ^ a.cc:4:5: note: 'int N' previously declared here 4 | int N; | ^ a.cc:49:5: error: redefinition of 'int ans' 49 | int ans; | ^~~ a.cc:5:5: note: 'int ans' previously declared here 5 | int ans; | ^~~ a.cc:50:14...
s334516555
p03822
C++
#include <iostream> #include <vector> using namespace std; typedef long long lli; lli n; vector<vector<lli> > g; lli ans = 0; lli dfs(lli x){ lli ret = 0; vector<lli> d; for(lli i = 0;i < g[x].size();i++){ d.push_back(dfs(g[x][i])); } sort(d.rbegin(),d.rend()); for(lli i = 0;i < d.size()...
a.cc: In function 'lli dfs(lli)': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(d.rbegin(),d.rend()); | ^~~~ | short
s380104285
p03822
C++
5 1 1 2 4 7 1 2 1 3 1 4 4 4 4 1
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^
s655180704
p03822
C++
#include<string> #include<iostream> #include<algorithm> #include<set> #include<math.h> #include<vector> #include<sstream> #include<queue> #include<functional> #include<bitset> #include<cstdio> #include<iomanip> #include <cstring> #include <climits> using namespace std; #define REP(i,n) for(int i=0;i < n; i++) #define R...
a.cc: In function 'void dfs(int)': a.cc:30:34: error: 'cmp' was not declared in this scope; did you mean 'bcmp'? 30 | sort(id + 1, id + k + 1, cmp); | ^~~ | bcmp
s337978560
p03822
Java
public class Main { static int n; static int[] a; static int[] dp; static Node[] node; public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); n=Integer.parseInt(br.readLine()); a=new int[n-1]; ...
Main.java:7: error: cannot find symbol public static void main(String[] args) throws IOException { ^ symbol: class IOException location: class Main Main.java:38: error: cannot find symbol ArrayList<Integer> next_list=new ArrayList<>(); ^ symbol: cl...
s460049139
p03822
Java
public class Main { static int n; static int[] a; static int[] dp; static Node[] node; public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); n=Integer.parseInt(br.readLine()); a=new int[n-1]; ...
Main.java:7: error: cannot find symbol public static void main(String[] args) throws IOException { ^ symbol: class IOException location: class Main Main.java:38: error: cannot find symbol ArrayList<Integer> next_list=new ArrayList<>(); ^ symbol: cl...
s929516340
p03822
C++
#include<iostream> #include<cmath> #include<stdio.h> #include<vector> #include<string> using namespace std; vector<int> AA[100000]; int tree(int a){ int ans,i; vector<int> tmp; for(i=0;i<AA[a].size();i++){ tmp.push_back(tree(AA[a][i]-1)); } sort(tmp.begin(),tmp.end()); ans=0; for(i...
a.cc: In function 'int tree(int)': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 16 | sort(tmp.begin(),tmp.end()); | ^~~~ | sqrt
s449634870
p03822
C++
#include <iostream> #include <unordered_map> #include <vector> #include <stack> #include <set> int N; std::vector<int> A; int main() { std::cin >> N; for (int i = 0; i < N - 1; ++i) { int a; std::cin >> a; A.push_back(a - 1); } std::unordered_map<int, std::vector<int>> wins; for (int i = 0; i < N;...
a.cc: In function 'int main()': a.cc:67:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 67 | std::sort(tmp.begin(), tmp.begin() + c); | ^~~~ | qsort
s777489197
p03822
C++
#include <bits/stdc++.h> using namespace std; vector< vector<int> > array; long long solve(int x) { if (array[x].size() == 0) { return 0LL; } else { long long ans = 0; for (int i = 0; i < array[x].size(); i++) { ans = max(ans, solve(array[x][i]) + 1, array[x].size()); ...
a.cc: In function 'long long int solve(int)': a.cc:8:9: error: reference to 'array' is ambiguous 8 | if (array[x].size() == 0) { | ^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_...
s238557551
p03822
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int MAX_N = 100000; int N, A[MAX_N]; vector<int> e[MAX_N]; int Solve(int n) { vector<int> depths; for (int i = 0; i < e[n].size(); i++) { depths.push_back(Solve(e[n][i])); } sort(depths.begin(), depths.end()); int res = 0; for (int i =...
a.cc: In function 'long long int Solve(long long int)': a.cc:21:26: error: no matching function for call to 'max(long long int&, long long unsigned int)' 21 | res = max(res, depths[i] + e[n].size() - i); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/in...
s417782511
p03822
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <cmath> #include <algorithm> #include <cstdlib> #include <fstream> #include <set> #include <queue> using namespace std; vector<vector<int>> graph; int ans = 0; dfs(int root, int depth) { if (depth > ans) ans = depth; for (int i = 0; ...
a.cc:18:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive] 18 | dfs(int root, int depth) { | ^~~ a.cc: In function 'int dfs(int, int)': a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type] 24 | } | ^
s214802051
p03822
C++
#include <bits/stdc++.h> #define rep(i, a, n) for(int i = a; i < n; i++) #define repb(i, a, b) for(int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl #define int long long using namespace std; typedef pair<int, int> P; vector<int> G[100010]; int dp[100010]; int INF = 1e9; int n; ...
a.cc: In function 'long long int dfs(long long int)': a.cc:25:5: error: 'MAX' was not declared in this scope 25 | MAX = -1; | ^~~
s382156570
p03822
Java
import java.util.*; public class Main{ public static void main(String[] args){ int i,j; int tmp=0; int ans=0; Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] a=new int[n-1];//2~n->0~n-2 List<Integer> loser=new ArrayList<Integer>(); for(i=0;i<n-1;i++){ a[i]=sc.nextInt...
Main.java:18: error: incompatible types: int cannot be converted to boolean if(a[j]=loser.get(i))tmp++; ^ 1 error
s758565699
p03822
C++
#include <bits/stdc++.h> using namespace std; const int maxn = 100005; int n; int a[maxn]; int main() { cin >> n; int ma = 0; for(int i = 0; i < n - 1; i++) { int x; scanf("%d", &x); a[x]++; ma = max(ma, a[x]); } cout << max(ma, (int)log2(n) + 1) << endl; retur...
a.cc:25:11: error: redefinition of 'const int maxn' 25 | const int maxn = 100005; | ^~~~ a.cc:5:11: note: 'const int maxn' previously defined here 5 | const int maxn = 100005; | ^~~~ a.cc:27:5: error: redefinition of 'int n' 27 | int n; | ^ a.cc:7:5: note: 'int n' pre...
s054000174
p03822
C++
#include <bits/stdc++.h> #define rep(i, a, n) for(int i = a; i < n; i++) #define repb(i, a, b) for(int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl #define int long long using namespace std; typedef pair<int, int> P; vector<int> G[100010]; int d[100010]; int INF = 1e9; int n; v...
a.cc: In function 'int main()': a.cc:34:18: error: no matching function for call to 'max(long long int&, long long unsigned int)' 34 | MAX = max(MAX, d[i] + G[i].size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/incl...
s557198010
p03822
C++
#include "bits/stdc++.h" using namespace std; #define int long long #define PB push_back #define MP make_pair #define ALL(V) V.begin(), V.end() typedef pair<int, int> pii; typedef pair<string, int> psi; typedef pair<int, pii> pipii; typedef pair<pii, pii> pipi; constexpr int INF = 1LL << 60; constexpr int MOD = 1000...
a.cc: In function 'long long int Solve(long long int, long long int)': a.cc:31:15: error: no matching function for call to 'min(long long int&, long long unsigned int)' 31 | return min(mx, mi + G[i].size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s867909983
p03822
C++
/* -------------------------------- */ /* Name: MD. Khairul Basar */ /* Institute: HSTU */ /* Dept: CSE */ /* Email: khairul.basar93@gmail.com */ /* -------------------------------- */ #include <bits/stdc++.h> /* all header files */ #define fs first #define ...
a.cc: In function 'int dfs(int, int)': a.cc:108:16: error: reference to 'next' is ambiguous 108 | for(i=0; i<next[x].size(); i++) | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, from /usr/include...
s224464678
p03822
C++
#include<iostream> 2.#include<cctype> 3.#include<vector> 4.#include<ctype.h> 5.#include<algorithm> 6.#include<queue> 7.#include<string> 8.#include<math.h> 9.#include<iomanip> 10.using namespace std; 11.long long n, m; vector<long long> a; 12.int main() { 13. cin >> n; 14. for (size_t i = 0; i < n + 1; i++) 15. { 16. a...
a.cc:2:3: error: stray '#' in program 2 | 2.#include<cctype> | ^ a.cc:3:3: error: stray '#' in program 3 | 3.#include<vector> | ^ a.cc:4:3: error: stray '#' in program 4 | 4.#include<ctype.h> | ^ a.cc:5:3: error: stray '#' in program 5 | 5.#include<algorithm> | ^ a.cc:6:3...
s341719423
p03822
C++
#include<iostream> #include<cctype> #include<vector> #include<ctype.h> #include<algorithm> #include<queue> #include<string> #include<math.h> #include<iomanip> using namespace std; long long n, m; vector<long long> a; int main() { cin >> n; for (size_t i = 0; i < n + 1; i++) { a.push_back(0); } for (size_t i = 2;...
a.cc: In function 'int main()': a.cc:29:18: error: expected '}' at end of input 29 | return 0; | ^ a.cc:12:12: note: to match this '{' 12 | int main() { | ^
s078604891
p03822
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cmath> #include <map> #include <queue> long long dfs(long long depth, long long p, std::vector<long long> v) { long long max_depth = 0; for (int i = 0; i < v.size(); i++) { if (v[i] == p) { max_depth = st...
a.cc: In function 'int main()': a.cc:32:23: error: no matching function for call to 'max(long long int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >, void>::difference_type)' 32 | max = std::max(max, std::count(v.begin(), v.end(), i + 1)); | ...
s343114616
p03822
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long ll; const int maxn = 111111; ll n, dp[maxn], a[maxn]; vector<int> G[maxn]; vector<ll> V; ll dfs(int x) { if(dp[x]) return dp[x]; dp[x] = 1; for(int i = 0; i < G[x].size(); i++) { int to = G[x][i]; ...
a.cc: In function 'll dfs(int)': a.cc:23:20: error: no matching function for call to 'max(ll&, long long unsigned int)' 23 | dp[x] = max(dp[x], V[i]+V.size()-i); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/...
s234411688
p03822
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using u32 = uint32_t; using vi = vector<int>; using vvi = vector<vi>; using vb = vector<bool>; using vvb = vector<vb>; using vl = vector<ll>; using vvl = vector<vl>; using vd = vector<double>; using vvd = vector<vd>; #...
a.cc: In lambda function: a.cc:44:34: error: no matching function for call to 'max(ll&, long long unsigned int)' 44 | ans = max(ans, a[i] + i + 1); | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/i...
s796496843
p03823
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using ld = long double; template <typename T> int sz(T &x) { return (int)(x.size()); } int power(int x, int y, int mod) { if (y == 0) { return 1; } int z = power(x, y >> 1, mod); z = z * 1ll * z % mod; if...
a.cc: In function 'void solve()': a.cc:52:14: error: return-statement with a value, in function returning 'void' [-fpermissive] 52 | return 0; | ^
s739861286
p03823
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using ld = long double; template <typename T> int sz(T &x) { return (int)(x.size()); } int power(int x, int y, int mod) { if (y == 0) { return 1; } int z = power(x, y >> 1, mod); z = z * 1ll * z % mod; if...
a.cc: In function 'void solve()': a.cc:78:14: error: return-statement with a value, in function returning 'void' [-fpermissive] 78 | return 0; | ^
s648818812
p03823
C++
#include<bits/stdc++.h> #define int long long #define ll long long #define ull unsigned long long using namespace std; const int maxn=100005; const int mod=1e9+7; int n,dp[maxn][2],nxt[2][maxn]; ll A,B,a[maxn],w[maxn]; template<class Type>Type read(){ Type res=0,f_f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if...
cc1plus: error: '::main' must return 'int'
s853058657
p03823
C++
#include <bits/stdc++.h> #define f first #define s second using namespace std; using ll = long long; using ii = pair<int, int>; constexpr ll MOD = 1e9+7; template<typename T> class fenwick_tree { private: vector<T> FT, vector<pair<int, T>> S; public: fenwick_tree(int N) { FT.assign(N + 5, 0); } void update(int x, T ...
a.cc:10:45: error: invalid declarator before 'S' 10 | private: vector<T> FT, vector<pair<int, T>> S; | ^ a.cc: In member function 'void fenwick_tree<T>::update(int, T)': a.cc:13:46: error: 'S' was not declared in this scope 13 | void update(int x, T val) {...
s404227036
p03823
C++
.
a.cc:1:1: error: expected unqualified-id before '.' token 1 | . | ^
s451239864
p03823
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> #include<limits.h> #include<cassert> #include<iterator> #include<complex> #in...
a.cc:192:1: error: stray '\16' in program 192 | <U+000E> | ^~~~~~~~
s047551598
p03823
C++
#include <iostream> using namespace std; typedef long long ll; const ll INF = 1000000000000000009; const ll MOD = 1000000007; ll s[100005]; int ca[100005], cb[100005]; ll dpa[100005], dpb[100005]; int main() { ll n, a, b; cin >> n >> a >> b; s[0] = -INF; for(int i = 1; i <= n; i++) cin >> s[i]; f...
a.cc: In function 'int main()': a.cc:28:21: error: 'upper_bound' was not declared in this scope 28 | int j = upper_bound(s, s + n + 1, s[i] - a) - s; | ^~~~~~~~~~~ a.cc:33:21: error: 'upper_bound' was not declared in this scope 33 | int j = upper_bound(s, s + n + ...
s669058141
p03823
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll,ll> pi; typedef vector<pi> vpi; typedef long double ld; #define pb emplace_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define ALL(x) x.begin(), x.end() #define SZ(x) (ll)x.size() #defin...
a.cc: In function 'void update(ll, ll, ll)': a.cc:24:44: error: 'MOD' was not declared in this scope 24 | for (;y;y-=y&(-y)){fw[y]+=v;fw[y]%=MOD;} | ^~~ a.cc:25:41: error: 'MOD' was not declared in this scope 25 | for (;x;x-=x&(-x)){fw[x]=(fw[x]+MOD...
s931587057
p03823
C++
#include <bits/stdc++.h> using namespace std; #define INF_LL (int64)1e18 #define INF (int32)1e9 #define REP(i, n) for(int64 i = 0;i < (n);i++) #define FOR(i, a, b) for(int64 i = (a);i < (b);i++) #define all(x) x.begin(),x.end() #define fs first #define sc second using int32 = int_fast32_t; using uint32 = uint_fast32_...
a.cc: In function 'int main()': a.cc:381:26: error: 'B' was not declared in this scope 381 | if (S[i+1] - S[i] >= B[0]) Bok = 1; | ^