submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s370457408
p03848
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int> a(N); int zero = 0; for(int i=0;i<N;i++){ cin>>a[i]; if(a[i]==0) zero++; } sort(a.begin(),a.end(),greater<int>()); if(N%2==0&&zero>0||N%2==1&&zero>1){ cout<<"0"; ...
a.cc: In function 'int main()': a.cc:21:19: error: expected initializer before numeric constant 21 | const int mod 1e9+7; | ^~~ a.cc:28:20: error: 'mod' was not declared in this scope; did you mean 'modf'? 28 | ans+=ans*2%mod; | ^~~ | ...
s233297460
p03848
C++
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = 100005; const int mod = 1e9+7; int a[N]; int num[N]; ll qpow(ll a,ll b,ll p) { ll ans=1%p; while(b) { if(b&1) ans=(ans*a)%p; b>>=1; a=(a*a)%p; } return ans; } int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++...
a.cc: In function 'int main()': a.cc:54:36: error: too few arguments to function 'long long int qpow(long long int, long long int, long long int)' 54 | ll ans=qpow(2,n/2)%mod; | ~~~~^~~~~~~ a.cc:8:4: note: declared here 8 | ll qpow(ll a,ll b,ll p) ...
s545513526
p03848
C++
#include <iostream> using namespace std; typedef long long ll; ll mod=1e9+7; int main(){ ll n; cin >> n; ll a[n]; for(ll i=0;i<n;i++) cin >> a[i]; ll check[n]={0}; if(n%2==0){ for(ll i=1;i<n;i++) check[i]=2; } else{ check[0]=1; for(ll i=2;i<n;i++) check[i]=2; } for(ll i=0;i<n;i++){ ...
a.cc: In function 'int main()': a.cc:33:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 33 | cout << ans << endl; | ^~~ | abs
s757099468
p03848
C++
#include<iostream> #include<vector> #include<algorithm> #include<stack> #include<queue> #include<string> #include<cmath> using namespace std; #define ll long long #define INF 99999999 #define rep(i,n) for(int i=0,temp=(int)(n);i<temp;++i) //vec.size()がnの時等の高速化 #define all(x) (x).begin(),(x).end() #define SORT(v, n) so...
a.cc: In function 'int main()': a.cc:54:19: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 54 | ans = ans*2 % 1e9; | ~~~~~ ^ ~~~ | | | | | double | long long int
s700221154
p03848
C++
import sys n = int(input()) a = list(map(int, input().split())) a.sort() ra = a.copy() a = a[0::2] ra = ra[1::2] ra.reverse() a = ra + a for i in range(n): if a[i] != abs(n - 1 - i * 2): print(0) sys.exit(0) print(2 ** (n // 2) % 1000000007)
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s993404219
p03848
C++
#include <iostream> #include <vector> #include <algorithm> #define MOD 1000000007 using namespace std; int main() { ll n, ans = 1; cin >> n; vector<ll> a(n); for (ll i = 0; i < n; ++i) cin >> a.at(i); sort(a.begin(), a.end()); for (ll i = n - 1; i >= 0; --i) { if (a.at(i) != (i + n % ...
a.cc: In function 'int main()': a.cc:10:5: error: 'll' was not declared in this scope 10 | ll n, ans = 1; | ^~ a.cc:11:12: error: 'n' was not declared in this scope 11 | cin >> n; | ^ a.cc:12:14: error: template argument 2 is invalid 12 | vector<ll> a(n); | ...
s098155413
p03848
C++
#include<vector> using namespace std; int main() { int n;cin>>n; vector<int> a(n); vector<int> v(10000,0); for(int i=0;i<n;i++){ cin>>a[i]; v[a[i]]++; } int flag=1; for(int i=0;i<n/2;i++){ if(v[2*i+1+n%2]!=2){ flag=0; break; } } if(n%2){ if(v[0]!=1){ flag=0; } } if(flag){ int ans=1; ...
a.cc: In function 'int main()': a.cc:5:15: error: 'cin' was not declared in this scope 5 | int n;cin>>n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<vector> +++ |+#include <iostream> 2...
s771415595
p03848
C++
n = int(input()) cnt = [0] * n for i in input().split(): cnt[int(i)] += 1 for i in range(1 + n % 2, n, 2): if cnt[i] != 2: print(0) exit(0) print(pow(2, n // 2, int(1e9 + 7)))
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s333621458
p03848
C++
#include<stdio.h> #include <algorithm> #include <boost/foreach.hpp> using namespace std; int main(){ int i,a[100000],box[100000]={},n,b; long long int flag=1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } sort(a,a+n,greater<int>()); b=n-1; for(i=0;i<n;i++){ if(a[i]!=b) flag=0;...
a.cc:3:10: fatal error: boost/foreach.hpp: No such file or directory 3 | #include <boost/foreach.hpp> | ^~~~~~~~~~~~~~~~~~~ compilation terminated.
s716629829
p03848
C++
#include <bits/stdc++.h> #define int long long int mpow(int k,int n,const int MOD){ int res = 1; for(int i=0;i<n;i++) res=res*k%MOD; return res; using namespace std; signed main() { int N; int ans; cin>>N; int out=0; int k; std::vector<int> v(N,0); for(int i=0;i<N;i++){ cin>>k; v[k]++...
a.cc: In function 'long long int mpow(long long int, long long int, long long int)': a.cc:9:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 9 | signed main() { | ^~ a.cc:9:12: note: remove parentheses to default-initialize a variable 9 | signed main(...
s349176055
p03848
C++
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int N; int ans; cin>>N; int out=0; int k; std::vector<int> v(N,0); for(int i=0;i<N;i++){ cin>>k; v[k]++; } if(N%2){ for(int i=0;i<N;i++){ if(i==0)if(v[i]!=1)out++; if(i%2)if(v[i]!=0)out++; ...
a.cc: In function 'int main()': a.cc:24:11: error: 'mpow' was not declared in this scope; did you mean 'pow'? 24 | ans=mpow(2,N/2,1e9+7); | ^~~~ | pow a.cc:36:11: error: 'mpow' was not declared in this scope; did you mean 'pow'? 36 | ans=mpow(2,N/2,1e9+7); | ...
s249355045
p03848
C++
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int N; cin>>N; int out=0; int k; std::vector<int> v(N,0); for(int i=0;i<N;i++){ cin>>k; v[k]++; } if(N%2){ for(int i=0;i<N;i++){ if(i==0)if(v[i]!=1)out++; if(i%2)if(v[i]!=0)out++; if(i%2==0...
a.cc: In function 'int main()': a.cc:22:26: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 22 | else cout<<pow(2,N/2)%1000000007<<endl; | ~~~~~~~~~~^~~~~~~~~~~ | | | | ...
s269320809
p03848
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; int out=0; int k; std::vector<int> v(N,0); for(int i=0;i<N;i++){ cin>>k; v[k]++; } if(N%2){ for(int i=0;i<N;i++){ if(i==0)if(v[i]!=1)out++; if(i%2)if(v[i]!=0)out++; if(i%2==0&&i!=0)if(v[i]!=2)out++; ...
a.cc: In function 'int main()': a.cc:21:26: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 21 | else cout<<pow(2,N/2)%1000000007<<endl; | ~~~~~~~~~~^~~~~~~~~~~ | | | | ...
s458472095
p03848
C++
using System; using System.Linq; using System.Diagnostics; using System.Collections.Generic; using static System.Math; class P { static void Main() { int n = int.Parse(Console.ReadLine()); int[] a = Console.ReadLine().Split().Select(int.Parse).OrderByDescending(x => x).ToArray(); for (i...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Diagnostics; ...
s118151000
p03848
C++
//include //------------------------------------------ #include <map> #include <iostream> using namespace std; //conversion //------------------------------------------ inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;} template<class T> inline string toString(T x) {ostringstream sout;sout<<x;r...
a.cc: In function 'int toInt(std::string)': a.cc:10:55: error: variable 'std::istringstream sin' has initializer but incomplete type 10 | inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;} | ^ a.cc: In function 'std::string toString(T...
s089759022
p03848
C++
#include <iostream> #include <algorithm> #include <cmath> using namespace std; long a,cnt[100000]; int main(void){ cin>>q; for(long i=-1;++i-q;){ cin>>a; ++cnt[a]; } for(long i=-1;++i-q;){ if(cnt[i]=!((i+a)&1)*2-!i&&a&1)break; } if(i==q){ cnt[0]=1; for(lon...
a.cc: In function 'int main()': a.cc:7:10: error: 'q' was not declared in this scope 7 | cin>>q; | ^ a.cc:15:8: error: 'i' was not declared in this scope 15 | if(i==q){ | ^
s869039429
p03848
C++
#include<iostream> #include<bits/stdc++.h> #include<cmath> using namespace std; #define ll long long int ll num[500000],cnt[500000]= {0}; long long int bigmod(long long int a,long long int b,long long int p) { long long int val,ret; //printf("b=%lld\n",b); if(b==0) { return 1; } if(b%2...
a.cc: In function 'int main()': a.cc:73:24: error: expected ')' before ';' token 73 | else(cnt1=1;) | ~ ^ | ) a.cc:73:25: error: expected primary-expression before ')' token 73 | else(cnt1=1;) | ^
s783174318
p03848
C++
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; const int mod=1e9+7; int a[100001]; int n; int pow1(int a,int n) { if(n==0) return 1; int x=pow1(a,n/2); long long ans=(long long)x*x%mod; if(n%2==1) ans=ans*a%mod; return ans; } bool check() { sort(a+1,a+n+1); if(a[1]==0) for(int i=2...
a.cc: In function 'bool check()': a.cc:31:17: error: 'i' was not declared in this scope 31 | i+=2; | ^
s525690767
p03848
C
#include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main(void) {int N,A,M,B,X,C,x,i,a,b,c,l,r,g,flag,m,tmp; long long int sum; scanf("%d",&N); sum=1; flag=0; int A[100000]; for(i=0;i<N;i++){ scanf("%d",A[i]);} qsort(A, N, sizeof(int), ...
main.c: In function 'main': main.c:15:13: error: conflicting types for 'A'; have 'int[100000]' 15 | int A[100000]; | ^ main.c:10:8: note: previous declaration of 'A' with type 'int' 10 | {int N,A,M,B,X,C,x,i,a,b,c,l,r,g,flag,m,tmp; | ^
s032968652
p03848
C++
#include "bits/stdc++.h" using namespace std; int main(){ long long int n; cin>>n; vector<long long int> a(n); for(int i=0;i<n;i++){ int b; cin>>b; a[b]++; } int f=1; if(n%2==0){ for(int i=1;i<n;i+=2){ if(a[i]!=2)f=0; } }else{ for(int i=2;i<n;i+=2){ if(a[i]!=2)f=0; } if(a[0]!=1)f=0; } ...
a.cc: In function 'int main()': a.cc:32:28: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 32 | ans%=1e9+7; | ~~~^~~~~~~ a.cc:32:28: note: in evaluation of 'operator%=(long long int, double)'
s035347216
p03848
C++
// g++ macro.cpp -std=c++14 #include <bits/stdc++.h> //STL include typedef long long ll;// long long int const ll INF = 10000000000;//INFinity using namespace std;//namespace inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}//transform template<class T> inline string toString(T x) {ostringstrea...
a.cc: In function 'int main()': a.cc:36:43: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 36 | if(x!=0)x=(n%2==1?pow(2,map_.size()-1)%(pow(10,9)+7):pow(2,map_.size())%(pow(10,9)+7)); | ...
s928740554
p03848
C++
// g++ macro.cpp -std=c++14 #include <bits/stdc++.h> //STL include typedef long long ll;// long long int const ll INF = 10000000000;//INFinity using namespace std;//namespace inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}//transform template<class T> inline string toString(T x) {ostringstrea...
a.cc: In function 'int main()': a.cc:37:12: error: invalid operands of types 'll' {aka 'long long int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 37 | cout<<x%(pow(10,9)+7)<<endl; | ~^~~~~~~~~~~~~~ | | | | | ...
s699357253
p03848
C++
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main(int argc, char const *argv[]) { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int cnt[n]; memset(cnt, 0, sizeof(cnt)); if (n % 2 != 0) { for (int i = 0; i < n; i++) { cnt[a[i]]++; ...
a.cc: In function 'int main(int, const char**)': a.cc:14:3: error: 'memset' was not declared in this scope 14 | memset(cnt, 0, sizeof(cnt)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <iostream> +++ |+#inclu...
s824253733
p03848
C++
#include <iostream> #include <string> #include <algorithm> #include <map> #include <set> #include <vector> #include <queue> #include <cmath> #define MOD 1000000007; #define PI 3.14159265358979323846; using namespace std; typedef long long ll; ll mod = 1000000007; ll pow(int a, int n) { if (n == 0) { return 1; } ...
a.cc: In function 'int main()': a.cc:52:59: error: conversion from '_Rb_tree_iterator<pair<const long long int,[...]>>' to non-scalar type '_Rb_tree_iterator<pair<const int,[...]>>' requested 52 | for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) | ...
s545105939
p03848
C++
#include <bits\stdc++.h> using namespace std; int n,cnt[1000005],i,x; long long ans; int main() { cin>>n; for (i=1;i<=n;i++) { cin>>x; cnt[x]++; } if (n&1) { for (i=2;i<=n;i+=2) { if (cnt[i]!=2) { cout<<0; return 0; } } if (cnt[0]!=1) { cout<<0; return 0; } } else { for...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s180677345
p03848
C++
#include <bits\stdc++.h> using namespace std; int n,cnt[1000005],i,x; long long ans; int main() { cin>>n; for (i=1;i<=n;i++) { cin>>x; cnt[x]++; } if (n&1) { for (i=2;i<=n;i+=2) { if (cnt[i]!=2) { cout<<0; return 0; } } if (cnt[0]!=1) { cout<<0; return 0; } } else { for...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s681364908
p03848
C++
#include<bits/stdc++.h> using namespace std; const int MAXN=100010; int x[MAXN],c[2*MAXN]; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>x[i]; c[x[i]]++; } bool nemoguce=false; if(n%2==0){ for(int i=1;i<=n;i+=2){ if(c[i]!=2){ nemoguce=true; break; } } } if(n%2==1){ if(c[0]>1) ne...
a.cc: In function 'int main()': a.cc:38:26: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 38 | r%=pow(10,9)+7; | ~^~~~~~~~~~~~~ a.cc:38:26: note: in evaluation of 'operator%=(lon...
s187733576
p03848
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <numeric> #include <stack> #include <queue> #include <map> #include <set> #include <utility> #include <sstream> #include <complex> #include <fstream> #include <bitset> using na...
a.cc: In function 'int main()': a.cc:73:13: error: 'f' was not declared in this scope 73 | if (f)cout << ans << endl; | ^
s562615984
p03848
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long int n; cin >> n; vector <int> a,b ; for(int i =0; i < n; i++){ int tmp; cin >> tmp; b.push_back (tmp); a.push_back(abs (n-2*i-1)); } sort(a.begin(), a.end ()); bool flag = true; for(int i = 0; i <n; i++){ if(a[i]!=b[i]) flag = false; } if(!flag) ans=0...
a.cc: In function 'int main()': a.cc:20:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | if(!flag) ans=0; | ^~~ | abs
s933871393
p03848
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long int n; cin >> n; if(n%2!=0) n--; n/=2; long long int ans = 1; for(int i = 0; i <n i++;){ ans *= 2; ans %= 1000000009; } cout << ans << endl ; }
a.cc: In function 'int main()': a.cc:10:20: error: expected ';' before 'i' 10 | for(int i = 0; i <n i++;){ | ^~ | ; a.cc:10:24: error: expected ')' before ';' token 10 | for(int i = 0; i <n i++;){ | ~ ^ | ) a...
s894669716
p03848
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long int n; cin >> n; if(n%2!=0) n--; n/=2; long long int ans = 1; for(i = 0; i <n i++;){ ans *= 2; ans %= 1000000009; } cout << ans << endl ; }
a.cc: In function 'int main()': a.cc:10:5: error: 'i' was not declared in this scope 10 | for(i = 0; i <n i++;){ | ^ a.cc:10:16: error: expected ';' before 'i' 10 | for(i = 0; i <n i++;){ | ^~ | ; a.cc:10:20: error: expected ')' before ';' token 10 | for(i = ...
s058247601
p03848
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long int n; cin >> n; if(n%2!=0) n--; n/=2; ans = 1; for(i = 0; i <n i++;){ ans *= 2; ans %= 1000000009; } cout << ans << endl ; }
a.cc: In function 'int main()': a.cc:9:1: error: 'ans' was not declared in this scope; did you mean 'abs'? 9 | ans = 1; | ^~~ | abs a.cc:10:5: error: 'i' was not declared in this scope 10 | for(i = 0; i <n i++;){ | ^ a.cc:10:16: error: expected ';' before 'i' 10 | for(i = 0; i <n i++;){ ...
s331934821
p03848
C++
#include <iostream> #include <vector> using namespace std; typedef long long lli; lli n; vector<lli> a; int error(){ cout << 0 << endl; return 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()); if(n%2 =...
a.cc: In function 'int main(int, const char**)': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(a.begin(),a.end()); | ^~~~ | short
s545121600
p03848
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,b) FOR(i,0,b) #define INF 1e9 int main(){ int i = 0,N,A[N-1]; cin>>N; while (i < N) { cin>>A[i]; i++; } if (N%2 = 0) { cout<<pow(2,N-1); } else { cout<<pow(2,(N-1)/2); } return 0; }
a.cc: In function 'int main()': a.cc:17:8: error: lvalue required as left operand of assignment 17 | if (N%2 = 0) { | ~^~
s801388794
p03848
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,b) FOR(i,0,b) #define INF 1e9 int main(){ int i = 0,N,A[N-1]; cin>>N; while (i < N) { cin>>A[i]; i++; } if (N%2 = 0) { cout<<2**(N/2); } else { cout<<2**((N-1)/2); } return 0; }
a.cc: In function 'int main()': a.cc:17:8: error: lvalue required as left operand of assignment 17 | if (N%2 = 0) { | ~^~ a.cc:18:13: error: invalid type argument of unary '*' (have 'int') 18 | cout<<2**(N/2); | ^~~~~~ a.cc:20:13: error: invalid type argument of unary '*' (have...
s899573703
p03848
C++
#include <iostream> #include <vector> #include <queue> using namespace std; long long pow(int a, int b, int mod) { int ret = 1; for(int i = 0 ; i < b ; i ++){ ret = ret * a % mod; } return ret; } int main(void){ long long n; cin>>n; vector<int> v(n); for(int i = 0 ; i < n ; i ++){ cin>>v[i]; } int s =...
a.cc: In function 'int main()': a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort(v.begin(),v.end()); | ^~~~ | short a.cc:25:9: error: 'reverse' was not declared in this scope 25 | reverse(v.begin(),v.end()); | ^~~~~~...
s288019629
p03848
C++
//I_F_A #include "bits/stdc++.h" using namespace std; bool func(long long *arr,long long n){ if(n%2 == 0){ for(long long i=1;i<=n;i+=2){ if(arr[i] != i || arr[i+1] != i){ return 0; } } } else{ if(arr[1] != 0){ return 0; } for(long long i=2;i<=n;i=i+2){ if(arr[i] != i || arr[i+1] != ...
a.cc: In function 'long long int power(long long int, long long int, long long int)': a.cc:41:28: error: too few arguments to function 'long long int power(long long int, long long int, long long int)' 41 | long long x = power(a,n>>1); | ~~~~~^~~~~~~~ a.cc:34:11: note: declared he...
s535574472
p03848
C++
//I_F_A #include "bits/stdc++.h" using namespace std; bool func(long long *arr,long long n){ if(n%2 == 0){ for(long long i=1;i<=n;i+=2){ if(arr[i] != i || arr[i+1] != i){ return 0; } } } else{ if(arr[1] != 0){ return 0; } for(long long i=2;i<=n;i=i+2){ if(arr[i] != i || arr[i+1] != ...
a.cc: In function 'long long int func(long long int, long long int, long long int)': a.cc:41:23: error: 'power' was not declared in this scope 41 | long long x = power(a,n>>1); | ^~~~~ a.cc: In function 'int main()': a.cc:69:25: error: 'power' was not declared in this scope 69 ...
s823936430
p03848
C++
de <iostream> #include <vector> #include <cmath> #define MOD 1000000007 using namespace std; int main() { int n; int a[n]; cin >> n; int num[n]; for (int i = 0; i < n; i++) { num[i] = 0; } for (int i = 0; i < n; i++) { cin >> a[i]; for (int j = 0; j <= n; j++) ...
a.cc:1:1: error: 'de' does not name a type 1 | de <iostream> | ^~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null...
s472951278
p03848
C++
test
a.cc:1:1: error: 'test' does not name a type 1 | test | ^~~~
s587794011
p03848
C++
#include <map> #include <set> #include <queue> #include <stack> #include <cmath> #include <vector> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include<functional> #include<fstream> #include<iomanip> #include<windows.h> using namespace std; typedef long long ll; #define for1(x,y,z) fo...
a.cc:14:9: fatal error: windows.h: No such file or directory 14 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.
s230120239
p03848
C++
#include <iostream> #include <string> #include <vector> constexpr static int MAXN = 1e6; constexpr static int MOD = 1e9 + 7; using namespace std; int n; int a[MAXN]; int64_t solve() { int64_t r = 1; int val = n - 1; for (int i = 0; i < n; i++) { if (a[i] != val) return 0; if...
a.cc: In function 'int main()': a.cc:32:5: error: 'sort' was not declared in this scope; did you mean 'short'? 32 | sort(a, a + n); | ^~~~ | short a.cc:33:5: error: 'reverse' was not declared in this scope 33 | reverse(a, a + n); | ^~~~~~~
s267310615
p03848
Java
import java.io.*; import java.util.*; public class Main static long mod; static long modpow(int a,int b){ if(b == 0)return 1; long temp = modpow(a,b/2); temp = temp*1L*temp % mod; if((b & 1) == 1) temp = temp*a % mod; return temp; } public static void ...
Main.java:3: error: '{' expected public class Main ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by default. static long modpow(int a,int b){ ^ (use --enable-preview to enable unnamed classes) Main.java:46: error: class, interface, enum, or record expecte...
s643248599
p03848
C++
#include <iostream> #include <vector> #include <cmath> #include <cstdio> #include <string> #include <algorithm> #include <queue> #define ll long long using namespace std; #define MOD 1000000007 class AdditionAndSubtractionHard { public: int n; vector<ll> a; vector<string> op; vector<vector<ll > > dp; AdditionAn...
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/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/includ...
s294035829
p03848
C++
#include <iostream> #include <vector> #include <cmath> #include <cstdio> #include <string> #include <algorithm> #include <queue> #define ll long long using namespace std; #define MOD 1000000007 class AdditionAndSubtractionHard { public: int n; vector<ll> a; vector<string> op; vector<vector<ll > > dp; AdditionAn...
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/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/includ...
s008582246
p03848
C++
using namespace std; const int MOD=1000000007; int row[10010],N; int main(){ scanf("%d",&N); int tmp,index; for(int i=0;i<N;i++){ scanf("%d",&tmp); index=((N+tmp-1)/2)+1; tmp=index; row[index]++; index=N-index+1; if(index!=tmp){ row[index]++; } } int ans=1; /* for(int i=0;i<=N;i++){ printf("%d...
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf' was not declared in this scope 5 | scanf("%d",&N); | ^~~~~ a.cc:30:9: error: 'printf' was not declared in this scope 30 | printf("%d\n",ans); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; thi...
s013035775
p03848
C++
/* ____________ ______________ __ / _________ /\ /_____ _____/\ / /\ / /\ / / \\ / /\ \ \ / / \ / / \_____/ / / \__/ / \____\/ / / / / / / / / / / / / / / / / / / / / / ...
a.cc: In function 'int main()': a.cc:136:21: error: expected ';' before '}' token 136 | ans%=mod | ^ | ; 137 | } | ~
s102733593
p03848
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std; const int MAX = 1e+5, M = 1e+9 + 7; int N; int C[MAX]; //C[i]:i番目の出現回数 void input() { memset(C, 0, sizeof(C)); cin >> N; for (int i = 0; i < N; i++) { int j; //scanf("%d", &j); cin >> j; C[j]++; } } void solve() { double coun = ...
a.cc: In function 'void input()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(C, 0, sizeof(C)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> +++ |+#include <cst...
s352736345
p03848
C++
#include<iostream> #include<cmath> using namespace std; const int MAX = 1e+5, M = 1e+9 + 7; int N; int C[MAX]; //C[i]:i番目の出現回数 void input() { memset(C, 0, sizeof(C)); cin >> N; for (int i = 0; i < N; i++) { int j; scanf("%d", &j); C[j]++; } } void solve() { double coun = 0; //偶数人並んでいる場合 if (N % 2 == 0) ...
a.cc: In function 'void input()': a.cc:11:9: error: 'memset' was not declared in this scope 11 | memset(C, 0, sizeof(C)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cmath> +++ |+#include <cstring...
s620369372
p03848
C++
#include <iostream> #include <vector> using namespace std; using type = long; bool check(const vector<type>& A) { type N = A.size(); if (N % 2 == 0) { for (type i = 0; i < N; ++i) { if (i % 2 == 0 and A[i] != 0) return false; if (i % 2 == 1 and A[i] != 2) return false; ...
a.cc: In function 'int main()': a.cc:29:13: error: 'ans' was not declared in this scope; did you mean 'abs'? 29 | cout << ans << endl; | ^~~ | abs
s026082566
p03848
C++
#include<iostream> #include<vector> #include<cstdio> #include<iterator> #include<algorithm> #include<string> using namespace std; #define MOD int(1e9+7) #define int long long int n, a[100000], flag[100000]; int mod_pow(int x, int n) { int res = 1; while (n > 0) { if (n & 1) res = res * x %MOD; x = x * x % MOD; ...
a.cc: In function 'long long int mod_pow(long long int, long long int)': a.cc:9:13: error: expected primary-expression before 'long' 9 | #define int long long | ^~~~ a.cc:8:13: note: in expansion of macro 'int' 8 | #define MOD int(1e9+7) | ^~~ a.cc:16:43: note: in expansion o...
s283539106
p03848
Java
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashMap; import java.util.InputMismatchException; import java.util.PriorityQueue; import javafx.scene.effect.Light.Spot; p...
Main.java:11: error: package javafx.scene.effect.Light does not exist import javafx.scene.effect.Light.Spot; ^ 1 error
s379637951
p03848
Java
import java.io.*; import java.util.*; public class Main { static final int MOD = 1_000_000_007; void run() { int n = in.nextInt(); int[] a = new int[n]; int[] b = new int[n]; for (int i = 0; i < n; i++) { a[i] = in.nextInt(); b[i] = Math.abs(n - 1 - 2 * i); } Arrays.sort(a); Arrays.sort(b); if...
Main.java:34: error: cannot find symbol String fileName = pC.class.getSimpleName().replaceFirst("_.*", "").toLowerCase(); ^ symbol: class pC location: class Main 1 error
s484202922
p03849
C
#include <cstdio> #include <map> #define int long long using namespace std; const int M = 1e9+7; map<int, int> a; int n; int dfs(int x) { if (a[x]) return a[x]; if (x % 2) return a[x] = (2 * dfs(x / 2) + dfs(x / 2 - 1)) % M; else return a[x] = (dfs(x / 2) + 2 * dfs(x / 2 - 1)) % M; } signed main() { a[0...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s256022131
p03849
C++
#include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.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) #define INF (1e17) #define PI (acos(-1)) //const double PI = acos(-1); //const do...
a.cc:65:9: error: 'P' does not name a type; did you mean 'PI'? 65 | typedef P pair<long long, long long>; | ^ | PI a.cc:66:5: error: 'P' was not declared in this scope; did you mean 'PI'? 66 | map<P, long long> mp; | ^ | PI a.cc:66:17: error: template argument 1 is ...
s123551834
p03849
C++
#include<bits/stdc++.h> #define Rint register int using namespace std; typedef long long LL; typedef pair<LL, LL> pii; const int mod = 1e9 + 7; LL n; map<pii, int> M; inline void upd(int &a, int b){a += b; if(a >= mod) a -= mod;} inline int dfs(LL x, LL y){ if(!y) return 1; if(M.count(MP(x, y))) return M[MP(x, y)]; ...
a.cc: In function 'int dfs(LL, LL)': a.cc:12:20: error: 'MP' was not declared in this scope; did you mean 'M'? 12 | if(M.count(MP(x, y))) return M[MP(x, y)]; | ^~ | M a.cc:16:18: error: 'MP' was not declared in this scope; did you mean 'M'? 16 | re...
s401223309
p03849
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<string> #include<cstring> #include<cmath> #include<ctime> #include<algorithm> #include<utility> #include<stack> #include<queue> #include<vector> #include<set> #include<map> #define EPS 1e-9 #define PI acos(-1.0) #define INF 0x3f3f3f3f #define LL long long c...
a.cc:27:31: error: too many initializers for 'long long int [21]' 27 | 122, 128, 133, 142}; | ^
s732470025
p03849
C++
あ#include <iostream> using namespace std; typedef long long ll; ll mod=1e9+7; ll f(ll n){ if(n==0) return 1; else if(n%2==0) return f(n/2)+f(n/2-1); else return f(n/2); } ll sum(ll n){ if(n==0) return 1; else if(n%2==0) return (3*sum(n/2-1)+f(n/2))%mod; else return (3*sum(n/2)-f(n/2))%mod; } int main()...
a.cc:1:3: error: stray '#' in program 1 | あ#include <iostream> | ^ a.cc:1:1: error: '\U00003042' does not name a type 1 | あ#include <iostream> | ^~ a.cc: In function 'int main()': a.cc:22:3: error: 'cin' was not declared in this scope 22 | cin >> n; | ^~~ a.cc:23:3: error: 'cout' was ...
s871514844
p03849
C++
#include <iostream> using namespace std; typedef long long ll; ll mod=1e9+7; ll f(ll n){ if(n==0) return 1; else if(n%2==0) return f(n/2)+f(n/2-1); else return f(n/2); } ll sum(ll n){ if(n%2==0) return (3*sum(n/2-1)+f(n/2))%mod; else return (3*sum(n/2)-f(n/2))%mod; } int main(){ ll n; cin >> n; cou...
a.cc:8:11: error: expected initializer before '\U0000ff5b' 8 | ll f(ll n){ | ^~ a.cc:10:3: error: expected unqualified-id before 'else' 10 | else if(n%2==0) return f(n/2)+f(n/2-1); | ^~~~ a.cc:11:3: error: expected unqualified-id before 'else' 11 | else return f(n/2); | ^~~...
s680548840
p03849
C++
#include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <string> #include <vector> #include <queue> #include <cmath> #include <stack#include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <string> #include <vector> #include <queue> #include <cmath> #includ...
a.cc:9:10: fatal error: stack#include <algorithm: No such file or directory 9 | #include <stack#include <algorithm> | ^~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s348337391
p03849
C++
#include <bits/stdc++.h> #define int long long using namespace std; std::vector<int> v(61),w(61); const int INF=1e9+7; int dp[600000][50]; int dfs(int S,int X){ if(S<600000&&S>=0&&X<=50&&X>=0)int &res=dp[S][X]; else int res=-2; if(res==-1)return res; if(S<0){res=0;return res;} if(S>(v[X]-1)*2){res=w[X];retur...
a.cc: In function 'long long int dfs(long long int, long long int)': a.cc:11:6: error: 'res' was not declared in this scope 11 | if(res==-1)return res; | ^~~ a.cc:12:11: error: 'res' was not declared in this scope 12 | if(S<0){res=0;return res;} | ^~~ a.cc:13:20: error: 'res' was no...
s184375032
p03849
C++
#include<iostream> #include<algorithm> using namespace std; long dp[66][3],m=1e9+7,n; int b; main(){ cin>>n; dp[60][0]=1; for(int i=59;i>=0;i--){ b=(n>>i)&1; for(int j=0;j<3;j++){ for(int k=0;k<3;k++){ if(j*2+b>=k){ (dp[i][min(j*2+b-k,2)]+=dp[i+1][j])%=m; } } } }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:6:7: note: to match this '{' 6 | main(){ | ^
s218619734
p03849
C++
#include <iostream> #include <vector> #include <bitset> using namespace std; using ll = long long; const ll MOD = (ll)1e9 + 7; int main() { ll N; cin >> N; bitset<60> bs(N); vector<vector<long long>> dp(61, vector<long long>(3, 0)); dp[60][0] = 1; for (int i = 60; i >= 1; --i) { if (bs[i - 1]) { dp[i - 1][...
a.cc: In function 'int main()': a.cc:29:73: error: expected ';' before 'return' 29 | cout << (((dp[0][0] + dp[0][1]) % MOD) + dp[0][2]) % MOD << endl | ^ | ...
s102737344
p03849
C++
#include<cstdio> #include<cstdlib> #include<cmath> #include<iostream> #include<string> #include<stack> #include<queue> #include<vector> #include<map> #include<set> #include<algorithm> #include<numeric> #define rep(n) for(int i=0;i<n;i++) #define repp(j, n) for(int j=0;j<n;j++) #define reppp(i, m, n) for(int i=m;i<=n;i...
a.cc: In function 'int main()': a.cc:33:5: error: 'bitset' was not declared in this scope 33 | bitset<64> nbs(n); | ^~~~~~ a.cc:13:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>' 12 | #include<numeric> +++ |+#include <bitset> 13 | ...
s447178197
p03849
C++
#include<bits\stdc++.h> using namespace std; #define mod 1000000007 typedef long long ll; ll N; ll dp[100][5] = {0}; int main() { scanf("%lld",&N); dp[61][0] = 1; for(int i = 60; i >= 0; i--) { ll mem = (N >> i) & 1; dp[i][2] += dp[i + 1][2] * 3; if(mem) { ...
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s619335815
p03849
C++
#include "stdafx.h" #include "iostream" #include "vector" #include "algorithm" #include "map" typedef long long i64; i64 n; i64 MODULO = (i64)(1e9 + 7); std::map<i64, std::map<i64, i64>> map; i64 f(i64 x, i64 y) { if (x == 0 && y == 0) return 1; if (x < 0 || y < 0) return 0; i64& ret = map[x][y]; if (ret != ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s474994619
p03849
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include...
a.cc: In function 'mint func(int, int)': a.cc:334:23: error: unable to find numeric literal operator 'operator""ui64' 334 | bool NI = (N&(1ui64 << i)) != 0; | ^~~~~
s428460084
p03849
C++
#include <stdio.h> #include <algorithm> #define MOD 1000000007 long long int N; int dp[70][3], bit, ans; int main() { scanf("%lld", &N); dp[0][0] = 1; bit = std::log2(N); for (int i = 0; i <= bit; ++i) { for (int j = 0; j < 3; ++j) { if (N >> (bit - i) & 1) { dp[i + 1][std::min(j * 2 + 1, 2)] += ...
a.cc: In function 'int main()': a.cc:14:20: error: 'log2' is not a member of 'std' 14 | bit = std::log2(N); | ^~~~
s370052304
p03849
C++
#include <stdio.h> #include <algorithm> #define MOD 1000000007 long long int N; int dp[70][3], bit, ans; int main() { scanf("%lld", &N); dp[0][0] = 1; bit = log2(N); for (int i = 0; i <= bit; ++i) { for (int j = 0; j < 3; ++j) { if (N >> (bit - i) & 1) { dp[i + 1][std::min(j * 2 + 1, 2)] += dp[i]...
a.cc: In function 'int main()': a.cc:14:15: error: 'log2' was not declared in this scope 14 | bit = log2(N); | ^~~~
s587105710
p03849
C++
#include <bits/stdc++.h> #define SZ(x) ((int) (x).size()) using namespace std; typedef long long i64; const int MOD = 1e9 + 7; int dp[64][2][3]; int main() { #ifdef LOCAL_RUN freopen("task.in", "r", stdin); freopen("task.out", "w", stdout); //freopen("task.err", "w", stderr); #endif // ONLINE_JUD...
a.cc: In function 'int main()': a.cc:25:35: error: unable to deduce 'std::initializer_list<auto>&&' from '{0, r}' 25 | for (int64_t cput: {0LL, r}) { | ^ a.cc:25:35: note: deduced conflicting types for parameter 'auto' ('long long int' and 'long int')
s430179869
p03849
C++
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Majk */ #include <vector> #include <iostream> #include <unordered_map> #include <map> #include <iomanip> #include <functional> #include <algorithm> #include <cassert> #include <cmath> #include <string> #include <sstrea...
a.cc: In member function 'void B::solve(std::istream&, std::ostream&)': a.cc:50:34: error: could not convert '1' from 'int' to 'FieldMod' {aka 'Field<1000000007>'} 50 | FieldMod X[2] = {1,0}; | ^ | | | ...
s806411358
p03849
C++
inline long long int dfs(long long int b){ if (b == 0){ return 1; } if (b == 1){ return 3; } if (b == 2){ return 4; } if (b == 3){ return 7; } if (b == 4){ return 9; } if (b % 2 == 0){ long long int NN = b / 2; return ((dfs(NN - 2)) + (2LL * dfs(NN - 1)) + 2LL)%MOD; } return (2LL * dfs((b - 3...
a.cc: In function 'long long int dfs(long long int)': a.cc:19:68: error: 'MOD' was not declared in this scope 19 | return ((dfs(NN - 2)) + (2LL * dfs(NN - 1)) + 2LL)%MOD; | ^~~ a.cc:21:70: error: 'MOD' was not declared in this s...
s133097938
p03849
C++
#include <iostream> #define int long long using namespace std; int n; //短いほうの1辺の長さがn, nは2のべき乗 int f(int n) { if (n == 1) return 1; return (f(n / 2) * 3) % 1000000007; } int g(int n) { return f(n); //もうまじむり } int main() { cin >> n; cout << g(n) << endl; return 0; }
cc1plus: error: '::main' must return 'int'
s711288022
p03850
C++
#include <bits/stdc++.h> using namespace std; #define LL long long inline int read(){ int x=0,f=1; char ch=getchar(); while (ch<'0' || ch>'9'){ if (ch=='-') f=-1; ch=getchar(); } while (ch>='0' && ch<='9'){ x=x*10+ch-'0';ch=getchar(); } return x*f; } signed main(){ int n=read(); x=0,y=z=-10000000000000ll...
a.cc: In function 'int main()': a.cc:18:9: error: 'x' was not declared in this scope 18 | x=0,y=z=-10000000000000ll; | ^ a.cc:18:13: error: 'y' was not declared in this scope 18 | x=0,y=z=-10000000000000ll; | ^ a.cc:18:15: error: 'z' was not declared in this scope ...
s095943618
p03850
C++
#include <bits/stdc++.h> template <class T> inline void read(T &res) { res = 0; bool bo = 0; char c; while (((c = getchar()) < '0' || c > '9') && c != '-'); if (c == '-') bo = 1; else res = c - 48; while ((c = getchar()) >= '0' && c <= '9') res = (res << 3) + (res << 1) + (c - 48); if (bo) res = ~res + 1; } te...
a.cc: In function 'void work()': a.cc:28:28: error: cannot convert 'char*' to 'char**' 28 | read(n); getline(s + 1); | ~~^~~ | | | char* In file included from /usr/include/c++/14/cstdio:42, from ...
s410487168
p03850
C++
#include <bits/stdc++.h> template <class T> inline void read(T &res) { res = 0; bool bo = 0; char c; while (((c = getchar()) < '0' || c > '9') && c != '-'); if (c == '-') bo = 1; else res = c - 48; while ((c = getchar()) >= '0' && c <= '9') res = (res << 3) + (res << 1) + (c - 48); if (bo) res = ~res + 1; } te...
a.cc: In function 'void work()': a.cc:28:18: error: 'gets' was not declared in this scope; did you mean 'getw'? 28 | read(n); gets(s + 1); | ^~~~ | getw a.cc: In function 'int main()': a.cc:50:9: error: 'T' was not declared in this scope 50 | T = 1; ...
s439511388
p03850
C++
//@winlere #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; char __buf[1<<18],*__c=__buf,*__ed=__buf; inline int qr(){ int ret=0,f=0,c=getchar(); while(!isdigit(c)) f|=c==45,c=getchar(); while( isdigit(c)) ret=ret*10+c-48,c=getchar(); return f?...
a.cc: In function 'int main()': a.cc:21:31: error: reference to 'data' is ambiguous 21 | for(int t=1;t<=n;++t) data[t]=qr(); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, fro...
s831875061
p03850
C++
// Math = ♥️ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; /*-------------------------------------------------------------------------------------------------------------------------*/ #define ll long long ...
a.cc: In function 'int main()': a.cc:67:15: error: incompatible types in assignment of 'long long int' to 'long long int [3]' 67 | dp[i] = INF; | ^
s906485977
p03850
C++
// Math = ♥ // Sometimes it is people that no one imagines anything of who do things that no one can imagine // After all this time? Always #include <bits/stdc++.h> // uncomment before submission //#include <ext/pb_ds/assoc_container.hpp> // uncomment before submission //#include <ext/pb_ds/tre...
a.cc: In function 'int main()': a.cc:63:61: error: expected ')' before ';' token 63 | dp[i][0] = max(dp[i][0], max(dp[i][1], dp[i][2]); | ~ ^ | )
s282066442
p03850
C++
// Math = ♥ // Sometimes it is people that no one imagines anything of who do things that no one can imagine // After all this time? Always #include <bits/stdc++.h> // uncomment before submission //#include <ext/pb_ds/assoc_container.hpp> // uncomment before submission //#include <ext/pb_ds/tre...
a.cc: In function 'int main()': a.cc:63:47: error: expected ';' before ')' token 63 | dp[i][0] = max(dp[i][0], dp[i][2])); | ^ | ;
s954982006
p03850
C++
#include <bits/stdc++.h> #define inf 100000000000000ll using namespace std; int read(); int n; long long f[100005][3]; void chmax(long long &x, long long y) { x = x > y ? x : y; } int main() { n = read(); f[0][0] = 0, f[0][1] = f[0][2] = -inf; for (int i = 1, x; i <= n; ++i) { x = read(); ...
/usr/bin/ld: /tmp/ccsdsQBX.o: in function `main': a.cc:(.text+0x39): undefined reference to `read()' /usr/bin/ld: a.cc:(.text+0x7a): undefined reference to `read()' collect2: error: ld returned 1 exit status
s742737023
p03850
C++
#include<bits/stdc++.h> using namespace std; const int maxn=15; const int mod=1e9+7; const int S=(1<<4)+10; int n,k,top=0; int a[maxn],bel[maxn]; struct cat { int val,col; bool operator ==(const cat &b)const { return val==b.val&&col==b.col; } bool operator <(const cat &b)const { return val==b.val?col<b.col...
a.cc: In function 'void calc(int)': a.cc:88:28: error: no matching function for call to 'count(int&)' 88 | ans+=(count(s)&1?-1:1)*C(n-sum+now-1,now-1)%mod; | ~~~~~^~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gn...
s112759249
p03850
C++
#include <bits/stdc++.h> using namespace std; #define X first #define Y second #define pb push_back typedef pair<int, int> ii; typedef long long ll; const int maxn = 2e5+5; int n; int arr[maxn]; ll sum[maxn]; ll qs[maxn]; int main() { scanf("%d", &n); int best = 0; for(int i = 1; i<= n; i++) { char tmp = '+'...
a.cc: In function 'int main()': a.cc:51:27: error: no matching function for call to 'max(int&, ll)' 51 | best = max(best, qs[neg[i]-1]+loc+sum[neg[i+1]]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s222002961
p03850
C++
long a,b,c;o; main(A){ b=c=-1e9; for(scanf("%*d%ld",&a);~scanf(" %c%d",&o,&A);) b=o%3?a+=A,fmax(b-A,c+=A):(a=fmax(a-A,c=b+A)); printf("%ld",a); }
a.cc:1:12: error: 'o' does not name a type 1 | long a,b,c;o; | ^ a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(A){ | ^
s833320658
p03850
C++
#include <bits/stdc++.h> using namespace std; #define int long long const double PI = 3.14159265358979323846; typedef vector<int> vint; typedef pair<int, int> pint; int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int N; int A[110000]; char op[110000]; signed main() { cin >> N; ...
a.cc: In function 'int main()': a.cc:26:49: error: 'min_dec' was not declared in this scope 26 | if (total_minus > 0)min_minus = min(min_dec, total_minus + cur_minus); | ^~~~~~~
s156885641
p03850
C++
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<iostream> #include<algorithm> #include<queue> #include<time.h> #include<stack> #include<map> #include<set> #include<string> using namespace std; int main() { int n,i,t,j=0,x=0; cin>>n; int s[100008]={0}; bool k[100008]={0}...
a.cc: In function 'int main()': a.cc:24:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 24 | gets(r); | ^~~~ | getw
s139457716
p03850
Java
import java.io.*; import java.math.*; import java.util.*; import java.util.stream.*; public class mm_martian_n2 { static final long INF = Long.MAX_VALUE / 10; void submit() { int n = nextInt(); long[] a = new long[n]; boolean[] plus = new boolean[n - 1]; for (int i = 0; i < n; i++) { a[i] = nextInt(); ...
Main.java:6: error: class mm_martian_n2 is public, should be declared in a file named mm_martian_n2.java public class mm_martian_n2 { ^ 1 error
s667884088
p03850
Java
import java.io.*; import java.math.*; import java.util.*; import java.util.stream.*; public class mm_martian_ac { static final long INF = Long.MAX_VALUE / 10; void submit() { int n = nextInt(); long[] a = new long[n]; boolean[] plus = new boolean[n - 1]; for (int i = 0; i < n; i++) { a[i] = nextInt(); ...
Main.java:6: error: class mm_martian_ac is public, should be declared in a file named mm_martian_ac.java public class mm_martian_ac { ^ 1 error
s150048171
p03850
C++
//ΔARC066E #include<iostream> #include<cstdio> #include<fstream> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #include<cmath> #include<cstring> #include<cstdlib> using namespace std; typedef long long LL; typedef double DB; const int N = 111111; const LL INF = 1e18; int n,a[N],op[N];...
a.cc: In function 'int main()': a.cc:36:44: error: expected ',' before '-' token 36 | dp[i][1]=max(max([i-1][0]-a[i],dp[i-1][1]+a[i]),dp[i-1][2]+a[i]); | ^ | , a.cc:36:44: error: expected identif...
s706327119
p03850
C++
#include<bits/stdc++.h> using namespace std; typedef long long LL; int n,a[100008],t,next,pos[100008]; char op[100008]; LL ans,tmp,suf[100008]; int main() { ios::sync_with_stdio(false); cin>>n>>t; for(int i=1;i<n;++i){ cin>>op[i]>>a[i]; } next=n; for(int i=n-1;i;--i){ suf[i]=suf[i+1]+a[i]; if(op[i]=='-'){ ...
a.cc: In function 'int main()': a.cc:14:9: error: reference to 'next' is ambiguous 14 | next=n; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++...
s389546521
p03850
C++
#include<cstdio> #include<cstring> #include<algorithm> #define N 100010 #define ll long long #define inf 1000000000000000000LL using namespace std; int n, flag[N], w[N], next[N]; ll ans, now, s[N]; char S[10]; int main(){ scanf("%d", &n); memset(flag, 0, sizeof(flag)); for(int i=1; i<=n; i++){ scanf("%d", &w[i]); ...
a.cc: In function 'int main()': a.cc:19:30: error: reference to 'next' is ambiguous 19 | for(int i=n; i; i--){next[i]=now; if(flag[i])now=i;} | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, ...
s959892047
p03850
C++
Status Accepted Time 14ms Memory 2424kB Length 859 Lang C++14 (GCC 5.3.0) Submitted 2017-03-11 14:37:44 Shared RemoteRunId 1154502 Select Code #include <bits/stdc++.h> using namespace std; #define X first #define Y second #define LL long long #define ULL unsigned long long #define PB push_back #define MP make_pair #...
a.cc:11:12: error: too many decimal points in number 11 | C++14 (GCC 5.3.0) | ^~~~~ a.cc:2:1: error: 'Status' does not name a type 2 | Status | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, ...
s901747865
p03850
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <map> #include <set> #include <string> #include <cstring> #include <bitset> #define ll long long #define rep(x,n) for(ll (x)=0;(x)<n;(x)++) #define rep1(x,n) for(ll (x)=1;(x)<=n;(x)++) #define ios::sy...
a.cc:15:9: warning: ISO C++11 requires whitespace after the macro name 15 | #define ios::sync_with_stdio(0); | ^~~ a.cc: In function 'int main()': a.cc:31:8: error: expected initializer before '>>' token 31 | cin>>n>>a[0]; | ^~
s450330824
p03850
C++
#include <iostream> #include <algorithm> #include <string.h> using namespace std; #define pb push_back #define mp make_pair #define ll long long #define ull unsigned ll #define db double #define INF 0x3f3f3f3f #define MOD 1000000007 #define PII pair<int, int> int n; ll a[100010]; char op[100010]; char buf[8]; ll le...
a.cc: In function 'int main()': a.cc:26:5: error: reference to 'left' is ambiguous 26 | left=a[0]; | ^~~~ In file included from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/inc...
s974228559
p03850
C++
#include <bits/stdc++.h> #define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++) #define REP(i,b) FOR(i,0,b) using namespace std; typedef long long LL; const int SIZE=5+1e5; const LL INF=1<<30; const LL p=7+(1e9); LL A[SIZE]; char B[SIZE]; bool isMinus[SIZE]; int main(){ int N; cin >> N; LL ans=0; cin >> ans; REP(i,N-1){ ...
a.cc: In function 'int main()': a.cc:2:24: error: 'ut' was not declared in this scope 2 | #define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++) | ^~ a.cc:3:18: note: in expansion of macro 'FOR' 3 | #define REP(i,b) FOR(i,0,b) | ^~~ a.cc:17:9: note: in expansion of ma...
s841076390
p03850
C
#include <stdio.h> #define MAX(a, b) ((a)>(b))?(a):(b) #define MIN(a, b) ((a)<(b))?(a):(b) const long long int z = 1000000000000000ULL; int a[200000]; char b[200000]; long long int dpmax[100000][100000]; long long int dpmin[100000][100000]; void solve(int i, int j){ long long int x, y; if(dpmax[i][j] != z) re...
/tmp/ccQAOVjG.o: in function `solve': main.c:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `dpmin' defined in .bss section in /tmp/ccQAOVjG.o main.c:(.text+0x2a1): relocation truncated to fit: R_X86_64_PC32 against symbol `dpmin' defined in .bss section in /tmp/ccQAOVjG.o main.c:(.text+0x2ea):...
s336481046
p03851
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pii> pipii; typedef pair<pii, int> piipi; typedef pair<pii, pii> piipii; #define mp make_pair #define fi first #define se second #define all(a) (a).begin(), (a).end() #define sz(a) (int)(a).size() #define...
a.cc: In function 'void dfs(int, int)': a.cc:60:20: error: no matching function for call to 'max(ll&, int)' 60 | dp[s] = max(dp[s], 1-t[s]); | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc+...
s790400062
p03851
C++
#include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define all(x) (x).begin() , (x).end() #define rall(x) (x).rbegin() , (x).rend() #define len(x) (int)(x).size() using namespace std; //#define int long long typedef long long ll; typedef long double ld; typedef pair<int,int> pii; const i...
a.cc: In function 'void solve(int, int)': a.cc:66:83: error: no matching function for call to 'max(long long int, int)' 66 | answer[u.se] = max(answer[u.se] , ansPref[l - 1] + ansSuf[l + 1] + max(0ll , 1 - u.fi)); | ~~~^...
s466313341
p03851
C++
#include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define all(x) (x).begin() , (x).end() #define rall(x) (x).rbegin() , (x).rend() #define len(x) (int)(x).size() using namespace std; #define int long long typedef long long ll; typedef long double ld; typedef pair<int,int> pii; const int...
a.cc: In function 'void solve(long long int, long long int)': a.cc:62:83: error: no matching function for call to 'max(int, long long int)' 62 | answer[u.se] = max(answer[u.se] , ansPref[l - 1] + ansSuf[l + 1] + max(0 , 1 - u.fi)); | ...
s472986088
p03851
C++
#include<cstdio> #include<algorithm> using namespace std; #define int long long #define N 300010 struct no{ int k,b; int f(int x){return k*x+b;} }st[N]; double xl(no a,no b){ return (b.b-a.b)/double(a.k-b.k); } int f[N],g[N],a[N],v[N],h[N],n,tp; void dp(int *f){ for(int i=1;i<=n;i++) v[i]=v[i-1]+a[i]; tp=1; st[...
a.cc: In function 'int main()': a.cc:63:9: error: 'cin' was not declared in this scope 63 | cin>>n; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<algorithm> +++ |+#include <iostream> 3 | using ...