submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s980224091
p03786
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq...
a.cc: In function 'int main()': a.cc:30:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 30 | ans=N-i; | ^~~ | abs a.cc:41:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 41 | cout<<ans<<endl; | ^~~ | abs
s063414468
p03786
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin >> N ; long long int a[100010],b[100010]; for (int i = 0; i < N; ++i) cin >> a[i]; sort(a,a+N); b[0] = a[0]; int ans = 0 res = N; for(int i=1;i<N;i++){ ...
a.cc: In function 'int main()': a.cc:19:15: error: expected ',' or ';' before 'res' 19 | int ans = 0 res = N; | ^~~ a.cc:24:7: error: 'res' was not declared in this scope 24 | res -= ans; | ^~~ a.cc:33:12: error: 'res' was not declared in this scope 33 | cout << res <...
s792158402
p03786
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin >> N ; long long int a[100010],b(N+1,0); for (int i = 0; i < N; ++i) cin >> a[i]; sort(a,a+N); b[0] = a[0]; int ans = 0 res = N; for(int i=1;i<N;i++){ ...
a.cc: In function 'int main()': a.cc:10:35: error: expression list treated as compound expression in initializer [-fpermissive] 10 | long long int a[100010],b(N+1,0); | ^ a.cc:18:6: error: invalid types 'long long int[int]' for array subscript 18 | b[0] = a[0]; ...
s955616637
p03786
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin >> N ; vector<long long> a(N),b(N+1,0); for (int i = 0; i < N; ++i) cin >> a[i]; sort(a,a+N); b[0] = a[0]; int ans = 0 res = N; for(int i=1;i<N;i++){ ...
a.cc: In function 'int main()': a.cc:16:17: error: no match for 'operator+' (operand types are 'std::vector<long long int>' and 'int') 16 | sort(a,a+N); | ~^~ | | | | | int | std::vector<long long int> In file included from /...
s565748745
p03786
C++
#include<bits/stdc++.h> using namespace std; int main(){ using ll = intfast64_t; int n; cin >> n; vector<ll> a(n); for(auto&& x:a)cin >> x; sort(a.begin(), a.end()); vector<ll> b(a); for(int i=0;i<n-1;i++) b[i+1] += b[i]; int f = 0; for(int i=0;i<n-1;i++){ cerr << i << " " << b[i] << " " <...
a.cc: In function 'int main()': a.cc:6:14: error: 'intfast64_t' does not name a type; did you mean 'int_fast64_t'? 6 | using ll = intfast64_t; | ^~~~~~~~~~~ | int_fast64_t a.cc:9:10: error: 'll' was not declared in this scope 9 | vector<ll> a(n); | ^~ a.c...
s291430026
p03786
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { // Your code here! Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] array = new long[n]; int max = 0; for (int i = 0; i < n; i++) { array[i]...
Main.java:12: error: incompatible types: possible lossy conversion from long to int max = Math.max(max, array[i]); ^ 1 error
s865735306
p03786
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++) #define ALL(v) (v).begin(), (v).end() #define PUTS(x) cout << (x) << endl; vector<Int> IntsIn(int n) { auto v = vector<Int>(0); for (int i = 0; i < n; i++) { Int a; cin >> a; ...
a.cc:6:8: error: 'Int' was not declared in this scope; did you mean 'int'? 6 | vector<Int> IntsIn(int n) { | ^~~ | int a.cc:6:11: error: template argument 1 is invalid 6 | vector<Int> IntsIn(int n) { | ^ a.cc:6:11: error: template argument 2 is invalid a.cc: In function...
s830624400
p03786
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++) #define ALL(v) (v).begin(), (v).end() #define PUTS(x) cout << (x) << endl; using Int = long long; int main() { Int n; cin >> n; auto v = IntsIn(n); sort(ALL(v)); Int ans = 0; Int...
a.cc: In function 'int main()': a.cc:10:14: error: 'IntsIn' was not declared in this scope 10 | auto v = IntsIn(n); | ^~~~~~
s107838125
p03786
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (int i=0;i<n;i++) cin >> a[i]; sort(a.begin(),a.end()); int ans=0; ll s=a[0]; for (int i=1;i<n;i++) { if (a[i]>2*s) ans=i; s+=a[i]; } cout << n-ans << endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'll' was not declared in this scope 11 | ll s=a[0]; | ^~ a.cc:13:20: error: 's' was not declared in this scope 13 | if (a[i]>2*s) ans=i; | ^ a.cc:14:9: error: 's' was not declared in this scope 14 | s+=a[i]...
s746070171
p03786
C++
using ll=long long; using namespace std; int main() { ll N; ll g; vector<ll>A; vector<ll>B; cin >> N; for (ll i = 0; i < N; i++) { cin >> g; A.push_back(g); B.push_back(0); } sort(A.begin(),A.end()); ll count=0; for (ll j = 0; j <=N; j++) { B[N-1] += A[j]; } for (ll i=N-2; 0<=i; i--) { B[i] -=...
a.cc: In function 'int main()': a.cc:8:9: error: 'vector' was not declared in this scope 8 | vector<ll>A; | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | using ll=long long; a.cc:8:...
s871268084
p03786
C++
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define int long long using namespace std; const int MAXN = 100 * 1000 + 23; int n, a[MAXN], ps[MAXN], ans; int main() { cin >> n; for (in...
cc1plus: error: '::main' must return 'int'
s609982664
p03786
C++
#include <iostream> #include <utility> using namespace std; typedef long long ll; typedef pair<ll, int> P; int main() { int n; cin >> n; ll a[100002]; P p[100002]; for(int i = 0; i < n; i++){ cin >> a[i]; p[i] = P(a[i], i); } sort(p, p + n); int les = 0; for(int i = ...
a.cc: In function 'int main()': a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(p, p + n); | ^~~~ | short
s867239280
p03786
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define co(a) cout<<a<<endl #define sz size #define bgn begin() #define en end() #define pb(a) push...
a.cc: In function 'int main()': a.cc:150:22: error: conflicting declaration 'std::vector<long long int> d' 150 | vector<int> b(a),c,d(a); | ^ a.cc:148:9: note: previous declaration as 'long long int d' 148 | int a,d,e=0,f=0; | ^ a.cc:153:4: error: invalid types 'long lon...
s443065031
p03786
C++
#include <iostream> #include <vector> int main() { int N; scanf("%d", &N); std::vector<long long> A(N); for(int i=0; i<N; i++) scanf(" %lld", &A[i]); std::sort(A.begin(), A.end()); std::vector<long long> sum(1, A[0]); for(int i=1; i<N; i++) sum.push_back(sum.back() + A[i]); for(in...
a.cc: In function 'int main()': a.cc:11:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 11 | std::sort(A.begin(), A.end()); | ^~~~ | qsort
s601217829
p03786
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long ll; int Judge(int tag, vector<ll> &d) { ll i, x = 0; for (i = 0; i <= tag; i++) x += d[i]; for (; i < d.size(); i++) { if ((x << 1) < d[i]) return false; x += d[i]; } return true; } int Search(vector<ll> &...
a.cc: In function 'int main()': a.cc:35:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 35 | scanf_s("%lld", &d[i]); | ^~~~~~~ | scanf
s243366976
p03786
C++
#include <bits/stdc++.h> using namespace std; #define MAX 300001 lll A[MAX], B[MAX], C[1001][1001]; vll vA, vB; lll T,n,i,j,k,a,b,c,m,u,v,x,y,l,r,s,e,ans; string sA, sB, sC[MAX]; int main(){ cin >> n; for (i=0;i<n;i++){cin >> A[i];} sort(A, A + n); B[0] = A[0]; A[n] = 0; for (i=1;i<=n...
a.cc:8:1: error: 'lll' does not name a type 8 | lll A[MAX], B[MAX], C[1001][1001]; | ^~~ a.cc:9:1: error: 'vll' does not name a type 9 | vll vA, vB; | ^~~ a.cc:10:1: error: 'lll' does not name a type 10 | lll T,n,i,j,k,a,b,c,m,u,v,x,y,l,r,s,e,ans; | ^~~ a.cc: In function 'int main()': a.cc:...
s569577847
p03786
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace st...
a.cc:92:7: error: macro "REP" requires 2 arguments, but only 1 given 92 | REP() | ^ a.cc:2:9: note: macro "REP" defined here 2 | #define REP(i,n) for(int i=0;i<n;i++) | ^~~ a.cc: In function 'bool func(int, std::vector<long long int>)': a.cc:92:3: error: 'REP' was not declared in this...
s199056103
p03786
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace st...
a.cc:92:7: error: macro "REP" requires 2 arguments, but only 1 given 92 | REP() | ^ a.cc:2:9: note: macro "REP" defined here 2 | #define REP(i,n) for(int i=0;i<n;i++) | ^~~ a.cc: In function 'bool func(int, std::vector<long long int>)': a.cc:92:3: error: 'REP' was not declared in this...
s668075773
p03786
C++
#include <algorithm> #include <bitset> #include <cassert> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; typedef pair<int, pii> pipii; ll...
a.cc: In function 'void solve()': a.cc:31:26: error: expected ';' before ')' token 31 | for(int i = n-1; i >= 0) { | ^ | ;
s045072064
p03786
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin >>n; vector<int>a(n); for(auto&& w:a)cin>>w; sort(begin(a),end(a)); vector<int>s(n+1,0); for(int i=0;i<n;i++){ s[i+1]=s[i]+a[i];} int num=n-1; bool flg=false; for(int i=n-2;i>=0;i--){ if(a[i+1]>2*s[i+1]){ num=i; flg=true; break; } }...
a.cc:23:9: error: expected unqualified-id before 'else' 23 | } else cout<<1<<endl; | ^~~~
s569824582
p03786
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin >>n; vector<int>a(n); for(auto&& w:a)cin>>w; sort(begin(a),end(a)); vector<int>s(n+1,0); for(int i=0;i<n;i++){ s[i+1]=s[i]+a[i];} int num=n-1; bool flg=false; for(int i=n-2;i>=0;i--){ if(a[i+1]>2*s[i+1]){ num=i; flg=true; break; } ...
a.cc: In function 'int main()': a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s382029460
p03786
C++
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; int main(){ ll n; cin >> n; ll a[n]; for(int i=0;i<n;i++) cin >> a[i]; sort(a,a+n); ll sum[n]; sum[0]=a[0]; for(int i=1;i<n;i++){ sum[i]=sum[i-1]+a[i]; } int x=0; for(int i=0;i<n-1;i++){ if(2*sum[i]<a[i+1...
a.cc: In function 'int main()': a.cc:24:24: error: expected ';' before '}' token 24 | cout << n-x-1 << endl | ^ | ; 25 | } | ~
s057004892
p03786
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,i,a[111111],sum[111111]; cin>>n; cin>>a[0]; sum[0]=a[0]; for(i=1;i<n;i++){ cin<<a[i]; sum[i]=sum[i-1]+a[i]; } sort(a,a+n); i=1; while(1){ if(sum[n-i-1]*2<a[n-i]){ cout<<i<<endl; return 0; } i++; if(i=...
a.cc: In function 'int main()': a.cc:10:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | cin<<a[i]; | ~~~^~~~~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:10:8: note: ca...
s204893338
p03786
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define f(i,n) for(ll i=0;i<n;++i) #define pie 3.141592653589793238462643383279 #define mod 1e9+7 int x[100000],y[100000]; signed main(){ int n; cin>>n; f(i,n){ cin>>x[i]; } sort(x,x+n); f(i,n){ y[i]=x[i]; if(i) y[i]+=y[i-1]; } for(int i=n...
a.cc: In function 'int main()': a.cc:4:20: error: 'll' was not declared in this scope 4 | #define f(i,n) for(ll i=0;i<n;++i) | ^~ a.cc:11:9: note: in expansion of macro 'f' 11 | f(i,n){ | ^ a.cc:11:11: error: 'i' was not declared in this scope 11 | f(i,n)...
s367207645
p03786
Java
vimport java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out); InputStreamScanner in = new InputStreamScanner(System.in); new Main().solve(in...
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...
s119735629
p03786
C++
#include <iostream> #include <cstdio> #include <queue> #include <stdlib.h> #include <stack> #include <string.h> #include <set> #include <iomanip> #include <ctime> #include <map> #include <cmath> #include <algorithm> #include <sstream> #include <cstring> #define eps 1e-15 #define ull unsigned long long //priority_queue<...
a.cc: In function 'bool check(int)': a.cc:42:10: error: 'a' was not declared in this scope 42 | ll s=a[mid]; | ^ a.cc:43:19: error: 'n' was not declared in this scope 43 | for(int j=0;j<n;j++) | ^ a.cc: In function 'int main()': a.cc:58:10: error: 'n' was not declare...
s017673095
p03786
C++
#include <iostream> #include <cstdio> #include <queue> #include <stdlib.h> #include <stack> #include <string.h> #include <set> #include <iomanip> #include <ctime> #include <map> #include <cmath> #include <algorithm> #include <sstream> #include <cstring> #define eps 1e-15 #define ull unsigned long long //priority_queue<...
a.cc:63:11: error: redefinition of 'const int inf' 63 | const int inf = 0x3f3f3f3f; | ^~~ a.cc:24:11: note: 'const int inf' previously defined here 24 | const int inf = 0x3f3f3f3f; | ^~~ a.cc:64:11: error: redefinition of 'const int mod' 64 | const int mod = 1e9+7; | ...
s067021893
p03786
C++
#include <iostream> #include <cstdio> #include <queue> #include <stdlib.h> #include <stack> #include <string.h> #include <set> #include <iomanip> #include <ctime> #include <map> #include <cmath> #include <algorithm> #include <sstream> #include <cstring> #define eps 1e-15 #define ull unsigned long long //priority_queue<...
a.cc:63:11: error: redefinition of 'const int inf' 63 | const int inf = 0x3f3f3f3f; | ^~~ a.cc:24:11: note: 'const int inf' previously defined here 24 | const int inf = 0x3f3f3f3f; | ^~~ a.cc:64:11: error: redefinition of 'const int mod' 64 | const int mod = 1e9+7; | ...
s170813174
p03786
C++
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n,j=0; cin>>n vector<ll> a(n); for(int i=0;i<n;i++) cin>>a[i]; sort(a.begin(),a.end()); for(int i=1;i<n;i++){ if(a[i-1]*2<a[i]){ j=i; } a[i]+=a[i-1]; } cout<<n-j; }
a.cc: In function 'int main()': a.cc:6:9: error: expected ';' before 'vector' 6 | cin>>n | ^ | ; 7 | vector<ll> a(n); | ~~~~~~ a.cc:8:29: error: 'a' was not declared in this scope 8 | for(int i=0;i<n;i++) cin>>a[i]; | ^ a.cc:9:8: e...
s206116993
p03786
C++
N = int(input()) a = input().split() for i in range(0,N): a[i] = int(a[i]) a.sort() t = 0 flag = 1 i = 0 while flag: if a[i]*2 > a[i+1]: t = i flag = 0 else: i += 1 print(N-t)
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s885988536
p03786
C++
#include <iostream> #include <fstream> #include <cmath> #include <cstdlib> #include <ctime> #include <algorithm> #include <numeric> #include <functional> #include <string> #include <vector> #include <bitset> #include <map> #include <set> #include <stack> #include <queue> #include <deque> using namespace std; using ...
a.cc: In function 'int main()': a.cc:574:228: error: no matching function for call to 'std::priority_queue<std::pair<long long int, int>, std::vector<std::pair<long long int, int> >, std::function<bool(std::pair<long long int, int>, std::pair<long long int, int>)> >::priority_queue(main()::<lambda(std::pair<long long i...
s947328726
p03786
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; long long a[100000]; for(int i = 0; i < n; i++){ cin >> a[i]; } sort(a,a+n); long long sum = 0; int cnt = 0; for(int i = 0; i < n; i++){ sum += a[i]; if(i==n-1){ cnt++; ...
a.cc: In function 'int main()': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a,a+n); | ^~~~ | short
s033535672
p03786
C++
#include <bits/stdc++.h> #define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(long long int i=(a);i<(b);i++) #define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Abs(a,b) max(a,b)-min(a,b) #define YES(condition...
a.cc: In function 'int main()': a.cc:140:33: error: expected ')' before '{' token 140 | if((sum[i-1]*2>=a[i]){ | ~ ^ | ) a.cc:143:8: error: expected primary-expression before '}' token 143 | } | ^
s348584685
p03786
C
#include<stdio.h> #include<algorithm> using namespace std; int main() { int i,n,a[100005],temp=1; long long sum; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); sort(a,a+n); sum=(long long)a[0]; for(i=1;i<n;i++) { if(sum*2<=(long long)a[i]) { temp=1; sum+=(long long)a[i]; } else { t...
main.c:2:9: fatal error: algorithm: No such file or directory 2 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s250058038
p03786
C
#include<stdio.h> #include<algorithm> using namespace std; int main() { int a[100003]; int i,j,n,k,sum,m,flag; while(scanf("%d",&n)!=EOF) { for(i=0;i<n;i++) { scanf("%d",&a[i]); } sum=0; sort(a,a+n); k=0; for(i=0;i<n-1;i++) { k+=a[i]; m=k; for(j=i+1;j<n;j++) { flag=1; if(a[j]...
main.c:2:9: fatal error: algorithm: No such file or directory 2 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s705076400
p03786
C++
#include<stdio.h> #include<math.h> #include<algorithm> #include<queue> #include<deque> #include<string> #include<string.h> #include<vector> #include<set> #include<map> #include<stdlib.h> using namespace std; const long long mod=1000000007; const long long inf=mod*mod; const long long d2=500000004; int b[110000]; int ma...
a.cc:44:17: error: redefinition of 'const long long int mod' 44 | const long long mod=1000000007; | ^~~ a.cc:13:17: note: 'const long long int mod' previously defined here 13 | const long long mod=1000000007; | ^~~ a.cc:45:17: error: redefinition of 'const long long int...
s262361173
p03786
C++
#include <bits/stdc++.h> using namespace std; #define int long long typedef long long ll; typedef unsigned long long ull; typedef unsigned __int128 HASH; typedef pair<int,int> pii; typedef pair<ll, ll> pll; typedef pair<ull, ull> pullull; typedef pair<ll,int> plli; typedef pair<double, int> pdbi; typedef pair<int,pii>...
a.cc: In function 'int main()': a.cc:57:32: error: no matching function for call to 'max(int, long long int)' 57 | sum[i] = a[i] + sum[max(0, i - 1)]; | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/...
s286014439
p03786
C++
#include <bits/stdc++.h> using namespace std; #define x first #define y second #define dbg(x) cout << #x << '=' << x << '\n'; #define ll long long #define pi pair<int,int> #define pl pair<long long,long long> #define lg length() #define pb push_back ifstream in("file.in"); ofstream out("file.out"); #define MAXN 100005 ...
a.cc: In function 'bool good(int)': a.cc:21:23: error: no matching function for call to 'min(int&, long long int&)' 21 | for(int i=1;i<=min(x,n);i++) s+=a[i]; | ~~~^~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bit...
s546844677
p03786
C++
// 簡易競プロテンプレ #include <bits/stdc++.h> #define ll long long using namespace std; ll n; ll a[114514], s[114514]; bool ok(int m){ if (m<0) return false; if (m>=n) return true; ll w = s[m+1]; for(int i=m+1;i<n;i++){ if (w * 2 < a[i]) return false; w += a[i]; } return true; } int main(void){ cin >> n; for(int i...
a.cc: In function 'int main()': a.cc:30:10: error: 'med' was not declared in this scope 30 | cout << med << endl; | ^~~
s071387575
p03786
C++
// 簡易競プロテンプレ #include <bits/stdc++.h> #define ll long long using namespace std; ll n; ll a[114514], s[114514]; bool ok(int m){ if (m<0) return false; if (m>=n) return true; ll w = s[m+1]; for(int i=m+1;i<n;i++){ if (w * 2 < a[i]) return false; w += a[i]; } return true; } int main(void){ cin >> n; for(int i...
a.cc: In function 'int main()': a.cc:20:9: error: request for member 'begin' in 'a', which is of non-class type 'long long int [114514]' 20 | sort(a.begin(), a.end()); | ^~~~~ a.cc:20:20: error: request for member 'end' in 'a', which is of non-class type 'long long int [114514]' 20 | sort(a.begin(...
s040152601
p03786
Java
package spring; import java.util.*; public class ColorfulCreatures { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int N=s.nextInt(); double A[]=new double[N]; double B=0;; int i=0; int count=1; for(i=0;i<N;i++){ A[i]=s.nextInt...
Main.java:5: error: class ColorfulCreatures is public, should be declared in a file named ColorfulCreatures.java public class ColorfulCreatures { ^ 1 error
s289361716
p03786
Java
import java.util.Scanner; public class main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int N=s.nextInt(); double A[]=new double[N]; double B[]=new double[N]; int i=0,j=0; int color=0; int count=0; for(i=0;i<N;i++){ A[i...
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s971055163
p03786
Java
import java.util.Scanner; public class ColorfulCreatures { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int N=s.nextInt(); double A[]=new double[N]; double B[]=new double[N]; int i=0,j=0; int color=0; int count=0; for(i=0;i<N...
Main.java:3: error: class ColorfulCreatures is public, should be declared in a file named ColorfulCreatures.java public class ColorfulCreatures { ^ 1 error
s659994796
p03786
Java
package spring; import java.util.Scanner; public class ColorfulCreatures { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int N=s.nextInt(); double A[]=new double[N]; double B[]=new double[N]; int i=0,j=0; int color=0; int count=0;...
Main.java:5: error: class ColorfulCreatures is public, should be declared in a file named ColorfulCreatures.java public class ColorfulCreatures { ^ 1 error
s941535304
p03786
Java
package spring; import java.util.Scanner; public class ColorfulCreatures { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int N=s.nextInt(); double A[]=new double[N]; double B[]=new double[N]; int i=0,j=0; int color=0; int count=0; ...
Main.java:5: error: class ColorfulCreatures is public, should be declared in a file named ColorfulCreatures.java public class ColorfulCreatures { ^ 1 error
s107040072
p03786
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int a[] = new int[n]; int b[] = new int[n]; int total = 0; for(int i=0;i<n;i++){ a[i]=scan.nextInt(); b[i]=a[i]; total...
Main.java:47: error: reached end of file while parsing } ^ 1 error
s786899412
p03786
Java
import java.util.Arrays; import java.util.Scanner; public class creatures { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = s.nextInt(); } Arrays.sort...
Main.java:5: error: class creatures is public, should be declared in a file named creatures.java public class creatures { ^ 1 error
s283010701
p03786
C++
//#include "stdafx.h" #include <iostream> #include <vector> #include <algorithm> using namespace std; #define int long long #define REP(N,i) for(int i = 0;i < N; i++) #define RREP(N, i) for(int i = N - 1; 0 <= i;i--) #define DUMPI(i) cout << i << endl; #define DUMPII(i,j) cout << i << "," << j << endl; int N; int A[...
a.cc: In function 'int main()': a.cc:25:17: error: 'memset' was not declared in this scope 25 | memset(Ab, false, N); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <algorithm> +++ |+...
s064338261
p03786
C++
typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; int N; int A[100000]; int cnt; void solve() { cin >> N; rep(i, N) { cin >> A[i]; } sort(A, A+N); cnt = N; int i; ll sum = 0; bool flag; for(i = 0; i < N - 1; i++) { sum += A[i]; if(sum * 2 < A[i + 1]) { ...
a.cc:3:9: error: 'pair' does not name a type 3 | typedef pair<int, int> P; | ^~~~ a.cc: In function 'void solve()': a.cc:10:3: error: 'cin' was not declared in this scope 10 | cin >> N; | ^~~ a.cc:11:7: error: 'i' was not declared in this scope 11 | rep(i, N) { | ^ a.cc:1...
s575282906
p03786
C++
#include<ctime> #include<iostream> #include<algorithm> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<cassert> #include<string> #include<sstream> #include<fstream> #include<deque> #include<queue> #include<vector> #include<map> #include<list> #include<stack> #include<set> #include<bitset>...
a.cc: In function 'int main()': a.cc:66:20: error: '\U0000ff08ll\U0000ff09a' was not declared in this scope 66 | if((ll)a[i+1]>cur*2)ans++,cur=0; | ^~~~~~~
s929342347
p03786
C++
3 3 1 4
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 | ^
s211809532
p03786
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long ll; int main() { ll N, m = -1; vector<int> A; cin >> N; for (int i=0; i<N; i++) { int tmp; cin >> tmp; m = max(m, tmp); A.push_back(tmp); } sort(A.begin(), A.end()); ll ans = N, now = 0; ...
a.cc: In function 'int main()': a.cc:15:12: error: no matching function for call to 'max(ll&, int&)' 15 | m = max(m, tmp); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14...
s129157018
p03786
C++
#include <bits/stdc++.h> using namespace std; const int maxn = 100005; struct creature { int color, size; }; int n; creature a[maxn]; int ok[maxn]; int sum[maxn]; int cmp(creature x, creature y) { return x.size < y.size; } void work() { memset(ok, 0, sizeof ok); memset(sum, 0, sizeof sum); sort(a+1, a+n+1, cm...
a.cc: In function 'void work()': a.cc:23:37: error: incompatible types in assignment of 'int' to 'int [100005]' 23 | for(int i=1; i<=n; i++) sum = sum[i-1] + a[i].size; | ~~~~^~~~~~~~~~~~~~~~~~~~~~
s930533915
p03786
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <stdlib.h> #define MOD 1000000007 void input_array(int how_data,int *data); int get_random(int min, int max); int factorial(int n); int qsort_09(const int *sys1 , const int *sys2); int qsort_90(const int *sys1 , const int *sys2); int...
/usr/bin/ld: /tmp/cccg1AH7.o: in function `main': main.c:(.text+0x82): undefined reference to `input_array' /usr/bin/ld: main.c:(.text+0x93): undefined reference to `qsort_09' collect2: error: ld returned 1 exit status
s018649308
p03786
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <cstdio> #include <utility> using namespace std; int main() { int n; cin >> n; vector<long long> a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); //累積わ vector<long long > b(n); b[0] = a[0...
a.cc: In function 'int main()': a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'short'? 18 | sort(a.begin(), a.end()); | ^~~~ | short
s797764951
p03786
C++
#include <iostream> #include <vector> using namespace std; typedef long long lli; lli n; vector<lli> a; lli sum = 0; int main(int argc, char const *argv[]) { cin >> n; a = vector<lli> (n); for(lli i = 0;i < n;i++) cin >> a[i]; sort(a.begin(),a.end()); lli j; for(lli i = 0;i < n;i++){ if(...
a.cc: In function 'int main(int, const char**)': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a.begin(),a.end()); | ^~~~ | short
s016787538
p03787
C++
#include <bits/stdc++.h> #include "../lib/data_structure/union_find.hpp" using namespace std; #define SZ(x) (int)(x.size()) #define REP(i, n) for(int i=0;i<(n);++i) #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define RREP(i, n) for(int i=(int)(n);i>=0;--i) #define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i) #...
a.cc:2:10: fatal error: ../lib/data_structure/union_find.hpp: No such file or directory 2 | #include "../lib/data_structure/union_find.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s792227953
p03787
C++
#include <bits/stdc++.h> #include "../lib/data_structure/union_find.hpp" using namespace std; #define SZ(x) (int)(x.size()) #define REP(i, n) for(int i=0;i<(n);++i) #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define RREP(i, n) for(int i=(int)(n);i>=0;--i) #define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i) #...
a.cc:2:10: fatal error: ../lib/data_structure/union_find.hpp: No such file or directory 2 | #include "../lib/data_structure/union_find.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s077209011
p03787
C++
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
In file included from /usr/include/c++/14/cassert:44, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106, from a.cc:24: a.cc: In function 'int main()': a.cc:90:19: error: 'used' was not declared in this scope 90 | REP(i,n) assert(used[i]==1); | ^~~...
s498418895
p03787
C++
#include<iostream> #include<algorithm> #include<vector> #include<queue> using namespace std; typedef long long ll; #define int ll vector<ll> node[100005]; ll groups[100005]={0},group_num[100005]={0},col[100005]={0}; bool used[100005]={0}; bool dfs(ll pos,ll k,ll cl){ used[pos]=true; groups[pos]=k; col[pos]=cl; ...
a.cc: In function 'int main()': a.cc:46:7: error: 'group' was not declared in this scope; did you mean 'groups'? 46 | group[i]=cnct_num; | ^~~~~ | groups
s066881471
p03787
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using Pi = pair<int, int>; using Pl = pair<ll, ll>; using vint = vector<int>; using vll = vector<ll>; template<typename T> using uset = unordered_set<T>; template<typename T1, typename T2> using umap = unordere...
a.cc: In function 'int main()': a.cc:53:38: 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 '()' ?) 53 | if (G[i].size > 0) ...
s323620464
p03787
C++
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef long long ll; ll N, M, color[100001], A, B, C; vector<int> G[100001]; bool dfs(int now, int c){ color[now] = c; for(int i=0; i<G[now].size(); i++){ if(color[G[now][i]] != -1){ if(color[G[now][i]] == c) return false; continue; }...
a.cc: In function 'void dfs2(int)': a.cc:24:11: error: 'i' was not declared in this scope 24 | for(not i=0; i<G[now].size(); i++){ | ^
s188845094
p03787
C++
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef long long ll; ll N, M, color[100001], A, B, C; vector<int> G[100001]; bool dfs(int now, int c){ color[now] = c; for(int i=0; i<G[now].size(); i++){ if(color[G[now][i]] != -1){ if(color[G[now][i]] == c) return false; continue; }...
a.cc: In function 'void dfs2(int)': a.cc:24:11: error: 'i' was not declared in this scope 24 | for(not i=0; i<G[now].size(); i++){ | ^
s933627242
p03787
C++
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef long long ll; int N, M, color[100001], cnt, cnt1, cnt2, used[100001]; vector<int> G[100001]; bool dfs(int now, int c){ color[now] = c; if(c == 1) cnt1++; else cnt2++; for(int i=0; i<G[now].size(); i++){ if(color[G[now][i]] != -1){ ...
a.cc: In function 'void dfs2(int)': a.cc:28:28: error: too few arguments to function 'bool dfs(int, int)' 28 | dfs(G[now][i]); | ~~~^~~~~~~~~~~ a.cc:9:6: note: declared here 9 | bool dfs(int now, int c){ | ^~~ a.cc: In function 'int main()': a.cc:3...
s565468991
p03787
C++
//#include<bits/stdc++.h> #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 long long N = 1000 * 100 + 5; long long c...
a.cc: In function 'void dfs2()': a.cc:41:9: error: 'memset' was not declared in this scope 41 | memset(c , -1 , sizeof c); | ^~~~~~ a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 14 | #include<numeric> +++ |+#include <cst...
s757136007
p03787
C++
#include<bits/stdc++.h> //ios::sync_with_stdio(false);cin.tie(0); using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<pii,int> ppii; typedef pair<int,pii> pipi; typedef pair<ll,ll> pll; typedef pair<pll,ll> ppll; typedef pair<ll,pll> plpl; typedef tuple<ll,...
a.cc: In function 'int main()': a.cc:72:9: error: 'now' was not declared in this scope; did you mean 'pow'? 72 | col[now]=0; | ^~~ | pow
s810678508
p03787
C++
/*Program from Luvwgyx*/ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn=1e5+10; const int maxm=2e5+10; struct node{int to,nxt;}e[maxm<<1]; int tot,p,c,d,flag,head[maxn],deg[maxn],vis[maxn],col[maxn]; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(...
a.cc:16:6: error: variable or field 'print' declared void 16 | void print(ll x){ | ^~~~~ a.cc:16:12: error: 'll' was not declared in this scope 16 | void print(ll x){ | ^~ a.cc:21:6: error: variable or field 'write' declared void 21 | void write(ll x){print(x);puts("");} | ...
s121072927
p03787
C++
#include<cstdio> #include<algorithm> using namespace std; typedef long long ll; ll dsu[100005],vis[100005],m,x,y,z,u,v,n,i,sum=0,tmp=0; vector<ll> s[100005]; void dfs(int p,int f) { ll i,v; sum++; vis[p]=1; for(i=0;i<s[p].size();i++) { v=s[p][i]; if(vis[v]&&v!=f)tmp=1; if(vis[v])continue; dfs(v,p); } } in...
a.cc:6:1: error: 'vector' does not name a type 6 | vector<ll> s[100005]; | ^~~~~~ a.cc: In function 'void dfs(int, int)': a.cc:12:19: error: 's' was not declared in this scope 12 | for(i=0;i<s[p].size();i++) | ^ a.cc: In function 'int main()': a.cc:27:17: error: 's' was not ...
s079184082
p03787
C++
#include<bits/stdc++.h> #define ll long long #define ull unsigned ll #define uint unsigned #define db long double #define pii pair<int,int> #define pll pair<ll,ll> #define IT iterator #define PB push_back #define MK make_pair #define LB lower_bound #define UB upper_bound #define EB emplace_back #define fi first #defi...
a.cc: In function 'int main()': a.cc:57:37: error: expected primary-expression before ')' token 57 | else if (check(i,0,-)) Q++; | ^
s329047923
p03787
C++
dtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjyk
a.cc:1:1: error: 'dtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjyk' does not name a type 1 | dtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjykdtjhyjyk | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s450850282
p03787
C++
#include <cstdio> #include <cstring> #include <algorithm> #define repu(i,x,y) for (int i=x; i<=y; ++i) using namespace std; typedef long long LL; int n,m,cnt0,cnt1,cnt2,c[100100]; struct edge { int v; edge *nxt; } pool[400100],*tp=pool,*fst[100100]; int getint() { char ch; while (!isdigit(ch=getchar()...
a.cc: In function 'int getint()': a.cc:18:13: error: 'isdigit' was not declared in this scope 18 | while (!isdigit(ch=getchar())); | ^~~~~~~ a.cc:20:12: error: 'isdigit' was not declared in this scope 20 | for (; isdigit(ch=getchar()); x=x*10+ch-'0'); | ^~~~~~~
s991251664
p03787
C++
#include<bits/stdc++.h> #define MAXN 1000000+10 using namespace std; int n,m,I,P,Q; int tot,head[MAXN],to[MAXN],nxt[MAXN],linker[MAXN]; bool f,vis[MAXN]; void add(int x,int y){ cnt++; to[cnt]=y; nxt[cnt]=head[x]; head[x]=cnt; } void dfs(int x,int fa){ vis[x]=true; linker[x]=linker[fa]^1; for(int i=head[x];i;i=n...
a.cc: In function 'void add(int, int)': a.cc:8:9: error: 'cnt' was not declared in this scope; did you mean 'int'? 8 | cnt++; | ^~~ | int
s730822776
p03787
C++
#include<cmath> #include<math.h> #include<ctype.h> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cerrno> #include<cfloat> #include<ciso646> #include<climits> #include<clocale> #include<complex> #include<csetjmp> #include<csignal> #include<cstdarg> #include<cstddef> #include<cstdio> #i...
a.cc: In function 'void add(int, int)': a.cc:64:9: error: reference to 'next' is ambiguous 64 | next[cnt]=head[x]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmat...
s306594510
p03787
C++
#include<cmath> #include<math.h> #include<ctype.h> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cerrno> #include<cfloat> #include<ciso646> #include<climits> #include<clocale> #include<complex> #include<csetjmp> #include<csignal> #include<cstdarg> #include<cstddef> #include<cstdio> #i...
a.cc: In function 'void add(int, int)': a.cc:64:9: error: reference to 'next' is ambiguous 64 | next[cnt]=head[x]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmat...
s189918063
p03787
C++
#include <cstdio> #include <iostream> #include <vector> #include <queue> #include <set> #include <algorithm> using namespace std; const int maxn = 100000 + 5; typedef long long int64; int n, m; vector<int> adj[maxn]; int visited[maxn]; int color[maxn]; int64 solve() { fill(visited, visited+n+1, 0); int64 sp = 0; ...
a.cc: In function 'int main()': a.cc:102:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 102 | int64 solve() | ^~ a.cc:102:12: note: remove parentheses to default-initialize a variable 102 | int64 solve() | ^~ | -- a.cc:...
s385042760
p03787
C
int n, m, a[200009], b[200009], e[400009], c[100009], s[100009], cnt, col[100009]; bool dfs(int pos) { bool ret = true; cnt++; for (int i = c[pos]; i < c[pos + 1]; i++) { if (col[e[i]] == col[pos]) ret = false; if (col[e[i]] == 0) { col[e[i]] = 3 - col[pos]; if (!dfs(e[i])) ret = false; } } return ret; ...
main.c:2:1: error: unknown type name 'bool' 2 | bool dfs(int pos) { | ^~~~ main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' +++ |+#include <stdbool.h> 1 | int n, m, a[200009], b[200009], e[400009], c[100009], s[100009], cnt, col[10000...
s879897723
p03787
C
#include <stdio.h> int dfs(int, int); int N, M; int edge[100010][100010]; int used[100010]; int main(void) { int i, tmp[2], single = 0, bipartite = 0, other = 0, ans = 0; scanf("%d%d", &N, &M); for (i = 0; i < M; i++) { scanf("%d%d", &tmp[0], &tmp[1]); edge[tmp[0]][tmp[1]] = 1; edge[tmp[1]][tmp[0]] = 1; ...
/tmp/ccFkCKXz.o: in function `main': main.c:(.text+0xfa): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccFkCKXz.o /tmp/ccFkCKXz.o: in function `dfs': main.c:(.text+0x1d2): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp...
s368443108
p03787
C++
#include<bits/stdc++.h> #include<unordered_map> #include<unordered_set> #include<random> using namespace std; //snuke #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define gep(i,g,j) f...
a.cc:81:14: error: expected identifier before numeric constant 81 | vl g(3); | ^ a.cc:81:14: error: expected ',' or '...' before numeric constant a.cc: In member function 'long long int solver::main(int, int, std::vector<std::pair<int, int> >)': a.cc:95:26: error: invalid types '<unresolve...
s074017179
p03787
C++
#include <bits/stdc++.h> using namespace std; namespace { #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define len(x) (int)((x).size()) #define X first #define Y second #define FOR(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((b...
a.cc:14:10: fatal error: debug.h: No such file or directory 14 | #include "debug.h" | ^~~~~~~~~ compilation terminated.
s994203048
p03787
C
#include <cstdio> #include <list> std::list<int> G[100000]; int mark[100000]; std::list<int> cs; int iso; int dfs(int i, int c, int b){ for(int j : G[i]){ if(mark[j]&&mark[j]!=-c) b = 0; if(!mark[j]){ mark[j]=-c; b &= dfs(j, -c, b); } } return b; } int dfs0(int i, int c, int b){ iso=...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s342852126
p03787
C++
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG #define debug(...) printf(__VA_ARGS__) #else #define debug(...) (void)0 #endif #define MP make_pair #define PB push_back #define LL long long #define pii pair<int,int> #define F first #define S second #define ALL(x) (x).begin(),(x).end() #define SZ(x) ...
In file included from /usr/include/c++/14/cassert:44, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106, from a.cc:1: a.cc: In function 'int main()': a.cc:92:13: error: 'cnt' was not declared in this scope; did you mean 'cnt1'? 92 | assert( cnt+cnt1==SZ(v)); | ...
s095900397
p03787
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:108:1: error: 'bee' does not name a type 108 | bee | ^~~
s651529836
p03788
C++
#pragma GCC optimize("Ofast") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("unswitch-loops") #pragma GCC optimize("fast-math") #pragma GCC optimize("section-anchors") #pragma GCC optimize("profile-reorder-functions") #pragma GCC optimize("profile-values") #pragma ...
a.cc:6:39: error: section anchors must be disabled when toplevel reorder is disabled 6 | #pragma GCC optimize("section-anchors") | ^ a.cc:8:38: warning: bad option '-fprofile-values' to pragma 'optimize' [-Wpragmas] 8 | #pragma GCC optimize("profile-values") | ...
s512768300
p03788
C++
#pragma GCC optimize("O2") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define pb push_back using namespace std; using ll = long long; //using arr = array; using pi = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; u...
a.cc: In function 'std::string get(int, int, std::string)': a.cc:39:9: error: 'r' was not declared in this scope 39 | r++; | ^
s043600183
p03788
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<set> #include<queue> #include<stack> #include<bitset> #include<functional> #include<map> #include<iomanip> #include<limits> #include<unordered_set> #include<cmath> #include <numeric> #include <array> #include <complex> using namespace std...
a.cc: In function 'int main()': a.cc:326:7: error: 'assert' was not declared in this scope 326 | assert(true); | ^~~~~~ a.cc:18:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 17 | #include <complex> +++ |+#include <cassert> 18 | us...
s060707129
p03788
C++
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 4 * 100 * 1000 + 1234; int n, k; string s; char rev(char c) { return (c == 'A')? 'B': 'A'; } string gen(int c) { string ss; if (c % 2 == 0) for (int i = 0; i <= n; i++) ss += s[i + c]; else for (int i = 0; i <= n; i++) ...
cc1plus: error: '::main' must return 'int'
s849118908
p03788
C++
// g++ -std=c++11 a.cpp #include<iostream> #include<vector> #include<string> #include<algorithm> #include<map> #include<set> #include<unordered_map> #include<utility> #include<cmath> #include<random> #include<cstring> #include<queue> #include<stack> #include<bitset> #include<cstdio> #include<sstream> #include<iomanip>...
a.cc: In function 'int main()': a.cc:81:19: error: 'i' was not declared in this scope 81 | solve(s,n,i); | ^
s670496429
p03788
C++
#include<iostream> #include<cstdio> #include<string> #include<cstring> #include<vector> #include<algorithm> #include<queue> #include<stack> #define maxn 200050 #define maxint ~0U>>1 std::stack<int> sta; std::vector<int> comp[maxn]; int incomp[maxn],instack[maxn],dfn[maxn],low[maxn]; int index,cnum; int n,m,q,d[maxn],r...
a.cc:15:5: error: 'int index' redeclared as different kind of entity 15 | int index,cnum; | ^~~~~ In file included from /usr/include/string.h:462, from /usr/include/c++/14/cstring:43, from a.cc:4: /usr/include/strings.h:50:20: note: previous declaration 'const char* index(...
s153644568
p03788
C++
#include<bits/stdc++.h> using namespace std; const int N=2e5+10; bitset<N> S0,T0; bitset<N-1> S1,T1; int n,k;char s[N]; template<unsigned N> void work(bitset<N> &S){ if (S[0]) S^=~(S^(S>>1)),S[N-1]=0;else S[0]=1; } int main() { scanf("%d%d%s",&n,&k,s); for (int i=N-2;i>=0;i-=2) T0[i]=S0[i]=1; for (int i=N-1;i>=0;i-...
a.cc: In function 'int main()': a.cc:20:29: error: no matching function for call to 'work(std::bitset<200009>&)' 20 | work(S1); | ~~~~^~~~ a.cc:8:6: note: candidate: 'template<unsigned int N> void work(std::bitset<N>&)' 8 | void work(bitset<N> &S){ | ...
s621829291
p03788
C++
#include<unordered_set> #include<unordered_map> using namespace std; #define MAX 200002 int n; int k; deque<int> d; char buf[MAX]; string ans; int main(){ cin >> n >> k; scanf("%s", buf); for (int i = 0; i < n; i++){ if (buf[i] - 'A' == 0){ d.push_back((i & 1) ^ 1); } else{ d.push_back((i & 1)); ...
a.cc:10:1: error: 'deque' does not name a type 10 | deque<int> d; | ^~~~~ a.cc:14:1: error: 'string' does not name a type 14 | string ans; | ^~~~~~ a.cc: In function 'int main()': a.cc:18:9: error: 'cin' was not declared in this scope 18 | cin >> n >> k; | ^~~ a.cc:3:1: note: ...
s583537535
p03788
Java
// package atcoder.agc.agc011; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class D { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter ou...
Main.java:9: error: class D is public, should be declared in a file named D.java public class D { ^ 1 error
s074736148
p03788
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define int ll #define FOR(i,a,b) for(int i=int(a);i<int(b);i++) #define REP(i,b) FOR(i,0,b) #define MP make_pair #define PB push_back #define ALL(x) x.begin(),x.end() #define REACH cerr<<"reached line "<<__LINE__<<endl #define DBG(x) cerr<<"line "<<__...
a.cc:98:39: warning: missing terminating ' character 98 | bool w=(s[i]=='A^(i&1)); | ^ a.cc:98:39: error: missing terminating ' character 98 | bool w=(s[i]=='A^(i&1)); | ^~~~~~~~...
s474278903
p03788
C++
#include <bits/stdc++.h> using namespace std; const int MAXN = 100 + 10; const int INF = (int)(1e9); char opp(char c) { return ((c == 'A') ? 'B' : 'A'); } void print_alter(char f, int t, int n) { for(int i = 0; i < t; ++i) cout << f; for(int i = t; i < n; ++i) { f = opp(f); cout << f; ...
a.cc: In function 'void run()': a.cc:67:14: error: 'i' was not declared in this scope 67 | solve(s, i); | ^
s678215194
p03788
C++
#include<algorithm> #include<cmath> #include<iomanip> #include<iostream> #include<map> #include<numeric> #include<queue> #include<set> #include<sstream> #include<vector> using namespace std; using uint = unsigned int; using ll = long long; const int M = 1e9 + 7; const ll MLL = 1e18L + 9; #pragma unused(M) #pragma unuse...
a.cc: In function 'int main()': a.cc:29:18: error: 'clk' was not declared in this scope 29 | auto start = clk.now(); | ^~~
s984703254
p03788
C++
#pragma comment(linker, "/STACK:1024000000,1024000000") #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <string> using namespace std; #define LL long long #define mp make_pair #define fr first #define sc second #defi...
a.cc: In function 'int main()': a.cc:31:13: error: expected unqualified-id before ';' token 31 | int K=k,; | ^
s697768407
p03788
C++
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
a.cc:39:9: error: expected unqualified-id before 'if' 39 | if(pos==N) { | ^~ a.cc:46:9: error: expected unqualified-id before 'else' 46 | else { | ^~~~ a.cc:63:9: error: 'cout' does not name a type 63 | cout<<R<<endl; | ^~~~ a.cc:94:1: error: ex...
s825716743
p03788
C++
#include<bits/stdc++.h> typedef long long ll; using namespace std; void mf(){ freopen("input.in","r",stdin); freopen("output.ou","w",stdout); } int a[100007]; int n, k; // map<string, int> mm; string convert(){ string s = ""; for(int i = 0; i<n;i++){ s+=char(a[i]+'A'); } return s; } inline bool check1(int res)...
a.cc: In function 'void test()': a.cc:75:9: error: 'mm' was not declared in this scope; did you mean 'tm'? 75 | mm[st] = 0; | ^~ | tm
s414387608
p03788
C++
#include<iostream> #include<vector> #include<queue> #include<functional> #include<map> #include<set> #include<string> int main() { std::string str; int N, K; std::cin >> N >> K; std::cin >> str; struct func_t { bool f; bool operator()(char c) { if ((f&&c == 'A') || (!f&&c == 'B')) { f ^= true; ...
a.cc: In function 'int main()': a.cc:30:22: error: 'all_of' is not a member of 'std' 30 | while (!std::all_of(str.rbegin(), str.rend(), func_t{ true })) | ^~~~~~
s314476608
p03789
C++
#include<cstdio> const int MAX_N = 200000; int a[MAX_N + 1]; int p[MAX_N + 1]; bool fst[MAX_N + 1]; bool check(int x, int y, int n) { for(int i = 1; i <= y; i++) fst[i] = true; for(int i = 1; i <= x; i++) { if(a[i] < a[i - 1]) return false; fst[a[i]] = false; } for(int i = y + 1; i < n; i++) { if(p[i] > p[i + 1]...
a.cc: In function 'int main()': a.cc:43:24: error: expected ')' before 'solve' 43 | while(~scanf("%d", &T) solve(T); | ~ ^~~~~~ | )
s334179735
p03789
C++
#include <iostream> #include <string> #define llint long long using namespace std; int n; string s; int a[5000005]; llint adjust(llint p, llint x) { if(x == 0 || x < a[p]) return -1; x = (x-a[p])/10*10 + a[p]; if(n-p < 9){ llint sum = 0, mul = 1; for(int i = p; i < n; i++){ sum += mul * a[i]; ...
a.cc: In function 'int main()': a.cc:59:3: error: 'reverse' was not declared in this scope 59 | reverse(s.begin(), s.end()); | ^~~~~~~