submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s832747790
p03739
C++
#include"bits/stdc++.h" using namespace std; int main(){ int n; cin>>n; vector<int> x; int temp,ans=0; for(int i=0;i!=n;++i){ cin>>temp; x.push_back(temp); } if(!x[0]){ x[0]=1; ++ans; int val,ind; for(int i=0;i!=n;++i){ if(!x[i]){ val=x[i]; ind=i; break; } } if((val>0 && ind%2) || (val<0 && !(ind%2)) x[0]=-1; } int sum=x[0]; for(int i=1;i!=n;++i){ int sum2=sum+x[i]; if(sum*sum2>=0){ ans+=abs(sum2)+1; if(sum<0) sum2=1; else sum2=-1; } sum=sum2; } cout<<ans; }
a.cc: In function 'int main()': a.cc:23:59: error: expected ';' before 'x' 23 | if((val>0 && ind%2) || (val<0 && !(ind%2)) | ^ | ; 24 | x[0]=-1; | ~ a.cc:25:9: error: expected primary-expression before '}' token 25 | } | ^ a.cc:24:33: error: expected ')' before '}' token 24 | x[0]=-1; | ^ | ) 25 | } | ~ a.cc:23:19: note: to match this '(' 23 | if((val>0 && ind%2) || (val<0 && !(ind%2)) | ^ a.cc:25:9: error: expected primary-expression before '}' token 25 | } | ^
s777829108
p03739
C++
#include <bits/stdc++.h> using namespace std; __int64 dp[100005][2],s[100005][2]; int a[100005]; int main() { //freopen("1.txt","w",stdout); int n; scanf("%d",&n); for(int i=0;i<n;++i) scanf("%d",&a[i]); if(a[0]<0) { dp[0][0]=0; s[0][0]=a[0]; dp[0][1]=1-a[0]; s[0][1]=1; } else if(a[0]>0) { dp[0][1]=0; s[0][1]=a[0]; dp[0][0]=1+a[0]; s[0][0]=-1; } else { dp[0][0]=1; s[0][0]=-1; dp[0][1]=1; s[0][1]=1; } for(int i=1;i<n;++i) { __int64 x=s[i-1][1]; x+=a[i]; if(x<0) { dp[i][0]=0; s[i][0]=x; } else if(x>0) { dp[i][0]=1+x; s[i][0]=-1; } else { dp[i][0]=1; s[i][0]=-1; } dp[i][0]+=dp[i-1][1]; x=s[i-1][0]; x+=a[i]; if(x<0) { dp[i][1]=1-x; s[i][1]=1; } else if(x>0) { dp[i][1]=0; s[i][1]=x; } else { dp[i][1]=1; s[i][1]=1; } dp[i][1]+=dp[i-1][0]; } printf("%I64d\n",min(dp[n-1][0],dp[n-1][1])); return 0; }
a.cc:3:1: error: '__int64' does not name a type; did you mean '__int64_t'? 3 | __int64 dp[100005][2],s[100005][2]; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:13:17: error: 'dp' was not declared in this scope; did you mean 'dup'? 13 | dp[0][0]=0; | ^~ | dup a.cc:14:17: error: 's' was not declared in this scope 14 | s[0][0]=a[0]; | ^ a.cc:20:25: error: 'dp' was not declared in this scope; did you mean 'dup'? 20 | dp[0][1]=0; | ^~ | dup a.cc:21:25: error: 's' was not declared in this scope 21 | s[0][1]=a[0]; | ^ a.cc:27:25: error: 'dp' was not declared in this scope; did you mean 'dup'? 27 | dp[0][0]=1; | ^~ | dup a.cc:28:25: error: 's' was not declared in this scope 28 | s[0][0]=-1; | ^ a.cc:34:17: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 34 | __int64 x=s[i-1][1]; | ^~~~~~~ | __ynf64 a.cc:35:17: error: 'x' was not declared in this scope 35 | x+=a[i]; | ^ a.cc:38:25: error: 'dp' was not declared in this scope; did you mean 'dup'? 38 | dp[i][0]=0; | ^~ | dup a.cc:39:25: error: 's' was not declared in this scope 39 | s[i][0]=x; | ^ a.cc:43:33: error: 'dp' was not declared in this scope; did you mean 'dup'? 43 | dp[i][0]=1+x; | ^~ | dup a.cc:44:33: error: 's' was not declared in this scope 44 | s[i][0]=-1; | ^ a.cc:48:33: error: 'dp' was not declared in this scope; did you mean 'dup'? 48 | dp[i][0]=1; | ^~ | dup a.cc:49:33: error: 's' was not declared in this scope 49 | s[i][0]=-1; | ^ a.cc:51:17: error: 'dp' was not declared in this scope; did you mean 'dup'? 51 | dp[i][0]+=dp[i-1][1]; | ^~ | dup a.cc:53:19: error: 's' was not declared in this scope 53 | x=s[i-1][0]; | ^ a.cc:72:30: error: 'dp' was not declared in this scope; did you mean 'dup'? 72 | printf("%I64d\n",min(dp[n-1][0],dp[n-1][1])); | ^~ | dup
s989844898
p03740
C++
#include <bits/stdc++.h> //#include <atcoder/all> #define ll long long int #define MOD 1000000007 #define P pair<ll,ll> #define INF 1000000000000000000 //using namespace atcoder; using namespace std; int main(void){ ll x, y; cin >> x >> y; if (abs(x-y) < 2) cout << "Brown" << endl; else cout << "Alice" << end; return 0; }
a.cc: In function 'int main()': a.cc:18:21: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 18 | cout << "Alice" << end; | ~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 30
s865459906
p03740
C++
#include<bits/stdc++.h> using namespace std; int main() { int64_t x, y; cin >> x >> y; if (abs(x, y) <= 1) { cout << "Brown"; } else { cout << "Alice"; } return 0; }
a.cc: In function 'int main()': a.cc:6:10: error: no matching function for call to 'abs(int64_t&, int64_t&)' 6 | if (abs(x, y) <= 1) { | ~~~^~~~~~ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)' 445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)' 445 | _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate expects 1 argument, 2 provided In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)' 892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); } | ^~~ /usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 2 provided In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ /usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 2 provided In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 2 provided
s771162289
p03740
Java
import java.util.*; import java.io.*; import java.math.BigInteger; public class A { private static final int mod =(int)1e9+7; public static void main(String[] args) throws Exception { Scanner sc=new Scanner(System.in); PrintWriter out=new PrintWriter(System.out); long x=sc.nextLong(); long y=sc.nextLong(); if(Math.abs(x-y)<=1) { System.out.println("Brown"); }else { out.println("Alice"); } out.flush(); } static boolean vis[]=new boolean[10001]; static int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a); } // Function to find gcd of array of // numbers static int f(int arr[], int n) { int result = n; int max=-1; int ans=0; for (int element: arr){ if(vis[element]==false) result = gcd(n, element); if(result>max) { max=result; ans=element; } } return ans; } }
Main.java:5: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s309268001
p03740
C
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int a, b; cin >> a >> b; if (abs(a-b) <= 1){ cout << "Brown"; } else{ cout << "Alice"; } return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s055818887
p03740
C++
#include <bits/stdc++.h> using ll = long long; using namespace std; #define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++) #define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++) #define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--) #define rreps(i,n) for(int i=((int)(n));i>0;i--) #define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++) #define all(x) (x).begin(), (x).end() #define F first #define S second #define mp make_pair #define pb push_back #define solve(a) ((a)?"Alice":"Brown") typedef vector<int> Vi; typedef vector<Vi> VVi; typedef pair<int , int> Pi; typedef vector<Pi> VPi; typedef vector<long long> V; typedef vector<V> VV; typedef pair<long long , long long> P; typedef vector<P> VP; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;} template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;} const long long INFLL = 1LL<<60; const int INF = 1<<30; const double PI=acos(-1); int main(){ lll s,t; bool ans=false; cin >>s>>t; if(s+t <=1){ ans=false; }else{ if(abs(s-t) <=1){ ans=false; }else{ ans=true; } } cout<<solve(ans)<<endl; } /* fin: 1,0 or 1,1 -> 0,2 or 0,3 -> 2,1 or 4,1 or 2,2 -> 4,0 or 1,3 or 0,5 determent:(0,0)second | (1,0)second| (1,1)second (2,0)first, |(1,2)second, (3,0)first| (1,3)first (2,2) second (4,0) first |(5,0)first (4,1)first (3,2) second| S 0 SS 1 FSF 2 FSSF 3 FFSFF 4 FFSSFF 5 (3,2) FFFSFFF 6 (3,3) (1,2) ,(2,3), (3,4,5,6),(4,5,6,7,8) (5-) 3, 2,1 second 5,0 -> (4(3,1)->second,3(1,2)-> first)->() */
a.cc: In function 'int main()': a.cc:29:9: error: 'lll' was not declared in this scope; did you mean 'll'? 29 | lll s,t; | ^~~ | ll a.cc:31:15: error: 's' was not declared in this scope 31 | cin >>s>>t; | ^ a.cc:31:18: error: 't' was not declared in this scope; did you mean 'tm'? 31 | cin >>s>>t; | ^ | tm
s854517729
p03740
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; #define MODSIZE 1000000007 int main(){ ll x,y; ll a = 0; ll b = 0; scanf("%lld %lld", &x, &y); if(abs(X - Y) <= 1) printf("Brown\n"); else printf("Alice\n"); return 0; }
a.cc: In function 'int main()': a.cc:14:10: error: 'X' was not declared in this scope 14 | if(abs(X - Y) <= 1) printf("Brown\n"); | ^ a.cc:14:14: error: 'Y' was not declared in this scope 14 | if(abs(X - Y) <= 1) printf("Brown\n"); | ^
s537745202
p03740
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s831264628
p03740
C++
#include <bits/stdc++.h> using namespace std; long long abs(long long x) { return x>=0?x:-x; } int main() { long long x,y; cin>>x>>y; cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:19: error: call of overloaded 'abs(long long int)' is ambiguous 11 | cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl; | ~~~^~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42, from a.cc:1: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:3:11: note: candidate: 'long long int abs(long long int)' 3 | long long abs(long long x) | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s249315156
p03740
C++
#include <bits/stdc++.h> using namespace std; long long abs(long long x) { return x>=0?x:-x; } int main() { long long x,y; cin>>x>>y; cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:19: error: call of overloaded 'abs(long long int)' is ambiguous 11 | cout<<(abs(x-y)<=1?"Brown":"Alice")<<endl; | ~~~^~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42, from a.cc:1: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:3:11: note: candidate: 'long long int abs(long long int)' 3 | long long abs(long long x) | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s011881897
p03740
C++
#include<bits/stdc++.h> using namespace std; int main() { long long int x, y; cin>>x>>y; if(abs(x-y) <= 1) cout<<"Brown"; else cout<<"Alice" return 0; }
a.cc: In function 'int main()': a.cc:11:22: error: expected ';' before 'return' 11 | cout<<"Alice" | ^ | ; 12 | return 0; | ~~~~~~
s130768328
p03740
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 int64_t #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq priority_queue<int> #define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key))) #define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key))) #define tii tuple<int,int,int> signed main(){ string A,B; cin>>A>>B; string ans="Alice"; if(A.size()<B.size()) ans="Brown"; else if(A.size()==B.size()){ if(A<=B) ans="Brown"; else{ if(A[A.size()-1]!='0'){ A[A.size()-1]-=1; if(A<=B) ans="Brown"; } else{ int a=stoll(A).b=stoll(B); if(a<=b+1) ans="Brown"; } } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:31:24: error: request for member 'b' in 'std::__cxx11::stoll(A, 0, 10)', which is of non-class type 'long long int' 31 | int a=stoll(A).b=stoll(B); | ^ a.cc:32:15: error: 'b' was not declared in this scope 32 | if(a<=b+1) | ^
s473210549
p03740
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 uint64_t #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq priority_queue<int> #define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key))) #define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key))) #define tii tuple<int,int,int> signed main(){ string A,B; cin>>A>>B; string ans="Alice"; if(A.size()<B.size()) ans="Brown"; else if(A.size()==B.size()){ if(A<=B) ans="Brown"; else{ if(A[A.size()-1]!='0'){ A[A.size()-1]-=1; if(A<=B) ans="Brown"; } else{ int a=stoll(A).b=stoll(B); if(a<=b+1) ans="Brown"; } } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:31:24: error: request for member 'b' in 'std::__cxx11::stoll(A, 0, 10)', which is of non-class type 'long long int' 31 | int a=stoll(A).b=stoll(B); | ^ a.cc:32:15: error: 'b' was not declared in this scope 32 | if(a<=b+1) | ^
s788366351
p03740
C++
#include <bits/stdc++.h> #define ri register int #define ll long long using namespace std; int read() { int num=0; int flg=1; char c=getchar(); while(!isdigit(c)) { if(c=='-') { flg=-1; } c=getchar(); } while(isdigit(c)) { num=(num<<1)+(num<<3)+(c^48); c=getchar(); } return num*flg; } int main() { return 0&(int)puts(abs(read()-read())<=1?"Brown":"Alice");
a.cc: In function 'int main()': a.cc:29:63: error: expected '}' at end of input 29 | return 0&(int)puts(abs(read()-read())<=1?"Brown":"Alice"); | ^ a.cc:28:1: note: to match this '{' 28 | { | ^
s753508622
p03740
C++
#include<bits/stdc++.h> using namespace std; long read(){ long num=0,flag=1; char c=getchar(); while(!isdigit(c)){ if(c=='-') flag=-1; c=getchar(); } while(isdigit(c)){ num=(num<<1)+(num<<3)+(c^48); c=getchar(); } return num*flg; } int main(){ puts(abs(read()-read())<=1?"Brown":"Alice"); return 0; }
a.cc: In function 'long int read()': a.cc:14:16: error: 'flg' was not declared in this scope; did you mean 'flag'? 14 | return num*flg; | ^~~ | flag
s004332322
p03740
C++
# include <iostream> using namespace std; typedef long long ll; int main(void){ ll n, m; cin >> n>> m; if (abs(n-m) <= 1) cout << Brown << endl; else cout << Alice << endl; }
a.cc: In function 'int main()': a.cc:8:30: error: 'Brown' was not declared in this scope 8 | if (abs(n-m) <= 1) cout << Brown << endl; | ^~~~~ a.cc:9:16: error: 'Alice' was not declared in this scope 9 | else cout << Alice << endl; | ^~~~~
s246699913
p03740
C++
#include<bits/stdc++.h> using namespace std; int main { unsigned long long int x ,y; cin>>x>>y; if(abs(x - y) <= 1) puts("Brown"); else puts("Alice"); }
a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main | ^~~~ a.cc:5:9: error: expected primary-expression before 'unsigned' 5 | unsigned long long int x ,y; | ^~~~~~~~ a.cc:5:9: error: expected '}' before 'unsigned' a.cc:4:1: note: to match this '{' 4 | { | ^ a.cc:6:5: error: 'cin' does not name a type 6 | cin>>x>>y; | ^~~ a.cc:7:5: error: expected unqualified-id before 'if' 7 | if(abs(x - y) <= 1) puts("Brown"); | ^~ a.cc:8:5: error: expected unqualified-id before 'else' 8 | else puts("Alice"); | ^~~~ a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s147563664
p03740
C++
#include "bits/stdc++.h" using namespace std; int main() { ll X, Y; cin >> X >> Y; if (abs(X - Y) < 2) { cout << "Brown" << endl; } else { cout << "Alice" << endl; } }
a.cc: In function 'int main()': a.cc:5:5: error: 'll' was not declared in this scope 5 | ll X, Y; | ^~ a.cc:6:12: error: 'X' was not declared in this scope 6 | cin >> X >> Y; | ^ a.cc:6:17: error: 'Y' was not declared in this scope 6 | cin >> X >> Y; | ^
s740773606
p03740
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, n) for (ll i = 0; i < n; i++) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define len(v) ll(v.size()) #define fi first #define se second template <class T> void cout_vec(const vector<T> &vec){ for(auto itr:vec) cout<<itr<<' '; cout<<endl; } typedef pair<ll,ll> P; const ll mod=1e9+7; const ll inf=1e15; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll x,y; cin>>x>>y; if(|x-y|<=1) cout<<"Brown"<<endl; else cout<<"Alice"<<endl; }
a.cc: In function 'int main()': a.cc:26:6: error: expected primary-expression before '|' token 26 | if(|x-y|<=1) cout<<"Brown"<<endl; | ^ a.cc:26:11: error: expected primary-expression before '<=' token 26 | if(|x-y|<=1) cout<<"Brown"<<endl; | ^~
s523397059
p03740
C++
#include <bits/stdc++.h> using namespace std; #define lli long long int #define MOD 1000000007 #define DEBUG 0 #define REP(i,n) for(int i=0;i<n;i++) int main(){ lli x,y; cin>>x,y; cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:23: error: no match for 'operator<=' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int') 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ~~~~~~~~~~~~~~^~~ | | | | | int | std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>} a.cc:15:23: note: candidate: 'operator<=(int, int)' (built-in) 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ~~~~~~~~~~~~~~^~~ a.cc:15:23: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1154:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1154 | operator<=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1154:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/regex.h:1260:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<=(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1260 | operator<=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1260:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/regex.h:1353:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<=(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1353 | operator<=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1353:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/regex.h:1427:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1427 | operator<=(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1427:5: note: template argument deduction/substitution failed: a.cc:15:25: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/regex.h:1521:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1521 | operator<=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1521:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/regex.h:1599:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1599 | operator<=(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1599:5: note: template argument deduction/substitution failed: a.cc:15:25: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/regex.h:1699:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1699 | operator<=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1699:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1064:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1064 | operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1064:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:469:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 469 | operator<=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:469:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:513:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 513 | operator<=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:513:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1704:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1704 | operator<=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1704:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1767:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1767 | operator<=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1767:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:717:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 717 | operator<=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:717:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/string_view:724:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 724 | operator<=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:724:5: note: template argument deduction/substitution failed: a.cc:15:25: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | cout<<abs(x-y)<=1 ? "Brown":"Alice"<<endl; | ^ /usr/include/c++/14/string_view:732:5: note: candidate: 'template
s340753528
p03740
C++
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <string> #include <queue> #include <stack> #include <math.h> #define MOD 1000000007 #define INF INT_MAX #define NINF INT_MIN #define LLINF LLONG_MAX using ll = long long; using namespace std; int main() { int X, Y; ll >> X >> Y; if (abs(X - Y) <= 1) { cout << "Brown" << endl; } else { cout << "Alice" << endl; } getchar(); getchar(); return 0; }
a.cc: In function 'int main()': a.cc:19:8: error: expected unqualified-id before '>>' token 19 | ll >> X >> Y; | ^~
s838436848
p03740
C++
#include<bits/stdc++> using namespace std; int main(void){ long long x, y; cin >> x >> y; if(abs(x-y)<=1) cout << "Brown" << endl; else cout << "Alice" << endl; }
a.cc:1:9: fatal error: bits/stdc++: No such file or directory 1 | #include<bits/stdc++> | ^~~~~~~~~~~~~ compilation terminated.
s187102294
p03740
C++
#include <cstdio> main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));}
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));} | ^~~~ a.cc: In function 'int main()': a.cc:2:22: error: 'cin' is not a member of 'std' 2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));} | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <cstdio> +++ |+#include <iostream> 2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));} a.cc:2:38: error: 'abs' was not declared in this scope 2 | main(){long X,Y;std::cin>>X>>Y;puts((abs(X-Y)<2?"Brown":"Alice"));} | ^~~
s335181072
p03740
C++
#include <bits.stdc++.h> using namespace std; typedef long long ll; ll x, y; int main() { cin >> x >> y; if(abs(x - y) > 1) puts("Alice"); else puts("Brown"); }
a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory 1 | #include <bits.stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s094918072
p03740
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <utility> #include <cmath> #include <functional> #include <queue> //#include <stack> #include <climits> #include <map> #define REP(i,n) for(int i=0;i<n;i++) #define FOR(i,n1,n2) for(int i=n1;i<n2;i++) #define put(a) cout<<a<<endl; using namespace std; typedef long long ll; //typedef unsigned long long ull; typedef pair<int, int> P; ll x,y; int main() { cin >> x >> y; if(abs(x-y)<=1){ put("Brown"); else{ put("Alice"); } return 0; }
a.cc: In function 'int main()': a.cc:26:6: error: expected '}' before 'else' 26 | else{ | ^~~~ a.cc:24:20: note: to match this '{' 24 | if(abs(x-y)<=1){ | ^
s239988119
p03740
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <math.h> #define MOD 1000000007 typedef long long ll; using namespace std; int main(){ unsigned long long x,y; cin>>x>>y; if(abs(x-y)>=2) cout<<"Alice"<<endl; else cout<<"Brown"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:9: error: call of overloaded 'abs(long long unsigned int)' is ambiguous 13 | if(abs(x-y)>=2) cout<<"Alice"<<endl; | ~~~^~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/include/c++/14/iostream:41, from a.cc:1: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s207612459
p03740
C++
#inclde <bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a >> b; cout << ((abs(a-b) > 1) ? "Alice" : "Brouwn" ) << endl; }
a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include? 1 | #inclde <bits/stdc++.h> | ^~~~~~ | include a.cc: In function 'int main()': a.cc:7:3: error: 'cin' was not declared in this scope 7 | cin >> a >> b; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #inclde <bits/stdc++.h> a.cc:8:3: error: 'cout' was not declared in this scope 8 | cout << ((abs(a-b) > 1) ? "Alice" : "Brouwn" ) << endl; | ^~~~ a.cc:8:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:13: error: 'abs' was not declared in this scope 8 | cout << ((abs(a-b) > 1) ? "Alice" : "Brouwn" ) << endl; | ^~~ a.cc:8:53: error: 'endl' was not declared in this scope 8 | cout << ((abs(a-b) > 1) ? "Alice" : "Brouwn" ) << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #inclde <bits/stdc++.h>
s395873836
p03740
C++
#include <iostream> using namespace std; long long X,Y; int main(){ cin >> X >> Y; if((X+Y>1 && abs(X-Y)<=1) || (X==0 && Y==0) cout << "Brown" << endl; else cout << "Alice" << endl; }
a.cc: In function 'int main()': a.cc:8:46: error: expected ';' before 'cout' 8 | if((X+Y>1 && abs(X-Y)<=1) || (X==0 && Y==0) cout << "Brown" << endl; | ^~~~~ | ; a.cc:9:3: error: expected primary-expression before 'else' 9 | else cout << "Alice" << endl; | ^~~~ a.cc:8:71: error: expected ')' before 'else' 8 | if((X+Y>1 && abs(X-Y)<=1) || (X==0 && Y==0) cout << "Brown" << endl; | ~ ^ | ) 9 | else cout << "Alice" << endl; | ~~~~
s631176344
p03740
C++
#include<iostream> #include<string> using namespace std; int main(){ int a,b; cin>>a>>b; int n=0; for(int i=a;i<b;++i)n+=(a-i); cout<<(n%2==0?Alice:Brown)<<endl; }
a.cc: In function 'int main()': a.cc:9:15: error: 'Alice' was not declared in this scope 9 | cout<<(n%2==0?Alice:Brown)<<endl; | ^~~~~ a.cc:9:21: error: 'Brown' was not declared in this scope 9 | cout<<(n%2==0?Alice:Brown)<<endl; | ^~~~~
s059402475
p03740
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<string> #include<algorithm> #include<stack> #include<map> #include<deque> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back //#define ll __int64 #define ll long long #define P pair<ll,ll> int main(){ cin>>a>>b; if(abs(a-b)<=1)cout<<"Brown"<<endl; else cout<<"Alice"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:14: error: 'a' was not declared in this scope 22 | cin>>a>>b; | ^ a.cc:22:17: error: 'b' was not declared in this scope; did you mean 'pb'? 22 | cin>>a>>b; | ^ | pb
s948069809
p03740
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<string> #include<algorithm> #include<stack> #include<map> #include<deque> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back #define ll __int64 //#define ll long long #define P pair<ll,ll> ll a,b; bool dfs(ll a,ll b,bool f){ //cout<<a<<" "<<b<<" "<<f<<endl; if(f){ if(a<=1&&b<=1){return 0;} bool v1=0,v2=0; if(a>=2)v1=dfs(a%2,b+a/2,0); if(b>=2)v2=dfs(a+b/2,b%2,0); if(v1||v2)return 1; else return 0; } else{ if(a<=1&&b<=1){return 1;} bool v1=0,v2=0; if(a>=2)v1=dfs(a%2,b+a/2,1); if(b>=2)v2=dfs(a+b/2,b%2,1); if(v1||v2)return 1; else return 0; } } int main(){ cin>>a>>b; bool ok=dfs(a,b,1);//1なら先手0なら後手 if(ok)cout<<"Alice"<<endl; else cout<<"Brown"<<endl; return 0; }
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:20:1: note: in expansion of macro 'll' 20 | ll a,b; | ^~ a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:22:10: note: in expansion of macro 'll' 22 | bool dfs(ll a,ll b,bool f){ | ^~ a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:22:15: note: in expansion of macro 'll' 22 | bool dfs(ll a,ll b,bool f){ | ^~ a.cc:22:20: error: expected primary-expression before 'bool' 22 | bool dfs(ll a,ll b,bool f){ | ^~~~ a.cc:22:26: error: expression list treated as compound expression in initializer [-fpermissive] 22 | bool dfs(ll a,ll b,bool f){ | ^ a.cc: In function 'int main()': a.cc:44:14: error: 'a' was not declared in this scope 44 | cin>>a>>b; | ^ a.cc:44:17: error: 'b' was not declared in this scope; did you mean 'pb'? 44 | cin>>a>>b; | ^ | pb a.cc:45:20: error: 'dfs' cannot be used as a function 45 | bool ok=dfs(a,b,1);//1なら先手0なら後手 | ~~~^~~~~~~
s126924427
p03740
C++
#include<bits/stdc++.h> using namespace std; long long ll; int main (){ ll x,y; cin >> x >> y; if(abs(x-y)<=1){ cout<<"Brown"<<endl; }else{ cout<<"Alice"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: expected ';' before 'x' 5 | ll x,y; | ^~ | ; a.cc:6:10: error: 'x' was not declared in this scope 6 | cin >> x >> y; | ^ a.cc:6:15: error: 'y' was not declared in this scope; did you mean 'yn'? 6 | cin >> x >> y; | ^ | yn
s242748092
p03740
C++
#include <bits/stdc++.h> using namespace std; #define MP make_pair #define PB push_back typedef long long LL; typedef pair<int,int> PII; const double eps=1e-8; const double pi=acos(-1.0); const int K=1e6+7; const int mod=1e9+7; bool solve (int x, int y) { for (int i = 2; i <= x; i += 2) { if (!solve(x - i, y + i / 2)) return true; } for (int i = 2; i <= y; i += 2) { if (!solve(x + i / 2, y - i)) return true; } return false; } int main(void) { std::ios::sync_with_stdio(false); std::cin.tie(0); cin>>a>>b; cout<<solve(a,b); return 0; }
a.cc: In function 'int main()': a.cc:28:10: error: 'a' was not declared in this scope 28 | cin>>a>>b; | ^ a.cc:28:13: error: 'b' was not declared in this scope 28 | cin>>a>>b; | ^
s697547336
p03740
C++
#include <bits/stdc++.h> #define p(s) cout<<(s)<<endl using namespace std; int main(){ ll x,y; cin>>x>>y; p(abs(x-y)<=1?"Brown":"Alice"); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'll' was not declared in this scope 6 | ll x,y; | ^~ a.cc:7:14: error: 'x' was not declared in this scope 7 | cin>>x>>y; | ^ a.cc:7:17: error: 'y' was not declared in this scope; did you mean 'yn'? 7 | cin>>x>>y; | ^ | yn
s687887310
p03740
C
main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")};
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; | ^~~~ main.c: In function 'main': main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; | ^~~~~ main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:41: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; | ^~~~ main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:46: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; | ^~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'abs' +++ |+#include <stdlib.h> 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; main.c:1:51: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; | ~^~ <built-in>: note: built-in 'abs' declared here main.c:1:73: error: expected ';' before '}' token 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice")}; | ^ | ;
s457560454
p03740
C
main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice");
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); | ^~~~ main.c: In function 'main': main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); | ^~~~~ main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:41: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); | ^~~~ main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:46: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); | ^~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'abs' +++ |+#include <stdlib.h> 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); main.c:1:51: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch] 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); | ~^~ <built-in>: note: built-in 'abs' declared here main.c:1:1: error: expected declaration or statement at end of input 1 | main(){long a,b;scanf("%lld%lld",&a,&b);puts(abs(a-b)<2?"Brown":"Alice"); | ^~~~
s782334870
p03740
C++
main(){long long a,b;cin>>a>>b;puts(a-b-1&&a-b+1&&a-b?"Alice":"Brown");}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){long long a,b;cin>>a>>b;puts(a-b-1&&a-b+1&&a-b?"Alice":"Brown");} | ^~~~ a.cc: In function 'int main()': a.cc:1:22: error: 'cin' was not declared in this scope 1 | main(){long long a,b;cin>>a>>b;puts(a-b-1&&a-b+1&&a-b?"Alice":"Brown");} | ^~~ a.cc:1:32: error: 'puts' was not declared in this scope 1 | main(){long long a,b;cin>>a>>b;puts(a-b-1&&a-b+1&&a-b?"Alice":"Brown");} | ^~~~
s964825123
p03740
C++
#include <cmath> #include <iostream> using namespace std; int main() { int X, Y; cin >> X >> Y; cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: no match for 'operator<=' (operand types are 'std::basic_ostream<char>' and 'int') 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ~~~~~~~~~~~~~~~~~~ ^~ ~ | | | | | int | std::basic_ostream<char> a.cc:8:22: note: candidate: 'operator<=(int, int)' (built-in) 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ~~~~~~~~~~~~~~~~~~~^~~~ a.cc:8:22: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int' In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from a.cc:1: /usr/include/c++/14/bits/stl_pair.h:1064:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1064 | operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1064:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:469:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 469 | operator<=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:469:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:513:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 513 | operator<=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:513:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1704:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1704 | operator<=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1704:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1767:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1767 | operator<=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1767:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, 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/include/c++/14/iostream:41, from a.cc:2: /usr/include/c++/14/string_view:717:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 717 | operator<=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:717:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/string_view:724:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 724 | operator<=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:724:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/string_view:732:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 732 | operator<=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:732:5: note: template argument deduction/substitution failed: a.cc:8:25: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3956:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3956 | operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3956:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3970:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3970 | operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3970:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ /usr/include/c++/14/bits/basic_string.h:3983:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3983 | operator<=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3983:5: note: template argument deduction/substitution failed: a.cc:8:25: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2625:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2625 | operator<=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2625:5: note: template argument deduction/substitution failed: a.cc:8:25: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ^ a.cc:8:47: error: invalid operands of types 'const char [6]' and '<unresolved overloaded function type>' to binary 'operator<<' 8 | cout << abs(X - Y) <= 1 ? "Brown" : "Alice" << endl; | ~~~~~~~~^~~~~~~
s264547297
p03740
C++
#include<csdtio> #include<cstring> #include<cmath> #include<cstdlib> #include<algorithm> using namespace std; typedef long long LL; LL a, b; int main(){ scanf("%lld %lld", &a, &b); if(abs(a - b) <= 1) printf("Brown\n"); else printf("Alice\n"); return 0; }
a.cc:1:9: fatal error: csdtio: No such file or directory 1 | #include<csdtio> | ^~~~~~~~ compilation terminated.
s708148476
p03740
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std; const int MaxN = 1e5; typedef long long LL; LL n, m; LL gcd(LL x, LL y) { if(y == 0) return x; else return gcd(y, x % y); } int main() { while(scanf("%lld %lld", &n, &m) != EOF) { if(n > 0 && m > 0) { LL x = gcd(x, y); n = n / x; m = m / x; } LL cnt = 0; while(n > 1) { n = n / 2; if(n & 1) cnt++; cnt++; } while(m > 1) { m = m / 2; if(m & 1) cnt++; cnt++; } if(cnt & 1) printf("Alice\n"); else printf("Brown\n"); } return 0; }
a.cc: In function 'int main()': a.cc:22:39: error: 'y' was not declared in this scope 22 | LL x = gcd(x, y); | ^
s590211326
p03740
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cstdlib> #include<cstring> #include<string> #include<climits> #include<vector> #include<cmath> #include<map> #include<queue> #define LL long long #define pii pair<int,int> #define mp make_pair using namespace std; inline char nc(){ /* static char buf[100000],*p1=buf,*p2=buf; if (p1==p2) { p2=(p1=buf)+fread(buf,1,100000,stdin); if (p1==p2) return EOF; } return *p1++; */return getchar(); } inline void read(int &x){ char c=nc();int b=1; for (;!(c>='0' && c<='9');c=nc()) if (c=='-') b=-1; for (x=0;c>='0' && c<='9';x=x*10+c-'0',c=nc()); x*=b; } inline void read(LL &x){ char c=nc();LL b=1; for (;!(c>='0' && c<='9');c=nc()) if (c=='-') b=-1; for (x=0;c>='0' && c<='9';x=x*10+c-'0',c=nc()); x*=b; } inline int read(char *s) { char c=nc();int len=0; for(;!(c>='0' && c<='9');c=nc()) if (c==EOF) return 0; for(;(c>='0' && c<='9');s[len++]=c,c=nc()); s[len++]='\0'; return len; } inline void read(char &x){ for (x=nc();!(x>='A' || x<='B');x=nc()); } int wt,ss[19]; inline void print(int x){ if (x<0) x=-x,putchar('-'); if (!x) putchar(48); else { for (wt=0;x;ss[++wt]=x%10,x/=10); for (;wt;putchar(ss[wt]+48),wt--);} } inline void print(LL x){ if (x<0) x=-x,putchar('-'); if (!x) putchar(48); else {for (wt=0;x;ss[++wt]=x%10,x/=10);for (;wt;putchar(ss[wt]+48),wt--);} } LL x,y; int main() { read(x);read(y); if (x<y) swap(x,y); if (x==y) puts("Brown"); else if (x<=2) puts("Brown"); else put("Alice"); return 0; }
a.cc: In function 'int main()': a.cc:71:14: error: 'put' was not declared in this scope; did you mean 'putw'? 71 | else put("Alice"); | ^~~ | putw
s551837549
p03740
C++
#include <iostream> #include <string> #include <cctype> using namespace std; typedef unsigned long long ull; int main() { unsigned long long n1, n2; cin >> n1 >> n2; if((ull(1) * n1 + n2) > ull(2) && ((ull(1) * n1 + n2) % ull(5) == 0 || (ull(1) * n1 + n2) % ull(3) == 0) || (ull(1) * n1 + n2) % ull(7) == 0)) cout << "Alice" << endl; else cout << "Brown" << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:144: error: expected primary-expression before ')' token 13 | if((ull(1) * n1 + n2) > ull(2) && ((ull(1) * n1 + n2) % ull(5) == 0 || (ull(1) * n1 + n2) % ull(3) == 0) || (ull(1) * n1 + n2) % ull(7) == 0)) cout << "Alice" << endl; | ^
s504052156
p03740
C++
#include <bits/stdc++.h> #define scan(x) scanf("%d",&x) #define scan2(x,y) scanf("%d%d",&x,&y) #define scan3(x,y,z) scanf("%d%d%d",&x,&y,&z) #define FASTER std::ios::sync_with_stdio(false) #define DEBUG(x) cout<<#x<<" = "<<x<<endl #define pb push_back #define mk make_pair #define vp vector<pair<ll,ll> > #define se second #define fi first #define vi vector<ll> #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define ll long long #define rep(i,n) for(ll i=0;i<n;i++) #define fab(i,a,b) for(ll i=a;i<=b;i++) #define inp(n,a) for(ll i=0;i<n;i++){cin>>a[i];} #define strToInt(x,z) istringstream y(x);y>>z //(string,integer) #define gcd(a,b) __gcd(a,b) #define lcm(a,b) a*b / __gcd(a,b); #define MOD 1000000007 #define pi 3.14159265 using namespace std; long double a[100010], b[100010],n,p; int main() { //FASTER; ll x, y; cin >> x >> y; if(x == y) { cout << "Brown" <<endl; return 0; } if(x%2 == 0 and y %2 == 0) { cout << "Alice" <endl; return 0; } if((x%2 ==1 and y%2 ==0) or (x%2 ==0 and y%2 ==1)) { cout << "Brown" <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:42:33: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 42 | cout << "Alice" <endl; | ~~~~~~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:42:34: note: couldn't deduce template parameter '_Bi_iter' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:42:34: note: couldn't deduce template parameter '_Bi_iter' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 42 | cout << "Alice" <endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 42 | cout << "Alice" <endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 42 | cout << "Alice" <endl; | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:42:34: note: couldn't deduce template parameter '_CharT' 42 | cout << "Alice" <endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:42:34: note: 'std::basic_ostream<char>' is not derived from 'const
s425136469
p03741
C++
#include<cstring> #include<cstdio> #include<cstring> #include<vector> #include<queue> #include<algorithm> #include<climits> #include<bitset> using namespace std; const int N = 100000 + 5; int n, a[N]; int main() { scanf ("%d", &n); for (int i = 1; i <= n; ++i) scanf ("%d", &a[i]); long long sum = 0, need1 = 0, need2 = 0; for (int i = 1; i <= n; ++i) { sum += a[i]; if (i & 1) { if (sum >= 0) need1 += sum + 1, sum = -1; } else { if (sum <= 0) need1 += 1 - sum, sum = 1; } } sum = 0; for (int i = 1; i <= n; ++i) { sum += a[i]; if (i & 1) { if (sum <= 0) need2 += 1 - sum, sum = 1; } else { if (sum >= 0) need2 += sum + 1, sum = -1; } } cout << need1 << '\n'; return 0; } #include<iostream> #include<cstring> #include<cstdio> #include<cstring> #include<vector> #include<queue> #include<algorithm> #include<climits> #include<bitset> using namespace std; const int N = 100000 + 5; int n, a[N]; int main() { scanf ("%d", &n); for (int i = 1; i <= n; ++i) scanf ("%d", &a[i]); long long sum = 0, need1 = 0, need2 = 0; for (int i = 1; i <= n; ++i) { sum += a[i]; if (i & 1) { if (sum >= 0) need1 += sum + 1, sum = -1; } else { if (sum <= 0) need1 += 1 - sum, sum = 1; } } sum = 0; for (int i = 1; i <= n; ++i) { sum += a[i]; if (i & 1) { if (sum <= 0) need2 += 1 - sum, sum = 1; } else { if (sum >= 0) need2 += sum + 1, sum = -1; } } cout << need2 << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:34:5: error: 'cout' was not declared in this scope 34 | cout << need1 << '\n'; | ^~~~ a.cc:9:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 8 | #include<bitset> +++ |+#include <iostream> 9 | using namespace std; a.cc: At global scope: a.cc:48:11: error: redefinition of 'const int N' 48 | const int N = 100000 + 5; | ^ a.cc:11:11: note: 'const int N' previously defined here 11 | const int N = 100000 + 5; | ^ a.cc:49:5: error: redefinition of 'int n' 49 | int n, a[N]; | ^ a.cc:12:5: note: 'int n' previously declared here 12 | int n, a[N]; | ^ a.cc:49:8: error: redefinition of 'int a [100005]' 49 | int n, a[N]; | ^ a.cc:12:8: note: 'int a [100005]' previously declared here 12 | int n, a[N]; | ^ a.cc:50:5: error: redefinition of 'int main()' 50 | int main() { | ^~~~ a.cc:13:5: note: 'int main()' previously defined here 13 | int main() { | ^~~~
s819109910
p03741
C++
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define FOR(i,L,R) for(i=L;i<R;i++) #define REP(i,N) FOR(i,0,N) int main(){ ll N,i,ans,sum;cin>>N;ll A[N];REP(i,N)cin>>A[i]; sum=max(A[0],1);ans=sum-A[0]; FOR(i,(ll)1,N){ if((sum<0&&sum+A[i]>0)||(sum>0&&sum+A[i]<0))sum+=A[i]; else{ans+=abs(A[i]+sum)+1;if(sum>0)sum=-1;else sum=1;} } p=ans;sum=min(A[0],-1);ans=sum-A[0]; FOR(i,(ll)1,N){ if((sum<0&&sum+A[i]>0)||(sum>0&&sum+A[i]<0))sum+=A[i]; else{ans+=abs(A[i]+sum)+1;if(sum>0)sum=-1;else sum=1;} } cout<<min(ans,p)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: no matching function for call to 'max(ll&, int)' 8 | sum=max(A[0],1);ans=sum-A[0]; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:8:10: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 8 | sum=max(A[0],1);ans=sum-A[0]; | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 8 | sum=max(A[0],1);ans=sum-A[0]; | ~~~^~~~~~~~ a.cc:13:3: error: 'p' was not declared in this scope 13 | p=ans;sum=min(A[0],-1);ans=sum-A[0]; | ^ a.cc:13:16: error: no matching function for call to 'min(ll&, int)' 13 | p=ans;sum=min(A[0],-1);ans=sum-A[0]; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:13:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 13 | p=ans;sum=min(A[0],-1);ans=sum-A[0]; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:13:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 13 | p=ans;sum=min(A[0],-1);ans=sum-A[0]; | ~~~^~~~~~~~~
s967438423
p03741
C++
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define FOR(i,L,R) for(i=L;i<R;i++) #define REP(i,N) FOR(i,0,N) int main(){ ll N,i,ans,sum;cin>>N;ll A[N];REP(i,N)cin>>A[i]; sum=max(A[0],1);ans=sum-A[0]; FOR(i,(ll)1,N){ if((sum<0&&sum+A[i]>0)||(sum>0&&sum+A[i]<0))sum+=A[i]; else{ans+=abs(A[i]+sum)+1;if(sum>0)sum=-1;else sum=1;} } sum=min(A[0],-1);ans=sum-A[0]; FOR(i,(ll)1,N){ if((sum<0&&sum+A[i]>0)||(sum>0&&sum+A[i]<0))sum+=A[i]; else{ans+=abs(A[i]+sum)+1;if(sum>0)sum=-1;else sum=1;} } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: no matching function for call to 'max(ll&, int)' 8 | sum=max(A[0],1);ans=sum-A[0]; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:8:10: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 8 | sum=max(A[0],1);ans=sum-A[0]; | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 8 | sum=max(A[0],1);ans=sum-A[0]; | ~~~^~~~~~~~ a.cc:13:10: error: no matching function for call to 'min(ll&, int)' 13 | sum=min(A[0],-1);ans=sum-A[0]; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:13:10: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 13 | sum=min(A[0],-1);ans=sum-A[0]; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:13:10: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 13 | sum=min(A[0],-1);ans=sum-A[0]; | ~~~^~~~~~~~~
s991088619
p03741
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; using ii=pair<ll,ll>; using vi=vector<ll>; #define pb push_back #define mp make_pair #define fi first #define se second #define INF (ll)1e18 #define all(x) (x).begin(),(x).end() #define print(a); for(auto x:a)cout<<x<<" "; cout<<"\n"; #define mset(a); memset(a,0,sizeof(a)); int main(){ ios_base::sync_with_stdio(0);cin.tie(0); ll n;cin>>n; ll a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } ll p[n];mset(p); p[0]=a[0];ll ans=0; if(a[0]==0){ p[0]++; ans++; } for(int i=1;i<n;i++){ p[i]=p[i-1]+a[i]; if(p[i-1]>0&&p[i]>0){ ans+=p[i]+1; p[i]=-1; } if(p[i-1]<0&&p[i]<0){ ans-=(p[i]-1); p[i]=1; } if(p[i]==0){ if(p[i-1]>0)p[i]--; else p[i]++; ans++; } } mset(p); ll ans2; if(a[0]==0)p[0]--,ans2++; else if(a[0]>0)ans2+=a[i]+1,p[0]=-1; else ans2-=(a[i]-1),p[0]=1; for(int i=1;i<n;i++){ p[i]=p[i-1]+a[i]; if(p[i-1]>0&&p[i]>0){ ans2+=p[i]+1; p[i]=-1; } if(p[i-1]<0&&p[i]<0){ ans2-=(p[i]-1); p[i]=1; } if(p[i]==0){ if(p[i-1]>0)p[i]--; else p[i]++; ans2++; } } cout<<min(ans,ans2)<<"\n"; }
a.cc: In function 'int main()': a.cc:49:28: error: 'i' was not declared in this scope 49 | else if(a[0]>0)ans2+=a[i]+1,p[0]=-1; | ^ a.cc:50:19: error: 'i' was not declared in this scope 50 | else ans2-=(a[i]-1),p[0]=1; | ^
s692654877
p03741
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.at(i); } int C1=0,C2=0; int sum=0; for(int i=0;i<N;i++){ sum+=A.at(i); if(i%2==0 && sum<=0){ C1+=abs(sum)+1; sum=1; } else if(i%2==1 && sum>=0){ C1+=abs(sum)+1; sum=-1; } } int sum=0; for(int i=0;i<N;i++){ sum+=A.at(i); if(i%2==0 && sum>=0){ C2+=abs(sum)+1; sum=-1; } else if(i%2==1 && sum<=0){ C2+=abs(sum)+1; sum=1; } } cout << min(C1,C2) << endl; }
a.cc: In function 'int main()': a.cc:25:7: error: redeclaration of 'int sum' 25 | int sum=0; | ^~~ a.cc:12:7: note: 'int sum' previously declared here 12 | int sum=0; | ^~~
s493868259
p03741
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <queue> #include <utility> #include <map> #define ll long long using namespace std; using p = pair<ll, ll>; ll dx[4] = {-1, 0, 1, 0}; ll dy[4] = {0, 1, 0, -1}; int main(){ ll n; cin >> n; vector<ll> a; ll sum[n], sum2[n]; for(ll i = 0; i < n; i++){ ll b; cin >> b; a.push_back(b); if(i==0) sum[i] = b; else sum[i] = sum[i-1]+b; } for(ll i = 0; i < n; i++) sum2[i] = sum[i]; ll ans = 0, total = 0, count = 0; if(sum[0]>=0) total = -sum[0]-1; ans = abs(total); sum[0]+=total; for(ll i = 1; i < n; i++){ ll now = sum[i]+total; if(now*sum[i-1]>0){ count = abs(now)+1; ans+=count; if(now<0) total+=count; else if(now>0) total-=count; } else if(now*sum[i-1]==0){ ans++; if(sum[i-1]<0) total++; else if(sum[i-1]>0) total--; } sum[i]+=total; } ll check = ans; total = 0; ans = 0; if(sum2[0]=<0) total = abs(sum2[0])+1; sum2[0]+=total; for(ll i = 1; i < n; i++){ ll now = sum2[i]+total; if(now*sum2[i-1]>0){ count = abs(now)+1; ans+=count; if(now<0) total+=count; else if(now>0) total-=count; } else if(now*sum2[i-1]==0){ ans++; if(sum2[i-1]<0) total++; else if(sum2[i-1]>0) total--; } sum2[i]+=total; } check = min(check, ans); cout << check << endl; return 0; }
a.cc: In function 'int main()': a.cc:49:16: error: expected primary-expression before '<' token 49 | if(sum2[0]=<0) total = abs(sum2[0])+1; | ^
s504010582
p03741
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll,ll> pi; typedef vector<pi> vpi; typedef double dl; #define mp make_pair #define pb emplace_back #define f first #define s second #define lb lower_bound #define ub upper_bound #define dst distance #define INF 1000000000 #define ALL(x) x.begin(), x.end() #define SZ(x) (int)x.size() #define MAXN 500110 ll MOD = 1e9+7; ll A[MAXN]; ll N,D,Q,a; ll L[MAXN]; ll C[MAXN]; ll out[MAXN]; ll main(){ cin>>N>>D; for (ll i=1;i<=N;++i)cin>>A[i]; L[0] = D; for (ll i=1;i<=N;++i){ L[i] = min(L[i-1], abs(L[i-1] - A[i])); } // if (L[N]!=0){ // cin>>Q; // while(Q--)cout<<"YES\n"; // return 0; // } C[N+1] = 0; for (ll i=N;i>=1;--i){ if (A[i] <= C[i+1]+1){ C[i] = C[i+1] + A[i]; }else C[i] = C[i+1]; } for (ll i=1;i<=N;++i){ // cout<<L[i-1]<<' '<<C[i+1]<<'\n'; if (L[i-1] > C[i+1])out[i]=1; else out[i]=0; } cin>>Q; while(Q--){ cin>>a; if (out[a])cout<<"YES\n"; else cout<<"NO\n"; } }
a.cc:27:1: error: '::main' must return 'int' 27 | ll main(){ | ^~
s427081682
p03741
C++
#include <iostream> #include <vector> #include <bits/stdc++.h> using namespace std; long long int a,b[100010],c[100010],ans =0; int main(){ cin >> a; for(int i=0;i<a;i++) cin >> b[i]; c[0] = b[0]; for(int i=0;i<a-1;i++){ c[i+1] += b[i+1]; if( c[i] <0 && c[i+1] <=0){ ans += 1-c[i]; c[i+1] = abs(b[i+1]-1); } else if(c[i] >0 && c[i+1] =>0){ ans+= c[i]+1; c[i+1] = -1; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:26:32: error: expected primary-expression before '>' token 26 | else if(c[i] >0 && c[i+1] =>0){ | ^
s504355073
p03741
C++
#include <iostream> #include <vector> #include <bits/stdc++.h> using namespace std; long long int a,b[100010],c[100010],ans =0; int main(){ cin >> a; for(int i=0;i<a;i++) cin >> b[i]; c[0] = b[0] for(int i=0;i<a-1;i++){ c[i+1] += b[i+1]; if( c[i] <0 && c[i+1] <=0){ ans += 1-c[i]; c[i+1] = abs(b[i+1]-1); } else if(c[i] >0 && c[i+1] =>0){ ans+= c[i]+1; c[i+1] = -1; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:16:15: error: expected ';' before 'for' 16 | c[0] = b[0] | ^ | ; 17 | for(int i=0;i<a-1;i++){ | ~~~ a.cc:17:15: error: 'i' was not declared in this scope 17 | for(int i=0;i<a-1;i++){ | ^
s106110612
p03741
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <iomanip> #include <string> #include <sstream> //#include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; /*struct shi { int x; int T; } s[100000]; int cmp(shi a,shi b) { return a.x<b.x; } long long cmd(long long a, long long b) { return a > b; }*/ /*typedef struct node { string name; int score; //struct node *next; }student[1000000]; /*student * creatlist(int b){ student *head = new student; student *pre = head; for(int i=1;i<=b;i++){ student *p = new student ; p->num = i; pre->next = p; pre = p; p->next = NULL; } pre->next = head->next;//quan return head; };*/ /*void kill(struct node *head){ student *p ; p = head->next; do{ for(int i=1;i<=4;i++){ head = head->next; //sum++; } //return; p=head->next; head->next = head->next->next; // p=head; sum++; //cout<<p->num; }while(p->num!=1); //cout<<p->num<<endl; cout<<sum<<endl; }*/ int main() { int t; cin>>t; vector<int> num; for(int i=0; i<t; i++) { int wo; cin >>wo; num.push_back(wo); } int sum=0,time=0,time2=0; for(int i=0; i<t; i++) { sum+=num[i]; if(i==0) { if(sum<=0) { time+=abs(num[i])+1; sum=1; } } else if(i%2==0&&i!=0) { if(sum<0) { if(sum==2*num[i]) { time+=abs(sum)+1; sum=1; } else { time+=abs(sum-1); sum=1; } } else if(sum==0) { sum=1; time+=1; } } else if(i%2==1) { if(sum>0) { if(sum==2*num[i]) { time+=abs(sum)+1; sum=-1; } else if(sum==1&&num[i]==0) { time+=2; sum=-1; } else { time+=abs(sum-1); sum=-1; } } else if(sum==0) { sum=-1; time+=1; } } //cout<<time<<endl; } //cout<<time<<endl; sum=0; for(int i=0; i<t; i++) { sum+=num[i]; if(i==0) { if(sum=>0) { time2+=abs(num[i])+1; sum=-1; } } else if(i%2!=0&&i!=0) { if(sum<0) { if(sum==2*num[i]) { time2+=abs(sum)+1; sum=1; } else { time2+=abs(sum-1); sum=1; } } else if(sum==0) { sum=1; time2+=1; } } else if(i%2==1) { //cout<<sum<<"jk"<<endl; if(sum>0) { if(sum==2*num[i]) { time2+=abs(sum)+1; sum=-1; //cout<<sum<<"ehiu"<<endl; } else if(sum==1&&num[i]==0) { time2+=2; sum=-1; } else { time2+=abs(sum-1); sum=-1; } } else if(sum==0) { sum=-1; time2+=1; } } //cout<<time2<<endl; } //cout<<time<<" "<<time2<<endl; int mi = min(time,time2); cout<<mi<<endl; return 0; }
a.cc: In function 'int main()': a.cc:145:16: error: expected primary-expression before '>' token 145 | if(sum=>0) | ^
s038228447
p03741
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <iomanip> #include <string> #include <sstream> //#include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; /*struct shi { int x; int T; } s[100000]; int cmp(shi a,shi b) { return a.x<b.x; } long long cmd(long long a, long long b) { return a > b; }*/ /*typedef struct node { string name; int score; //struct node *next; }student[1000000]; /*student * creatlist(int b){ student *head = new student; student *pre = head; for(int i=1;i<=b;i++){ student *p = new student ; p->num = i; pre->next = p; pre = p; p->next = NULL; } pre->next = head->next;//quan return head; };*/ /*void kill(struct node *head){ student *p ; p = head->next; do{ for(int i=1;i<=4;i++){ head = head->next; //sum++; } //return; p=head->next; head->next = head->next->next; // p=head; sum++; //cout<<p->num; }while(p->num!=1); //cout<<p->num<<endl; cout<<sum<<endl; }*/ int main() { int t; cin>>t; vector<int> num; for(int i=0; i<t; i++) { int wo; cin >>wo; num.push_back(wo); } int sum=0,time=0,time2=0; for(int i=0; i<t; i++) { sum+=num[i]; if(i==0) { if(sum<0) { time+=abs(num[i])+1; sum=1; } } else if(i%2==0&&i!=0) { if(sum<0) { time+=1-sum; sum=1; } else if(sum==0) { sum=1; time+=1; } } else { if(sum>0) { time2+=abs(-1-sum); sum=-1 } else if(sum==0) { sum=-1; time+=1; } } //cout<<time<<endl; } //cout<<time<<endl; sum=0; for(int i=0; i<t; i++) { sum+=num[i]; if(i==0) { if(sum>=0) { time2+=abs(num[i])+1; sum=-1; } } else if(i%2!=0&&i!=0) { if(sum<0) { if(sum==2*num[i]) { time2+=abs(sum)+1; sum=1; } else { time2+=abs(sum-1); sum=1; } } else if(sum==0) { sum=1; time2+=1; } } else { //cout<<sum<<"jk"<<endl; if(sum>0) { if(sum==2*num[i]) { time2+=abs(sum)+1; sum=-1; //cout<<sum<<"ehiu"<<endl; } else if(sum==1&&num[i]==0) { time2+=2; sum=-1; } else { time2+=abs(sum-1); sum=-1; } } else if(sum==0) { sum=-1; time2+=1; } } //cout<<time2<<endl; } //cout<<time<<" "<<time2<<endl; int mi = min(time,time2); cout<<mi<<endl; return 0; }
a.cc: In function 'int main()': a.cc:107:19: error: expected ';' before '}' token 107 | sum=-1 | ^ | ; 108 | 109 | } | ~
s537838396
p03741
C++
#include <bits/stdc++.h> using namespace std; int main () { long long x, y; cin >> x >> y; if (abs (x - y) < 2) cout << "Brown" << endl: else cout << "Alice" << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:28: error: expected ';' before ':' token 9 | cout << "Brown" << endl: | ^ | ;
s594031409
p03741
C++
#include <bits/stdc++.h> typedef long long ll; ll x, y; int main() { scanf("%lld%lld", &x, &y); printf("%s\n", max(0, x - 1) > y? "Alice" : "Brown"); return 0; }
a.cc: In function 'int main()': a.cc:10:24: error: 'max' was not declared in this scope; did you mean 'std::max'? 10 | printf("%s\n", max(0, x - 1) > y? "Alice" : "Brown"); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~
s938732105
p03741
C++
#include <iostream> using namespace std; int main(){ int n; int *a; int l; int ct=0; int p=0; cin>>n; a=new long long int [n+1]; while(cin>>l){ a[p] = l; p++; } a[n]=0; if(a[0]>0){ for(int i=0;i<n;i++){ if(a[i]<=0&&i%2==0){ ct=ct+0-a[i]+1; a[i]=1; a[i+1]=a[i+1]+1; }else if(a[i]>0&&i%2==0){ a[i+1]=a[i+1]+a[i]; }else if(a[i]>=0&&i%2==1){ ct=ct+a[i]+1; a[i]=-1; a[i+1]=a[i+1]+a[i]; }else if(a[i]<0&&i%2==1){ a[i+1]=a[i+1]+a[i]; } } } if(a[0]<0){ for(int i=0;i<n;i++){ if(a[i]>=0&&i%2==0){ ct=ct+a[i]+1; a[i]=-1; a[i+1]=a[i+1]+a[i]; }else if(a[i]<0&&i%2==0){ a[i+1]=a[i+1]+a[i]; }else if(a[i]<=0&&i%2==1){ ct=ct+0-a[i]+1; a[i]=1; a[i+1]=a[i+1]+1; }else if(a[i]>0&&i%2==1){ a[i+1]=a[i+1]+a[i]; } } } cout<<ct<<endl; }
a.cc: In function 'int main()': a.cc:10:11: error: cannot convert 'long long int*' to 'int*' in assignment 10 | a=new long long int [n+1]; | ^~~~~~~~~~~~~~~~~~~~~~~ | | | long long int*
s200985575
p03741
C++
#define debug_interval ',' #define dump_interval ' ' #define debug_toggle 1 //{ #pragma GCC optimize ("O3","unroll-loops") #pragma GCC target ("avx") #include<bits/stdc++.h> using namespace std; #define hi cerr<<"hi"<<endl; #define int long long #define INT_MAX LLONG_MAX #define rep(i,n) for(int i=0;i<(n);i++) #define rep1(i,n) for(int i=1;i<=(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define fi first #define se second #define mp make_pair #define rev reverse #define dans dump(ans) #define MOD 1000000007 #define amp(v,n) (v).count(n)?v[n]++:v[n]=1 #define sysp system("pause") #define PI acos(-1) #define ins insert //{ 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;return sout.str();} template<class...A> inline void dump(){cout<<endl;} template<class...A> inline void dump_rest() {cout<<endl;} template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);} template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);} template<class...A> inline void debug(){cerr<<endl;} template<class...A> inline void debug_rest() {cerr<<endl;} template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cerr<<debug_interval<<first;debug_rest(rest...);} template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cerr<<first,debug_rest(rest...);} //} typedef vector<int>vint; typedef pair<int,int>pint; typedef vector<pint>vpint; template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;} template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;} template<int m>class mint{private:int i;public:mint() : i(0){}mint(int i): i((i%m+m)%m){}mint operator+(const mint& o){return o.i+i;}mint operator*(const mint& o){return o.i*i;}mint operator-(){return -i;}operator int() {return i;}}; //} int n; main(){ cin>>n; int a[n];rep(i,n)cin>>a[i]; int rui[0]=a[0]; for(int i=1;i<n;i++){ rui[i]=rui[i-1]+a[i]; } int now=0; rep(i,n){ } }
a.cc:12:9: warning: "INT_MAX" redefined 12 | #define INT_MAX LLONG_MAX | ^~~~~~~ In file included from /usr/include/c++/14/climits:42, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38, from a.cc:8: /usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:120:9: note: this is the location of the previous definition 120 | #define INT_MAX __INT_MAX__ | ^~~~~~~ a.cc:54:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 54 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:57:19: error: array must be initialized with a brace-enclosed initializer 57 | int rui[0]=a[0]; | ~~~^
s624477757
p03741
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <map> #include <stdio.h> using namespace std; using ll = int long long; map <int ,int> mpa,mpb; int main(){ int n; cin >> n; ll a[n]; ll sum=0,sum1=0; cin >> sum; sum=sum1; ll ans=0; for(int i=1;i<n:i++){ cin >> a[i]; sum+=a[i]; if(sum*sum1<0){ sum1=sum; continue; } else{ ans+= } } }
a.cc: In function 'int main()': a.cc:23:15: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] 23 | for(int i=1;i<n:i++){ | ^ a.cc:23:18: error: found ':' in nested-name-specifier, expected '::' 23 | for(int i=1;i<n:i++){ | ^ | :: a.cc:23:17: error: 'n' is not a class, namespace, or enumeration 23 | for(int i=1;i<n:i++){ | ^ a.cc:34:1: error: expected primary-expression before '}' token 34 | } | ^ a.cc:33:4: error: expected ';' before '}' token 33 | } | ^ | ; 34 | } | ~ a.cc:34:1: error: expected primary-expression before '}' token 34 | } | ^ a.cc:33:4: error: expected ')' before '}' token 33 | } | ^ | ) 34 | } | ~ a.cc:23:6: note: to match this '(' 23 | for(int i=1;i<n:i++){ | ^ a.cc:34:1: error: expected primary-expression before '}' token 34 | } | ^
s459397163
p03741
C++
#include<bits/stdc++.h> using namespace std; #define INF 1000000007 #define LINF 1000000000000000007 typedef long long Int; typedef pair<Int,Int> P; Int gcd(Int x, Int y){ if(y == 0) return x; return gcd(y, x%y); } Int lcm(Int x, Int y){ return x * y / gcd(x,y); } bool sosuu(Int x){ bool b = 1; if(x == 1) b = 1; for(int i = 2; i * i <= x; i++){ if(x % i == 0){b = 0; break;} } return b; } Int n, a[100000], b[100000]; int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; b[i] = a[i]; } Int ans[2] = {0}; for(int i = 0; i < n; i++){ if(i % 2 == 0 && b[i] <= 0){ ans[0] -= b[i]-1; b[i+1] += 1; } else if(i % 2 == 1 && b[i] >= 0){ ans[0] += b[i]+1; b[i+1] -= 1; } else b[i+1] += b[i]; } for(int i = 0; i < n; i++){ if(i % 2 == 1 && a[i] <= 0){ ans[1] -= a[i]-1; a[i+1] += 1; } else if(i % 2 == 0 && a[i] >= 0){ ans[1] += a[i]+1; a[i+1] -= 1; } else a[i+1] += a[i]; } cout << min(ans[0],ans[1]) return 0; }
a.cc: In function 'int main()': a.cc:62:35: error: expected ';' before 'return' 62 | cout << min(ans[0],ans[1]) | ^ | ; 63 | 64 | return 0; | ~~~~~~
s484458345
p03741
C++
#include<iostream> using namespace std;   int sign(int x){ if (x>0) return 1; return -1; }   int main(){ int n; cin >> n; int sum = 0; int res = 0; for(int i=0;i <n;i++){ int x; cin >> x;   if (sign(sum) != sign(sum+x) || i == 0){ sum += x; }else{ sum += x; res += sum; sum = (sum-x > 0 ? -1 : 1); } } cout << res; return 0; }
a.cc:3:1: error: extended character   is not valid in an identifier 3 |   | ^ a.cc:9:1: error: extended character   is not valid in an identifier 9 |   | ^ a.cc:18:1: error: extended character   is not valid in an identifier 18 |   | ^ a.cc:3:1: error: '\U000000a0' does not name a type 3 |   | ^ a.cc:9:1: error: '\U000000a0' does not name a type 9 |   | ^
s007569067
p03741
C++
#include<iostream> using namespace std;   int sign(int x){ if (x>0) return 1; return -1; }   int main(){ int n; cin >> n;   int sum = 0; int res = 0; for(int i=0;i <n;i++){ int x; cin >> x;   if (sign(sum) != sign(sum+x) || i == 0){ sum += x; }else{ sum += x; res += sum; sum = (sum-x > 0 ? -1 : 1); } } cout << res; return 0; }
a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:10:1: error: extended character   is not valid in an identifier 10 |   | ^ a.cc:14:1: error: extended character   is not valid in an identifier 14 |   | ^ a.cc:20:1: error: extended character   is not valid in an identifier 20 |   | ^ a.cc:4:1: error: '\U000000a0' does not name a type 4 |   | ^ a.cc:10:1: error: '\U000000a0' does not name a type 10 |   | ^
s016261439
p03741
C++
#include<iostream> using namespace std;   int sign(int x){ if (x>0) return 1; return -1; }   int main(){ int n; cin >> n;   int sum = 0; int res = 0; for(int i=0;i <n;i++){ int x; cin >> x;   if (sign(sum) != sign(sum+x) ){ sum += x; }else{ sum += x; res += sum; sum = (sum-x > 0 ? -1 : 1); }   } cout << res; return 0; }
a.cc:3:1: error: extended character   is not valid in an identifier 3 |   | ^ a.cc:9:1: error: extended character   is not valid in an identifier 9 |   | ^ a.cc:13:1: error: extended character   is not valid in an identifier 13 |   | ^ a.cc:19:1: error: extended character   is not valid in an identifier 19 |   | ^ a.cc:27:1: error: extended character   is not valid in an identifier 27 |   | ^ a.cc:3:1: error: '\U000000a0' does not name a type 3 |   | ^ a.cc:9:1: error: '\U000000a0' does not name a type 9 |   | ^
s592123131
p03741
C++
#include<iostream> using namespace std;   int sign(int x){ if (x>0) return 1; return -1; }   int main(){ int n; cin >> n;   int sum = 0; int res = 0; for(int i=0;i <n;i++){ int x; cin >> x;   if (sign(sum) != sign(sum+x) ){ sum += x; }else{ sum += x; res += sum; sum = (sum-x > 0 ? -1 : 1); }   cout << res; return 0; } }
a.cc:3:1: error: extended character   is not valid in an identifier 3 |   | ^ a.cc:9:1: error: extended character   is not valid in an identifier 9 |   | ^ a.cc:13:1: error: extended character   is not valid in an identifier 13 |   | ^ a.cc:19:1: error: extended character   is not valid in an identifier 19 |   | ^ a.cc:27:1: error: extended character   is not valid in an identifier 27 |   | ^ a.cc:3:1: error: '\U000000a0' does not name a type 3 |   | ^ a.cc:9:1: error: '\U000000a0' does not name a type 9 |   | ^
s107460914
p03741
C++
#include<iostream> using namespace std;   int sign(x){ if (x>0) return 1; return -1; } int main(){ int n; cin >> n;   int sum = 0; int res = 0; for(int i=0;i <n;i++){ int x; cin >> x;   if (sign(sum) != sign(sum+x) ){ sum += x; }else{ sum += x; res += sum; sum = (sum-x > 0 ? -1 : 1); }   cout << res; return 0; } }
a.cc:3:1: error: extended character   is not valid in an identifier 3 |   | ^ a.cc:13:1: error: extended character   is not valid in an identifier 13 |   | ^ a.cc:19:1: error: extended character   is not valid in an identifier 19 |   | ^ a.cc:27:1: error: extended character   is not valid in an identifier 27 |   | ^ a.cc:3:1: error: '\U000000a0' does not name a type 3 |   | ^ a.cc: In function 'int main()': a.cc:13:1: error: '\U000000a0' was not declared in this scope 13 |   | ^ a.cc:19:2: error: expected ';' before 'if' 19 |   | ^ | ; 20 | if (sign(sum) != sign(sum+x) ){ | ~~ a.cc:22:2: error: 'else' without a previous 'if' 22 | }else{ | ^~~~ a.cc:23:4: error: 'sum' was not declared in this scope 23 | sum += x; | ^~~ a.cc:27:2: error: expected ';' before 'cout' 27 |   | ^ | ; 28 | cout << res; | ~~~~
s462546681
p03741
C++
#include<bits/stdc++.h> using namespace std; /* MOMMMMMOMOBMMMBMGMBMBMBMMMBM iivvYuVoqXPPENGGOGMMMOMOBMBkkqMOBGJuPkkVZBkiBBBMONNqEGOOMGOMMMMONoLrrrrrriiii BBMOGMGOOMOOOMOOOOOMMPjIFSXXBB irISVJkP MMOMOMOMOMOMOMOMOGOMMMMMMMMBu irrLYYukkXSPqGGGZOGMGOGGSokOGOMSLVLu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BMMMMOMOMMMOMOMOMOOOMMPOBOMOOOMMMMMGOMBMNri i i vBBZ iiiii iXBOMOOGGZGGOGOGGZOOMOOGMOMGMOOOOOMOOGGqEEOGGPNqNqNNZEZPXFSSNNMOBMMMBMOOMMMOMOMOMOMOOqBMMOMMBMMOOEkori i i iBBY iiii ZMOOGMGOZGZZZOZOGOZGGOOOOMGMOMGMGMGOOONNNOOONNNZNGEGEEqNPNPGGBMMMMGGMBMOOBMMOMOMMBMBGFMBMBBMGMOOGGqNkPNONFLLriiiiiii iiiii i i iBBi iiiii MOOOMOMOOEZNGZGOMOENGGMOMOOOMOMOMMMOOGENGOMNENZNZNGGENZNNNZNGGOGZXVoMMMGMMMMMOMMMMBBBBBBBBMGEkZOMOBOMOEPPXNXNNGqPUoviiiiiii i i i iBB iiiiii OOGOOMGOOOZOGOENNOOOGOGMOMOMOMOMOMOOGGEZGMGNEGEGEGGONZNEEGNqXZZOENFVNBGOMMMMMMOMMBBMBGJi irLrjGBGMMMMBEFJLiiiiiiiii i i i i i iBE iiirrr OGOOMOOOOGOOBZFuvkBBMMOGOGMGMOOOMOOOOZGGMOGZZZGGOGOEGZGNGZGXEEGGOOONPNMOOGMMMOMMBBj rqGGqoqNZMGqMBBBBEYi irrii iiiiiiiii i i oBv irrvr GGGOGOGMOMBBGkoviJGBBBOOGGGOOOGOOMOOOGZOOOEGGGGGGOGOGGEENGGZXNNGZOOOGGGGGMOMMBBBBS ZOYSMOIrviiFurBBv MjirivYriiiiiiiiiii ii BB iivri OGOGOGOOMMMqYrLi iJXBBMMMGOOMGOOOOOGOZOGMGGEOGOOMGOGOGOZOGOZEXNNZZGGOZOGOOMOMMBBU i i iPVJMMOEFjr iYirOJoNiiiiivLiiiiiiiiii i iBS iri iL GOOOGMMBBBUiiiriii iOBBBMMOOGOGMOMOOGOOMGGGGZOGOGGGOGOGOGGOONqPNNZNENZZGZOZMMMZYi iiiivuEGGNPIoLiiruVPGui i iiiii i i i i i OBiiri ruN OGOOMOGMBUiiiiiiii LBBBBOMOOGOOMOMOMGMMOZOGOGOGGZOZOGGZOGMOZNNPNPZNZEZEGZGOBZjri i i i irXGOGZXPkXuLii i iiiiiiiii i i iMq r iLFEj OMMBMNvoPi iiiiiiriiiiXBMBMMOOOMOOGMGOGOGGGOGOGOZOOOGGZOGOGOGEqNqNqZNZNGEGEOOSLii i i i iJNqNPqIJvii i iiiiiiiiiii i iii i BBi ijFEU MMMMMjrriiiriiiirrLvi iJqMBMMOMOMGOOMGMOOGOGMGMGOGOGOGOGOGOOMGNqNPqqNNZNZNGMMoviiii ivYuULiriiii iiiiiiiii i i i i i i GBu irukPv BGrvNqSr iviiirviiri iiYGBMMOMOOOOGMOOGOGOOOGOGOGOGGZOOOGOOMNNNNXNqNPNqEGMOIviii i i iiviiiiiiiiiiiiiiiiiiiiii UBO irUSIi v BL Ujii ivJriirii i ir LOBMMOMGOOMGMGOGOGOOOGOGOGOGOGOGMGOMOqGNNPqPNqNNOMOuriiii i i iii iiiiiiiiiiiiiiiiiii i i i i i kBr irUPL UM vi iPr ii iJIiiiii iiLviiPMBMMGOGMGMOOGOOOGOGOOOGOGOGOGOGOGMOONZXqPqXNPEOBZoii i i iiiiiiiiiiiiiiiiiiiiiii i iii i iBB irLNPi iEBB rLIiov iii ijvriiiiiiiivLvuMBMOOGOOOOMGOOMOOOOOOGOGOGOGMGOGMOMGGNEqqPNXqNMBELi i i i i i iiiiiiiiiiiiiiiiiiiii i iii i vBN roXGo JMBBU UFBJiLi rrii iiiiiiiiiiiuuLNMOMOOGMOOOOGOOMGOGOOOGOGOGOOOGOOMMOMGNZNNPNqGMMVv i i iii iiiiiiiiiiiiiiiiiiiiiii i GBi irNZOr iIMOZv Siuv iLi iULi iiiiiiiiiivjirSMGOGMOMGMOOOMOOGEGOGOGOGOGOGOOOOMNMMGNNqqNZEMEYi i i i iirii iiiiiiiiiiiiiiiiiii i iii rBZ iJNONi rNNXoi U v JBji iii iiiiiiiiiirr rMMOGGGMOMGOOOOMGGGOGOGOOMOOGOOOGMMqGBOZEGNENOOkiiii i rjriiiiiiiiiiiiiiiiiiiiiii i MBr ivuGMS oPXVvi N X vF iGOi iiiiiiiiiiii iiuBBMOOGOMMOOGMOMOOGMGOGOGOOOGOGOOMOOVBMBOEEZNNPPuiiiii i i iLqUriiiiiiiiiiiiiiii iii IMO rvYNOv ioSVjri OB Uu vBqi ii iiiiiii iiii iBBMMOONEGBOMGOOOOMOOGOGOZGGOOOGOOMOBUoBBMBGZEZqIvLii i i irvjNNuiiiiiiiiiiii i i vBBi irrrqX rFJvri BBF rMSvBBri iiiiiiiiiiii iBBBMOZPNPLZBOOOMGMGOOOGOGGGOGOGOGMGMMkuBMMMBOGGNuLvi vuvriLSEYiiiiiiiii i LBBu rrivNY ivuuLii iBBO rNMGuiiriiiiiiiiiiiii vMBMMGOEOBv OBMOMGOOOGOGOGOOOGOGOGOGOGMMLEBMMMBGEZkuoLi iiiiiiiiiiiiiiivUYviiiiiiiii vBBE irrrUOi iruLJri iBMO UoZoi iiiiiiiiiiiiii LBBOGOOGMBU SBMOMOMGOGOGOGOGOOOGOOMGOOOGBELBBMMMBNZGNFkui iiiiiiiiiiiiiiiiii iiirriiiiii ijMBBr iivrvkU iiiJvrii rBBO i ONLriiiiiiiiiiiiiii vBBMMOOOMBq LBBOMOMOMOOOOGOGOOMGOGOOMOOOMOBuNBMMMMMGGGOOMMSvuOBOi iiiii iii iiiii i iiiiiiiii rFBBBBr XvLLuUi iiirriii jBBZ rS juviiiiiiiiiiiiiiii rBBMOOMGMMB iBBMMOOOOOMGOGMGOOOOOOOOOGMGOGMMGVBMMMMMBGGGMMBBBBMMMvi i iiiii iiiiiiiiii iiiiiijZBBBBMiuNuLoi iiiiiiiii IBBG LSZ rrvrrrriiiiiiiiiii iMBMMOMOMMBi BBBMOMGMOOOOGOGOGOOOOOOOOOOOGMOMMPNBMBMBMMZGGGGMOPuqMNriiiiiiiiiiiiiiiiiiiii iiiirXMMBBBBIjSrv iiiiiiiii NB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ZNZGZMNBOZNZZZEGEENNNENNqZNEk SFqGGMui iMBOOOMGOGOZZGMOMMOEOOMMMOMZOMMBBS BBBMMMMMMMMOMOMOBMMOBBIjBOOOMMGYiSBOMOMMMOMOMGMOOGMGMOMOOGOGOGMGOGOOOGGGOGOGqZO rkjMMEGEGEOZGNZNEGZZMOMMM VSqNGNuirEBMMOOOOOOGGNOOMOOGMGOMMMMOZEMOBBB XBMMOMOMOMMMOMMMuNBBMBGJOMOOOBGUirMMOOOMOOOMOMGOOOGMOOOOGOGMGOGOGOGMGOGOOMOGGBJiESoBMGGGZOGZNZGMMBMBBBOMO VSqZGZFSGBMMOMOMGMOMGEGOGMOMOGOMOMMMGOOMMBBo BBMMOMMMOMOMOBBkiOBBMBFNMMOMMOFL MBMOMGMOMOOOOOMOOOMOOGOGOOOGOGOGOGOGOGOGGGMZi MXkMBGOZGEZGOMBBBOOENVSoj qkOOMOMMBMMMBMBMBMBMMGMOMGMOMGMOMOMMMGMMMMBB FBBOMMMMMMMMMOBBviBBMBGFMOOOMGXNijBMMOMOOGMOMOOOOGOOOGOGOOMOOOOGGGGGOGMGGGMGN iGUJBMOGOGOEBBBMZXXUuLuoqN NZGMMMBBMBMBOMMMBBBGPEMMMMOMOMGMMMOMOGOMOMMBu BBBMMOMOMMMMMMBBijBMBMPGMOMOMXGJiBBMMMMOMOOOMGMGOGOOOGMGOOOOMGOGOGOGMOGOMGGXivULjMBGOZOOBBGIVFkXNPqqqqq r rvvjJvUvrVqSPvvvv vIMOOMOMOOOMOMMMZOGOOBMB iBMMOMOMGGOMOMMBNiIMOBZNOMOMMZEOivMMOMOOGMOOGOOOGOGOGOGOGMGOGOGGGOGOZGGEUuuv vvrvMMOGGGBMv iVNNZNNPNNGG */ long long a[100010]; long long sum[100010]; long long sum1[100010]; long long n; long long main(){ cin>>n; sum[0]=0; long long ans1=0,ans2=0; for (long long i=1;i<=n;i++) { cin>>a[n]; sum[i]=sum[i-1]+a[n]; if (i!=1) { if (sum[i]*sum[i-1]>=0){ if (sum[i]>=0) { ans1+=sum[i]+1; sum[i]=-1; } else { ans1+=1-sum[i]; sum[i]=1; } } } } // for (long long i=1;i<=n;i++) cout<<sum[i]; sum1[0]=0; for (long long i=n;i>0;i--) { long long x=n-i+1; sum1[x]=sum1[x-1]+a[i]; if (i!=n){ if (sum1[x]*sum1[x-1]>=0){ if (sum1[x]>=0){ ans2+=sum1[x]+1; sum1[x]=-1; } else { ans2+=1-sum1[x]; sum1[x]=1; } } } } cout<<min(ans1,ans2)<<endl; // cout<<ans1; return 0; }
cc1plus: error: '::main' must return 'int'
s419993970
p03741
C++
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) //* 便利な変数 namespace { int dx4[] = { 1, -1, 0, 0 }; int dy4[] = { 0, 0, 1, -1 }; int dx8[] = { 1, -1, 0, 0, 1, 1, -1, -1 }; int dy8[] = { 0, 0, -1, 1, -1, 1, -1, 1 }; int mDays[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; ll A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z; const ll MOD_CONST = (ll)(1e9 + 7); } template <typename T> vector<T> INP(ll n) { vector<T> x; REP(i, n) { T tmp; cin >> tmp; x.push_back(tmp); } return move(x); } //* n文字1行の文字列を入力,一文字ごとの配列を返す vector<char> SPRIT_STRING(ll n) { string str; cin >> str; vector<char> cs(n); REP(i, n) cs[i] = str[i]; return move(cs); } //* 文字列中から文字列を検索して別の文字列に置換する void strReplace(std::string& str, const std::string& from, const std::string& to) { std::string::size_type pos = 0; while (pos = str.find(from, pos), pos != std::string::npos) { str.replace(pos, from.length(), to); pos += to.length(); } } //* 素数関連関数 namespace PrimeLib { //* 素数判定 is_prime<unsigned>(N) template<typename T, std::enable_if_t<std::is_unsigned<T>::value, std::nullptr_t> = nullptr> bool is_prime(const T n) { if (n < 4) return n == 2 || n == 3; if (n % 2 == 0 || n % 3 == 0 || (n % 6 != 1 && n % 6 != 5)) return false; for (T i = 5; i * i <= n; i += 6) if (n % i == 0 || n % (i + 2) == 0) return false; return true; } //* 素数テーブル生成 エラトステネスの篩 vector<ll> primeTable(ll n) { vector<bool> table(n - 1); vector<ll> ret; for (ll i = 0; i < n - 1; ++i) { if (table[i] == false) { ll num = i + 2; ret.push_back(i + 2); for (int j = i + num; j < n - 1; j += num) table[j] = true; } } return ret; } } //* 組み合わせ計算 inline unsigned long long NChooseK(const unsigned long long& n, const unsigned long long& k) { if (n < k) return 0; if (0 == n) return 0; if (0 == k) return 1; if (n == k) return 1; if (1 == k) return n; typedef unsigned long long value_type; value_type* table = new value_type[static_cast<std::size_t>(n * n)]; std::fill_n(table, n * n, 0); class n_choose_k_impl { public: n_choose_k_impl(value_type* table, const value_type& dimension) : table_(table), dimension_(dimension) {} inline value_type& lookup(const value_type& n, const value_type& k) { return table_[dimension_ * n + k]; } inline value_type compute(const value_type& n, const value_type& k) { if ((0 == k) || (k == n)) return 1; value_type v1 = lookup(n - 1, k - 1); if (0 == v1) v1 = lookup(n - 1, k - 1) = compute(n - 1, k - 1); value_type v2 = lookup(n - 1, k); if (0 == v2) v2 = lookup(n - 1, k) = compute(n - 1, k); return v1 + v2; } value_type* table_; value_type dimension_; }; value_type result = n_choose_k_impl(table, n).compute(n, k); delete[] table; return result; } //* 座標nx, nyがWidth,Heightの領域内にあるかどうかのチェック inline bool rangeCheck2D(int nx, int ny, int Width, int Height) { return nx >= 0 and nx < Width and ny >= 0 and ny < Height; } //* bit全探索 /* for (int i = 0; i < 1<<N; i++) { REP(j, N) if ((1 & i >> j) == 1) {;} } */ namespace arc072a { void arc072a() { cin >> N; vector<int> as(N); REP(i, N) cin >> as[i]; int sum = as[0]; bool plus = true; int cnt = (sum >= 0) ? 0 : abs(sum) + 1; FOR(i, 1, N) { sum += as[i]; bool nplus = sum >= 0; if (plus == nplus) { if (plus) { cnt += sum + 1; sum = -1; } else { cnt += -sum + 1; sum = 1; } plus = not nplus; } else { plus = nplus; } } if (sum == 0) cnt++; int cnt1 = cnt; plus = false;  sum = as[0]; cnt = (sum < 0) ? 0 : abs(sum) + 1; FOR(i, 1, N) { sum += as[i]; bool nplus = sum >= 0; if (plus == nplus) { if (plus) { cnt += sum + 1; sum = -1; } else { cnt += -sum + 1; sum = 1; } plus = not nplus; } else { plus = nplus; } } if (sum == 0) cnt++; cout << min(cnt1, cnt) << endl; } } int main() { //abc017c::abc017c(); //abc083c::abc083c(); arc072a::arc072a(); //agc001a::agc001a(); return 0; }
a.cc:162:7: error: extended character   is not valid in an identifier 162 |  sum = as[0]; | ^ a.cc: In function 'void arc072a::arc072a()': a.cc:162:7: error: '\U00003000sum' was not declared in this scope 162 |  sum = as[0]; | ^~~~~
s805326831
p03741
C++
#include<iostream> #include<string> #include<cstring> #include<string.h> #include<algorithm> #include<math.h> #include<set> #include<map> #include<vector> #include<cstdio> using namespace std; int n; long long a[120000]; int main() { cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } long long nowa=0; long long sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==0){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } int ans=nowa; nowa=0; sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==1){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } ans=min(ans,nowa); cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:47:8: error: no matching function for call to 'min(int&, long long int&)' 47 | ans=min(ans,nowa); | ~~~^~~~~~~~~~ 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/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:47:8: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 47 | ans=min(ans,nowa); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:47:8: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 47 | ans=min(ans,nowa); | ~~~^~~~~~~~~~
s907771962
p03741
C++
#include<iostream> #include<string> #include<cstring> #include<string.h> #include<algorithm> #include<math.h> #include<set> #include<map> #include<vector> #include<cstdio> using namespace std; int n; int a[120000]; int main() { cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } int nowa=0; int sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==0){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } int ans=nowa; nowa=0; sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==1){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } ans=min(ans,nowa); cout<<ans; return 0; }#include<iostream> #include<string> #include<cstring> #include<string.h> #include<algorithm> #include<math.h> #include<set> #include<map> #include<vector> #include<cstdio> using namespace std; int n; int a[120000]; int main() { cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } int nowa=0; int sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==0){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } int ans=nowa; nowa=0; sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==1){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } ans=min(ans,nowa); cout<<ans; return 0; }#include<iostream> #include<string> #include<cstring> #include<string.h> #include<algorithm> #include<math.h> #include<set> #include<map> #include<vector> #include<cstdio> using namespace std; int n; int a[120000]; int main() { cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } int nowa=0; int sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==0){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } int ans=nowa; nowa=0; sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==1){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } ans=min(ans,nowa); cout<<ans; return 0; }#include<iostream> #include<string> #include<cstring> #include<string.h> #include<algorithm> #include<math.h> #include<set> #include<map> #include<vector> #include<cstdio> using namespace std; int n; int a[120000]; int main() { cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } int nowa=0; int sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==0){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } int ans=nowa; nowa=0; sum=0; for(int i=0;i<n;i++){ sum=sum+a[i]; if(i%2==1){ if(sum<=0) nowa=nowa+1-sum,sum=1; } else{ if(sum>=0) nowa=nowa+sum+1,sum=-1; } } ans=min(ans,nowa); cout<<ans; return 0; }
a.cc:50:2: error: stray '#' in program 50 | }#include<iostream> | ^ a.cc:99:2: error: stray '#' in program 99 | }#include<iostream> | ^ a.cc:148:2: error: stray '#' in program 148 | }#include<iostream> | ^ a.cc:50:3: error: 'include' does not name a type 50 | }#include<iostream> | ^~~~~~~ a.cc:61:5: error: redefinition of 'int n' 61 | int n; | ^ a.cc:12:5: note: 'int n' previously declared here 12 | int n; | ^ a.cc:62:5: error: redefinition of 'int a [120000]' 62 | int a[120000]; | ^ a.cc:13:5: note: 'int a [120000]' previously declared here 13 | int a[120000]; | ^ a.cc:63:5: error: redefinition of 'int main()' 63 | int main() | ^~~~ a.cc:14:5: note: 'int main()' previously defined here 14 | int main() | ^~~~ a.cc:99:3: error: 'include' does not name a type 99 | }#include<iostream> | ^~~~~~~ a.cc:110:5: error: redefinition of 'int n' 110 | int n; | ^ a.cc:12:5: note: 'int n' previously declared here 12 | int n; | ^ a.cc:111:5: error: redefinition of 'int a [120000]' 111 | int a[120000]; | ^ a.cc:13:5: note: 'int a [120000]' previously declared here 13 | int a[120000]; | ^ a.cc:112:5: error: redefinition of 'int main()' 112 | int main() | ^~~~ a.cc:14:5: note: 'int main()' previously defined here 14 | int main() | ^~~~ a.cc:148:3: error: 'include' does not name a type 148 | }#include<iostream> | ^~~~~~~ a.cc:159:5: error: redefinition of 'int n' 159 | int n; | ^ a.cc:12:5: note: 'int n' previously declared here 12 | int n; | ^ a.cc:160:5: error: redefinition of 'int a [120000]' 160 | int a[120000]; | ^ a.cc:13:5: note: 'int a [120000]' previously declared here 13 | int a[120000]; | ^ a.cc:161:5: error: redefinition of 'int main()' 161 | int main() | ^~~~ a.cc:14:5: note: 'int main()' previously defined here 14 | int main() | ^~~~
s002815310
p03741
C++
#include <iostream> #define ll long long using namespace std; ll abs(ll x) { return x<0?-x:x; } int main() { ll n; cin>>n; ll a[n]; for(int i=0;i<n;i++) { cin>>a[i]; } ll s1=0,s2=0,f=1,now1=0,now2=0; for(int i=0;i<n;i++) { now1+=a[i]; now2+=a[i]; if(now1*f<=0) s1+=abs(f-now1),now1=f; if(now2*f>=0) s2+=abs(-f-now2),now2=-f; // cout<<now1<<' '<<now2<<endl; f=-f; } // cout<<s1<<' '<<s2<<endl; cout<<min(s1,s2)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:24:38: error: call of overloaded 'abs(long long int)' is ambiguous 24 | if(now1*f<=0) s1+=abs(f-now1),now1=f; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/include/c++/14/iostream:41, from a.cc:1: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:5:4: note: candidate: 'long long int abs(long long int)' 5 | ll abs(ll x) | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~ a.cc:25:38: error: call of overloaded 'abs(long long int)' is ambiguous 25 | if(now2*f>=0) s2+=abs(-f-now2),now2=-f; | ~~~^~~~~~~~~ /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:5:4: note: candidate: 'long long int abs(long long int)' 5 | ll abs(ll x) | ^~~ /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s717315345
p03741
C++
#include <cstdio> #include <iostream> using namespace std; int n,f[100005]; int did(int b,int t,int not) { int s=f[1],i; for(i=2;i<=n;i++) { if(not!=1) scanf("%d",&f[i]); b*=-1; s+=f[i]; if(b==-1&&s>=0) { t+=(s+1); s=-1; } else if(b==1&&s<=0) { t+=(1-s); s=1; } } return t; } int main() { scanf("%d",&n); scanf("%d",&f[1]); if(f[1]>0) cout<<did(1,0,0)<<endl; else if(f[1]<0) cout<<did(-1,0,0)<<endl; else cout<<min(did(1,1,0),did(-1,1,1))<<endl; return 0; }
a.cc:7:25: error: expected ',' or '...' before 'not' token 7 | int did(int b,int t,int not) | ^~~ a.cc: In function 'int did(int, int, int)': a.cc:12:19: error: expected primary-expression before '!=' token 12 | if(not!=1) scanf("%d",&f[i]); | ^~
s209702770
p03741
C++
#include<iostream> using namespace std; int n; int a[100001]; int t=0,a=0,a2=0; int main() { cin>>n; int l=-1; for(int i=0;i<n;i++){ cin>>a[i]; t+=a[i]; if(t==0){ a1++; if(l<0) t=1; else t=-1; } else if(t<0&&l<0){ a1+=1-t; t=1; } else if(t>0&&l>0){ a1+=t+1; t=-1; } l=t; } t=0; l=1; for(int i=0;i<n;i++){ t+=a[i]; if(t==0){ a2++; if(l<0) t=1; else t=-1; } else if(t<0&&l<0){ a2+=1-t; t=1; } else if(t>0&&l>0){ a2+=t+1; t=-1; } l=t; } cout<<min(a1,a2); }
a.cc:5:9: error: conflicting declaration 'int a' 5 | int t=0,a=0,a2=0; | ^ a.cc:4:5: note: previous declaration as 'int a [100001]' 4 | int a[100001]; | ^ a.cc: In function 'int main()': a.cc:14:25: error: 'a1' was not declared in this scope; did you mean 'a2'? 14 | a1++; | ^~ | a2 a.cc:22:25: error: 'a1' was not declared in this scope; did you mean 'a2'? 22 | a1+=1-t; | ^~ | a2 a.cc:27:25: error: 'a1' was not declared in this scope; did you mean 'a2'? 27 | a1+=t+1; | ^~ | a2 a.cc:55:19: error: 'a1' was not declared in this scope; did you mean 'a2'? 55 | cout<<min(a1,a2); | ^~ | a2
s279065162
p03741
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++) const ll mod = 1e9 + 7; const int INF = 1e9; int main() { cin.sync_with_stdio(false); int n; cin >> n; ll sum = 0, ans1 = 0, ans2 = 0;; vector<ll>a(n); bool flag; rep(i, n) { cin >> a[i]; sum += a[i]; if (i != 0) { if (flag&&sum >= 0) { ans1 += sum + 1; sum = -1; } else if (!flag&&sum <= 0) { ans1 += -sum + 1; sum = 1; } } else { if (sum == 0) { ans1++; sum++; } } if (sum > 0)flag = true; else if (sum < 0){flag = false;ans1+=-sum+1;sum=1} } if (sum == 0)ans1++; sum = 0; rep(i, n) { sum += a[i]; if (i != 0) { if (flag&&sum >= 0) { ans2 += sum + 1; sum = -1; } else if (!flag&&sum <= 0) { ans2 += -sum + 1; sum = 1; } } else { if (sum == 0) { ans2++; sum--; } } if (sum > 0){flag = true;ans2+=sum+1;sum=-1} else if (sum < 0)flag = false; } if (sum == 0)ans2++; cout << min(ans1,ans2) << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:66: error: expected ';' before '}' token 39 | else if (sum < 0){flag = false;ans1+=-sum+1;sum=1} | ^ | ; a.cc:62:60: error: expected ';' before '}' token 62 | if (sum > 0){flag = true;ans2+=sum+1;sum=-1} | ^ | ;
s746459442
p03741
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++) const ll mod = 1e9 + 7; const int INF = 1e9; int main() { cin.sync_with_stdio(false); int n; cin >> n; ll sum = 0, ans1 = 0, ans2 = 0;; vector<ll>a(n); bool flag; rep(i, n) { cin >> a[i]; sum += a[i]; if (i != 0) { if (flag&&sum >= 0) { ans1 += sum + 1; sum = -1; } else if (!flag&&sum <= 0) { ans1 += -sum + 1; sum = 1; } } else { if (sum == 0) { ans1++; sum++; } } if (sum > 0)flag = true; else if (sum < 0){flag = false;ans+=-sum+1;sum=1} } if (sum == 0)ans1++; sum = 0; rep(i, n) { sum += a[i]; if (i != 0) { if (flag&&sum >= 0) { ans2 += sum + 1; sum = -1; } else if (!flag&&sum <= 0) { ans2 += -sum + 1; sum = 1; } } else { if (sum == 0) { ans2++; sum--; } } if (sum > 0){flag = true;ans+=sum+1;sum=-1} else if (sum < 0)flag = false; } if (sum == 0)ans2++; cout << min(ans1,ans2) << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:48: error: 'ans' was not declared in this scope; did you mean 'ans2'? 39 | else if (sum < 0){flag = false;ans+=-sum+1;sum=1} | ^~~ | ans2 a.cc:39:65: error: expected ';' before '}' token 39 | else if (sum < 0){flag = false;ans+=-sum+1;sum=1} | ^ | ; a.cc:62:42: error: 'ans' was not declared in this scope; did you mean 'ans2'? 62 | if (sum > 0){flag = true;ans+=sum+1;sum=-1} | ^~~ | ans2 a.cc:62:59: error: expected ';' before '}' token 62 | if (sum > 0){flag = true;ans+=sum+1;sum=-1} | ^ | ;
s842978421
p03741
C++
#include<bits/stdc++.h> using namespace std; long long int a[100005]={0}; long long int solve(bool even){ long long int sum = 0, ans = 0; for(int i=0;i<n;++i){ if(i == 0){ if(even){ long long int diff = (a[i] > 0 ? 0 : 1 - a[i]); }else{ long long int diff = (a[i] < 0 ? 0 : -1 - a[i]); } sum += a[i] + diff; ans += diff; continue; }else if(i > 0){ long long int tmp = sum + a[i]; if(tmp * sum < 0)sum = tmp; else{ long long int diff = (-sum - (sum > 0 ? 1 : -1)) - a[i]; sum = tmp + diff; ans += abs(diff); } }else sum += a[i]; } return ans; } int main(){ int n; cin >> n; for(int i=0;i<n;++i){ cin >> a[i]; } long long int ans = min(solve(true), solve(false)); cout << ans << endl; return 0; }
a.cc: In function 'long long int solve(bool)': a.cc:8:19: error: 'n' was not declared in this scope 8 | for(int i=0;i<n;++i){ | ^ a.cc:15:27: error: 'diff' was not declared in this scope 15 | sum += a[i] + diff; | ^~~~
s670052866
p03741
C++
#include<bits/stdc++.h> using namespace std; typedef long long int64; int main() { int N, A[100000]; cin >> N; for(int i = 0; i < N; i++) { cin >> A[i]; } // さいしょをマイナスにする! int64 choku = 0, sum1 = 0; for(int i = 0; i < N; i++) { choku += A[i]; if(i % 2 == 0) { sum1 += max(0, choku + 1); choku -= max(0, choku + 1); } else { sum1 += max(0, -choku + 1); choku += max(0, -choku + 1); } } // さいしょをぷらす int64 dai = 0, sum2 = 0; for(int i = 0; i < N; i++) { dai += A[i]; if(i % 2 == 1) { sum2 += max(0, dai + 1); dai -= max(0, dai + 1); } else { sum2 += max(0, -dai + 1); dai += max(0, -dai + 1); } } cout << min(sum1, sum2) << endl; }
a.cc: In function 'int main()': a.cc:21:18: error: no matching function for call to 'max(int, int64)' 21 | sum1 += max(0, choku + 1); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:21:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int64' {aka 'long long int'}) 21 | sum1 += max(0, choku + 1); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:21:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 21 | sum1 += max(0, choku + 1); | ~~~^~~~~~~~~~~~~~ a.cc:22:19: error: no matching function for call to 'max(int, int64)' 22 | choku -= max(0, choku + 1); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:22:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int64' {aka 'long long int'}) 22 | choku -= max(0, choku + 1); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:22:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | choku -= max(0, choku + 1); | ~~~^~~~~~~~~~~~~~ a.cc:24:18: error: no matching function for call to 'max(int, int64)' 24 | sum1 += max(0, -choku + 1); | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:24:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int64' {aka 'long long int'}) 24 | sum1 += max(0, -choku + 1); | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:24:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 24 | sum1 += max(0, -choku + 1); | ~~~^~~~~~~~~~~~~~~ a.cc:25:19: error: no matching function for call to 'max(int, int64)' 25 | choku += max(0, -choku + 1); | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:25:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int64' {aka 'long long int'}) 25 | choku += max(0, -choku + 1); | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:25:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 25 | choku += max(0, -choku + 1); | ~~~^~~~~~~~~~~~~~~ a.cc:34:18: error: no matching function for call to 'max(int, int64)' 34 | sum2 += max(0, dai + 1); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:34:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int64' {aka 'long long int'}) 34 | sum2 += max(0, dai + 1); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:34:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 34 | sum2 += max(0, dai + 1); | ~~~^~~~~~~~~~~~ a.cc:35:17: error: no matching function for call to 'max(int, int64)' 35 | dai -= max(0, dai + 1); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:35:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'int64' {aka 'long long int'}) 35 | dai -= max(0, dai + 1); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initial
s929665325
p03741
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]; long long int np=a[0]; long long int ans=0; if(np==0){ np=1; ans=1; } for(int i=1;i<n;i++){ if(np>0){ if(np+a[i]>=0){ ans+=abs((np+a[i])+1); np=-1; }else{ np+=a[i]; } }else if(np<0){ if(np+a[i]<=0){ ans+=abs((np+a[i])-1); np=1; }else{ np+=a[i]; } } } long long int ans2=np+a[0]+1; if(a[0]<0){ np=1; ans2=np+a[0]-1 }else{ np=-1; ans2=np+a[0]+1 } for(int i=1;i<n;i++){ if(np>0){ if(np+a[i]>=0){ ans2+=abs((np+a[i])+1); np=-1; }else{ np+=a[i]; } }else if(np<0){ if(np+a[i]<=0){ ans2+=abs((np+a[i])-1); np=1; }else{ np+=a[i]; } } } ans=min(ans,ans2); cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:39:31: error: expected ';' before '}' token 39 | ans2=np+a[0]-1 | ^ | ; 40 | }else{ | ~ a.cc:42:31: error: expected ';' before '}' token 42 | ans2=np+a[0]+1 | ^ | ; 43 | } | ~
s648524172
p03741
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]; long long int np=a[0]; long long int ans=0; if(np==0){ np=1; ans=1; } for(int i=1;i<n;i++){ if(np>0){ if(np+a[i]>=0){ ans+=abs((np+a[i])+1); np=-1; }else{ np+=a[i]; } }else if(np<0){ if(np+a[i]<=0){ ans+=abs((np+a[i])-1); np=1; }else{ np+=a[i]; } } } if(a[0]<0){ np=1; }else{ np=-1: } long long int ans2=np+a[0]+1; for(int i=1;i<n;i++){ if(np>0){ if(np+a[i]>=0){ ans2+=abs((np+a[i])+1); np=-1; }else{ np+=a[i]; } }else if(np<0){ if(np+a[i]<=0){ ans2+=abs((np+a[i])-1); np=1; }else{ np+=a[i]; } } } ans=min(ans,ans2); cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:39:22: error: expected ';' before ':' token 39 | np=-1: | ^ | ;
s949046562
p03741
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Math; using static System.Console; using static CS_Contest.Utils; namespace CS_Contest { using Li = List<int>; using LLi = List<List<int>>; class Program { static void Main(string[] args) { new Calc().Solve(); return; } private class Calc { public void Solve() { int N = ReadInt(); var a = ReadInt(' '); int cnt = 0; int sum = a[0]; foreach (var item in a.Select((x,i)=>new { X = x, I = i }).Where(x=>x.I>=1).Select(x=>x.X)) { var asum = sum + item; if (asum * sum < 0) { sum += item;continue; } cnt += Abs(asum) + 1; sum = -1; } cnt.WL(); return; } } } public static class Utils { public static int INF = (int)(1e9); public static void WL(this object obj) => WriteLine(obj); public static void WL(this string obj) => WriteLine(obj); public static void WL<T>(this IEnumerable<T> list) => list.ToList().ForEach(x => x.WL()); public static int ReadInt() => int.Parse(ReadLine()); public static List<int> ReadInt(char s) => ReadLine().Split(s).Select(int.Parse).ToList(); public static long ReadLong() => long.Parse(ReadLine()); public static List<long> ReadLong(char s) => ReadLine().Split(s).Select(long.Parse).ToList(); public static void REP(int n,Action<int> act) { for (int i = 0; i < n; i++) { act(i); } } public static void RREP(int n,Action<int> act) { for (int i = n-1; i >=0; i--) { act(i); } } public static void REP(long n, Action<int> act) => REP((int)n, act); public static void RREP(long n, Action<int> act) => RREP((int)n, act); public static void Yes() => "Yes".WL(); public static void No() => "No".WL(); public static void YES() => "YES".WL(); public static void NO() => "NO".WL(); public static int ManhattanDistance(int x1, int y1, int x2, int y2) => Abs(x2 - x1) + Abs(y2 - y1); public class Tree { public LLi Graph; public Tree(int nodes) { Graph = new LLi(); REP(nodes, x => { Graph.Add(new Li()); }); } public void Add(int x,int y) { Graph[x].Add(y); Graph[y].Add(x); } } } }
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.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:6:7: error: expected nested-name-specifier before 'static' 6 | using static System.Math; | ^~~~~~ a.cc:7:7: error: expected nested-name-specifier before 'static' 7 | using static System.Console; | ^~~~~~ a.cc:8:7: error: expected nested-name-specifier before 'static' 8 | using static CS_Contest.Utils; | ^~~~~~ a.cc:11:20: error: 'List' does not name a type 11 | using Li = List<int>; | ^~~~ a.cc:12:21: error: 'List' does not name a type 12 | using LLi = List<List<int>>; | ^~~~ a.cc:14:26: error: 'string' has not been declared 14 | static void Main(string[] args) { | ^~~~~~ a.cc:14:35: error: expected ',' or '...' before 'args' 14 | static void Main(string[] args) { | ^~~~ a.cc:19:24: error: expected ':' before 'class' 19 | private class Calc { | ^~~~~~ | : a.cc:20:31: error: expected ':' before 'void' 20 | public void Solve() { | ^~~~~ | : a.cc:35:18: error: expected ';' after class definition 35 | } | ^ | ; a.cc:36:6: error: expected ';' after class definition 36 | } | ^ | ; a.cc: In static member function 'static void CS_Contest::Program::Main(int*)': a.cc:15:35: error: expected ';' before '.' token 15 | new Calc().Solve(); | ^ a.cc: In member function 'void CS_Contest::Program::Calc::Solve()': a.cc:21:41: error: 'ReadInt' was not declared in this scope 21 | int N = ReadInt(); | ^~~~~~~ a.cc:22:33: error: 'var' was not declared in this scope 22 | var a = ReadInt(' '); | ^~~ a.cc:24:43: error: 'a' was not declared in this scope 24 | int sum = a[0]; | ^ a.cc:25:46: error: expected ')' before 'item' 25 | foreach (var item in a.Select((x,i)=>new { X = x, I = i }).Where(x=>x.I>=1).Select(x=>x.X)) { | ^~~~ a.cc:25:41: note: to match this '(' 25 | foreach (var item in a.Select((x,i)=>new { X = x, I = i }).Where(x=>x.I>=1).Select(x=>x.X)) { | ^ a.cc:25:33: error: 'foreach' was not declared in this scope 25 | foreach (var item in a.Select((x,i)=>new { X = x, I = i }).Where(x=>x.I>=1).Select(x=>x.X)) { | ^~~~~~~ a.cc:32:37: error: request for member 'WL' in 'cnt', which is of non-class type 'int' 32 | cnt.WL(); | ^~ a.cc: At global scope: a.cc:40:5: error: expected unqualified-id before 'public' 40 | public static class Utils { | ^~~~~~
s333071020
p03741
C++
#include <bits/stdc++.h> #define ll long long using namespace std; int main(void){ int n; cin >> n; ll a[n]; for(int i=0;i<n;i++) cin >> a[i]; ll ans[2]; for(int i=0;i<2;i++){ ll s = 0; ll ans[i] = 0; for(int j=0;j<n;j++){ s += a[j]; if ((i+j)%2){ if (s<=0) {ans[i] += 1-s; s = 1;} }else{ if (s>=0) {ans[i] += s+1; s = -1;} } } } cout << min(ans[0], ans[1]) << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:25: error: array must be initialized with a brace-enclosed initializer 9 | ll s = 0; ll ans[i] = 0; | ^
s959562235
p03741
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_with_stdio(false); } ll n, a[100000]; int aaa(ll flag) { ll ans = 0, gou = 0; rep(i, 0, n) { gou += a[i]; if(flag && gou >= 0) { ans += gou + 1; gou = -1; }else if(!flag && gou <= 0){ ans += -gou + 1; gou = 1; } flag = !flag;a } return ans; } int main() { cin >> n; rep(i, 0, n) cin >> a[i]; cout << min(aaa(true), aaa(false)) << endl; }
a.cc: In function 'int aaa(ll)': a.cc:29:19: error: expected ';' before '}' token 29 | flag = !flag;a | ^ | ; 30 | } | ~
s690657145
p03741
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<math.h> #include<string> #include<string.h> #include<stack> #include<queue> #include<vector> #include<utility> #include<set> #include<map> #include<stdlib.h> #include<iomanip> using namespace std; #define ll long long #define ld long double #define EPS 0.0000000001 #define INF 1e9 #define MOD 1000000007 #define rep(i,n) for(i=0;i<n;i++) #define loop(i,a,n) for(i=a;i<n;i++) #define all(in) in.begin(),in.end() #define shosu(x) fixed<<setprecision(x) #define int ll typedef vector<int> vi; typedef pair<int,int> pii; int main(void) { int i,j; int n; cin>>n; vi a(n); rep(i,n)cin>>a[i]; int sum,ans1=0,ans2=0; sum=0; rep(i,n){ sum+=a[i]; if(i%2){//- if(sum>=0){ ans1+=sum+1; sum=-1; } }else{//+ if(sum<=0){ ans1+=abs(sum)+1; sum=1; } } } sum=0; rep(i,n){ sum+=a[i]; if(i%2){//+ if(sum<=0){ ans2+=abs(sum)+1; sum=1; } }else{//- if(sum>=0){ ans2+=sum+1; sum=-1; } } } cout<<min(ans1,ans2)<<endl; }
cc1plus: error: '::main' must return 'int'
s728632086
p03741
Java
import java.util.Scanner; public class Sequence { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] num = new int[n]; for(int i = 0; i < n; i++){ num[i] = scanner.nextInt(); } int countP = exe(n, num, 1); int countM = exe(n, num, -1); System.out.println(countP > countM ? countM: countP); } private static int exe(int n, int[] num, int sig){ int count = 0; int[] ans = new int[n]; ans[0] = sig * num[0]; for(int i = 0; i < num.length - 1; i++){ int sa = sa(ans, num[i + 1]); ans[i + 1] = num[i + 1] + sa; if(plusCheck(ans)){ count++; ans[ans.length - 1] = addOne(ans[ans.length - 1]); } count += Math.abs(sa); } return count; } private static boolean plusCheck(int[] num){ int total = 0; for(int n: num){ total += n; } return total == 0; } private static int addOne(int num){ int sig = (int)Math.signum(num); return sig * (Math.abs(num) + 1); } private static int sa(int[] left, int right){ int total = 0; for(int num : left){ total += num; } int sigTotal = (int)Math.signum(total); int sigWa = (int)Math.signum(total + right); if(sigTotal != sigWa){ return 0; } return (-sigTotal - total) - right; } }
Main.java:4: error: class Sequence is public, should be declared in a file named Sequence.java public class Sequence { ^ 1 error
s286336232
p03741
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Scanner; public class A { public static void main(String[] args) throws NumberFormatException, IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.valueOf(br.readLine()); String[] t = br.readLine().split(" "); ArrayList<Integer> arr = new ArrayList<Integer>(); for (String a : t){ arr.add(Integer.valueOf(a)); } int count = 0; int sum = 0; int temp =0; for (int j = 0 ; j < n ; j++){ if(j == 0){ sum = arr.get(j); continue; } temp = arr.get(j); if(sum * (sum + temp) >0){ if(sum > 0) { count += Math.abs((-1 -sum) - temp); sum = -1; } else if(sum < 0) { count += Math.abs((1 -sum) - temp); sum = 1; } }else if (sum + temp == 0){ count += 1; if(sum > 0) sum = -1; else if(sum < 0) sum = 1; }else{ sum += arr.get(j); } } System.out.println(count); } }
Main.java:8: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s149489182
p03741
C
#include <stdio.h> #include <stdlib.h> int changeCount(int*, int); int main(void){ /* サイズnの入力 */ int n; if(scanf("%d\n", &n) < 1){ exit(1); } /* a_1,a_2, ... a_nの入力 */ int *a; a = (int*) malloc ( n * sizeof(int)); int i; for(i=0; i<n-1; i++){ if(scanf("%d ", &a[i]) < 1){ //scanfの戻り値は、成功した変数の数、もしくは-1である //printf(stderr, "error: ill-formed fraction.\n"); exit(1); } } if(scanf("%d", &a[n-1]) < 1){ //printf(stderr, "error: ill-formed fraction.\n"); exit(1); } int evenchangeCount = changeCount(a, 0); //何回変更するのかのカウント int oddchangeCount = changeCount(a, 1); //何回変更するのかのカウント if(evenchangeCount <= oddchangeCount){ printf("%d", evenchangeCount); }else{ printf("%d", oddchangeCount); } return 0; } int changeCount(int *a, int oddPositive){ /*sum[i]はa[0]〜a[i]までの和*/ int *sum; int a_size = sizeof(a) / sizeof(int); printf("n = %d\n", n); //sum = (int*)malloc(a_size * sizeof(int)); int temp_1=0, temp_2=0; int changeCount = 0; //何回変更するのかのカウント for(i=0; i < a_size; i++){ temp_2 = temp_1 + a[i]; if(i%2 == 1){ /*iが奇数の時*/ if(oddPositive == 1){ //正でなければいけないとき if(temp_2 <= 0){ //正でないなら changeCount += -temp_2 + 1; temp_2 = 1; } }else{ //負でなければいけないとき if(temp_2 >= 0){ //負でないなら changeCount += sum[i] + 1; sum[i] = -1; } } }else{ /*iが偶数の時*/ if(oddPositive == 0){ //正でなければいけないとき if(temp_2 <= 0){ //正でないなら changeCount += -sum[i] + 1; temp_2 = 1; } }else{ //負でなければいけないとき if(sum[i] >= 0){ //負でないなら changeCount += sum[i] + 1; temp_2 = -1; } } } temp_1 = temp_2; } return changeCount; }
main.c: In function 'changeCount': main.c:49:28: error: 'n' undeclared (first use in this function) 49 | printf("n = %d\n", n); | ^ main.c:49:28: note: each undeclared identifier is reported only once for each function it appears in main.c:54:13: error: 'i' undeclared (first use in this function) 54 | for(i=0; i < a_size; i++){ | ^
s552758670
p03741
C
#include <stdio.h> #include <stdlib.h> int changeCount(int, int*, int); int main(void){ /* サイズnの入力 */ int n; if(scanf("%d\n", &n) < 1){ exit(1); } /* a_1,a_2, ... a_nの入力 */ int *a; a = (int*) malloc ( n * sizeof(int)); int i; for(i=0; i<n-1; i++){ if(scanf("%d ", &a[i]) < 1){ //scanfの戻り値は、成功した変数の数、もしくは-1である //printf(stderr, "error: ill-formed fraction.\n"); exit(1); } } if(scanf("%d", &a[n-1]) < 1){ //printf(stderr, "error: ill-formed fraction.\n"); exit(1); } int evenchangeCount = changeCount(n, a, 0); //何回変更するのかのカウント int oddchangeCount = changeCount(n, a, 1); //何回変更するのかのカウント if(evenchangeCount <= oddchangeCount){ printf("%d", evenchangeCount); }else{ printf("%d", oddchangeCount); } return 0; } int changeCount(int n, int *a, int oddPositive){ /*sum[i]はa[0]〜a[i]までの和*/ int *sum; sum = (int*)malloc( n * sizeof(int)); int changeCount = 0; //何回変更するのかのカウント int evenPositive = (oddPositive==1)? 0: 1;//iが偶数のsumが正のときに1 if(oddPositive==1){ if(a[0] >= 0){ sum[0] = -1; changeCount += -a[0] + 1; }else{ sum[0] = a[0]; } }else{ if(a[0] <= 0){ sum[0] = s1; changeCount += -a[0] + 1; }else{ sum[0] = a[0]; } } int i; for(i=1; i<n; i++){ sum[i] = sum[i-1] + a[i]; if(i%2 == 1){ /*iが奇数の時*/ if(oddPositive == 1){ //正でなければいけないとき if(sum[i] <= 0){ //正でないなら changeCount += -sum[i] + 1; sum[i] = 1; } }else{ //負でなければいけないとき if(sum[i] >= 0){ //負でないなら changeCount += sum[i] + 1; sum[i] = -1; } } }else{ /*iが偶数の時*/ if(evenPositive == 1){ //正でなければいけないとき if(sum[i] <= 0){ //正でないなら changeCount += -sum[i] + 1; sum[i] = 1; } }else{ //負でなければいけないとき if(sum[i] >= 0){ //負でないなら changeCount += sum[i] + 1; sum[i] = -1; } } } } return changeCount; }
main.c: In function 'changeCount': main.c:62:34: error: 's1' undeclared (first use in this function) 62 | sum[0] = s1; | ^~ main.c:62:34: note: each undeclared identifier is reported only once for each function it appears in
s836265132
p03741
C
#include <stdio.h> #include <stdlib.h> int changeCount(int*, boolean); int main(void){ /* サイズnの入力 */ int n; if(scanf("%d\n", &n) < 1){ exit(1); } /* a_1,a_2, ... a_nの入力 */ int *a; a = (int*) malloc ( n * sizeof(int)); int i; for(i=0; i<n-1; i++){ if(scanf("%d ", &a[i]) < 1){ //scanfの戻り値は、成功した変数の数、もしくは-1である //printf(stderr, "error: ill-formed fraction.\n"); exit(1); } } if(scanf("%d", &a[n-1]) < 1){ //printf(stderr, "error: ill-formed fraction.\n"); exit(1); } int evenchangeCount = changeCount(a, false); //何回変更するのかのカウント int oddchangeCount = changeCount(a, true); //何回変更するのかのカウント if(evenchangeCount <= oddchangeCount){ printf("%d", evenchangeCount); }else{ printf("%d", oddchangeCount); } return 0; } int changeCount(int a*, boolean oddPositive){ /*sum[i]はa[0]〜a[i]までの和*/ int *sum; sum = (int*)malloc( n * sizeof(int)); sum[0] = a[0]; int evenchangeCount = 0; //何回変更するのかのカウント boolean evenPositive = (oddPositive)? false: true;//iが偶数のsumが正のときに1 for(i=1; i<n; i++){ sum[i] = sum[i-1] + a[i]; if(i%2 == 1){ /*iが奇数の時*/ if(oddPositive){ //正でなければいけないとき if(sum[i] <= 0){ //正でないなら evenchangeCount += -sum[i] + 1; sum[i] = 1; } }else{ //負でなければいけないとき if(sum[i] >= 0){ //負でないなら evenchangeCount += sum[i] + 1; sum[i] = -1; } } }else{ /*iが偶数の時*/ if(evenPositive){ //正でなければいけないとき if(sum[i] <= 0){ //正でないなら evenchangeCount += -sum[i] + 1; sum[i] = 1; } }else{ //負でなければいけないとき if(sum[i] >= 0){ //負でないなら evenchangeCount += sum[i] + 1; sum[i] = -1; } } } } }
main.c:4:23: error: unknown type name 'boolean' 4 | int changeCount(int*, boolean); | ^~~~~~~ main.c: In function 'main': main.c:32:31: error: implicit declaration of function 'changeCount' [-Wimplicit-function-declaration] 32 | int evenchangeCount = changeCount(a, false); //何回変更するのかのカウント | ^~~~~~~~~~~ main.c:32:46: error: 'false' undeclared (first use in this function) 32 | int evenchangeCount = changeCount(a, false); //何回変更するのかのカウント | ^~~~~ main.c:3:1: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 2 | #include <stdlib.h> +++ |+#include <stdbool.h> 3 | main.c:32:46: note: each undeclared identifier is reported only once for each function it appears in 32 | int evenchangeCount = changeCount(a, false); //何回変更するのかのカウント | ^~~~~ main.c:33:45: error: 'true' undeclared (first use in this function) 33 | int oddchangeCount = changeCount(a, true); //何回変更するのかのカウント | ^~~~ main.c:33:45: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c: At top level: main.c:45:22: error: expected ';', ',' or ')' before '*' token 45 | int changeCount(int a*, boolean oddPositive){ | ^
s501123993
p03741
C++
package main import ( "fmt" "math" ) func main() { var n int64 fmt.Scan(&n) var counter1, counter2 int64 = 0, 0 var total1, total2 int64 = 0, 0 var a int64 for i := 0; i < int(n); i++ { fmt.Scan(&a) total1 += a total2 += a if i%2 == 0 { if total1 <= 0 { counter1 += int64(math.Abs(float64(total1))) + 1 total1 = 1 } } else { if total1 >= 0 { counter1 += int64(math.Abs(float64(total1))) + 1 } } if i%2 == 0 { if total2 >= 0 { counter2 += int64(math.Abs(float64(total2))) + 1 total2 = -1 } } else { if total2 <= 0 { counter2 += int64(math.Abs(float64(total2))) + 1 total2 = 1 } } } if counter1 < counter2 { fmt.Println(counter1) } else { fmt.Println(counter2) } }
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~
s258428679
p03741
C++
#include<iostream> using namespace std; int main (){ int n,m; cin>>n>>m; if(n>m){int k=n;n=m;m=k;} if((m-n)>2)cout<<Alice<<endl; else cout<<Brown<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:18: error: 'Alice' was not declared in this scope 8 | if((m-n)>2)cout<<Alice<<endl; | ^~~~~ a.cc:9:12: error: 'Brown' was not declared in this scope 9 | else cout<<Brown<<endl; | ^~~~~
s873858227
p03741
C++
#include <iostream> #include <vector> #include <cmath> using namespace std; long long work(vector<int> &num, bool flag) { long long sum = 0, count = 0; for (int i = 0; i < num.size(); ++i) { sum += num[i]; if (i % 2 == flag) { if (sum <= 0) { count += 1 - sum; sum = 1; } } else { if (sum >= 0) { count += sum + 1; sum = -1; } } } return count; } int main(void) { int n; cin >> n; vector<long long> num(n); for (int i = 0; i < n; ++i) { cin >> num[i]; } cout << min(work(num, true), work(num, false)) << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:26: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>' 37 | cout << min(work(num, true), work(num, false)) << endl; | ^~~ a.cc:7:29: note: in passing argument 1 of 'long long int work(std::vector<int>&, bool)' 7 | long long work(vector<int> &num, bool flag) { | ~~~~~~~~~~~~~^~~ a.cc:37:43: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>' 37 | cout << min(work(num, true), work(num, false)) << endl; | ^~~ a.cc:7:29: note: in passing argument 1 of 'long long int work(std::vector<int>&, bool)' 7 | long long work(vector<int> &num, bool flag) { | ~~~~~~~~~~~~~^~~
s303565241
p03741
C++
#include<bits/stdc++.h> #define nmax 100001 using namespace std; int n,i; long long x,cur[nmax],ans; int main() { ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0); cin>>n; for(i=1;i<=n;i++) { cin>>x; cur[i]=cur[i-1]+x; if(i>1 && cur[i]<0 && cur[i-1]<0)ans+=abs(cur[i]-1),cur[i]=1; else if(i>1 && cur[i]>0 && cur[i-1]>0)ans+=cur[i]+1,cur[i]=-1; else if(a!cur[i])ans++,cur[i]=1; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:16:25: error: 'a' was not declared in this scope 16 | else if(a!cur[i])ans++,cur[i]=1; | ^ a.cc:16:26: error: expected ')' before '!' token 16 | else if(a!cur[i])ans++,cur[i]=1; | ~ ^ | )
s345651718
p03741
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <map> #include <cstring> using namespace std; int main() { //freopen("input.in", "r", stdin); int n; while(scanf("%d", &n)!=EOF){ int sum=0, res=0; vector<int> nums(n, 0); for(int i=0;i<n;i++){ scanf("%d", &nums[i]); } for(int i=0;i<n;i++){ if(i==0){ sum+=nums[i]; } else { if(sum==0){ res+=(sum+nums[i]!=0?abs(nums[i])-1:3); if(nums[i]>0){ sum=1; } else sum=-1; } else if(sum>0){ res+=(sum+nums[i]<0?0:sum+nums[i]+1); if(sum+nums[i]<0){ sum+=nums[i]; } else sum=-1; } else if(sum<0){ res+=(sum+nums[i]>0?0:1-sum-nums[i]); if(sum+nums[i]>0){ sum+=nums[i]; } else sum=1; } } //cout<<i<<": "<<res<<endl; } cout<<res<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'vector' was not declared in this scope 15 | vector<int> nums(n, 0); | ^~~~~~ a.cc:7:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 6 | #include <cstring> +++ |+#include <vector> 7 | using namespace std; a.cc:15:16: error: expected primary-expression before 'int' 15 | vector<int> nums(n, 0); | ^~~ a.cc:18:26: error: 'nums' was not declared in this scope 18 | scanf("%d", &nums[i]); | ^~~~ a.cc:23:22: error: 'nums' was not declared in this scope 23 | sum+=nums[i]; | ^~~~ a.cc:27:31: error: 'nums' was not declared in this scope 27 | res+=(sum+nums[i]!=0?abs(nums[i])-1:3); | ^~~~ a.cc:34:31: error: 'nums' was not declared in this scope 34 | res+=(sum+nums[i]<0?0:sum+nums[i]+1); | ^~~~ a.cc:42:31: error: 'nums' was not declared in this scope 42 | res+=(sum+nums[i]>0?0:1-sum-nums[i]); | ^~~~
s329975140
p03741
C++
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args){ Main main = new Main(); main.solveC(); } private void solveC() { Scanner sc = new Scanner(System.in); long n = sc.nextInt(); List<Long> list = new ArrayList<Long>(); for (int i = 0; i < n; i++) { list.add(sc.nextLong()); } long start = list.get(0); long origin = innerSolveC(list); list.set(0, 1L); long plus = innerSolveC(list) + Math.abs(start - 1); list.set(0, -1L); long minus = innerSolveC(list) + Math.abs(start + 1); if (origin < plus && start != 0) { if (origin < minus) { System.out.println(origin); } else { if (plus < minus) { System.out.println(plus); } else { System.out.println(minus); } } } else { if (plus < minus) { System.out.println(plus); } else { System.out.println(minus); } } } private long innerSolveC(List<Long> list) { long sum = 0; int ans = 0; for (long tmp : list) { if (sum == 0) { sum = tmp; } else if (sum < 0) { if (sum + tmp > 0) { sum += tmp; } else { ans += 1 - (sum + tmp); sum = 1; } } else { if (sum + tmp < 0) { sum += tmp; } else { ans += (sum + tmp) + 1; sum = -1; } } } return ans; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayList; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.List; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Scanner; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Main { | ^~~~~~
s636815913
p03741
C++
#include<iostream> #include<vector> #include<algorithm> #include<math.h> #define rep(i,a) for(int i=0;i<a;i++) #define nrep(i,a,b) for(int i=a;i<b;i++) #define INF 1145141919810 #define ll long long using namespace std; int main(){ ll n; cin>>n; vector<ll> a(n); rep(i,n) cin>>a[i]; ll sum=0; ll ans_1=0; ll ans_2=0; bool flag=true; rep(i,n){ sum+=a[i]; if(flag){ if(sum>=0){ ans_1+=abs(sum)+1; sum=-1; } }else{ if(sum<=0){ ans_1+=abs(sum)+1; sum=1; } }flag=!flag; }fla=false; sum=0; rep(i,n){ sum+=a[i]; if(flag){ if(sum>=0){ ans_2+=abs(sum)+1; sum=-1; } }else{ if(sum<=0){ ans_2+=abs(sum)+1; sum=1; } }flag=!flag; }cout<<min(ans_1,ans_2)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:32:6: error: 'fla' was not declared in this scope; did you mean 'flag'? 32 | }fla=false; | ^~~ | flag
s802998799
p03741
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s371520891
p03741
C++
#include<stdio.h> #include<iostream> #include<vector> #include<algorithm> #include<math.h> #define rep(i,a) for(int i=0;i<a;i++) #define nrep(i,a,b) for(int i=a;i<b;i++) #define INF 1145141919810 #define ll long long using namespace std; ll solv(const vector<ll> &a,bool flag){ ll ret=0,sum=0; rep(i,n){ sum+=a[i]; if(flag){ if(sum>=0){ ret+=abs(sum)+1; sum=-1; } }else{ if(sum<=0){ ret=abs(sum)+1; sum=1; } }flag=!flag; }return ret; } int main(){ ll n; cin>>n; vector<ll> a(n); rep(i,n) cin>>a[i]; cout<<min(solv(a,true),solv(a,false))<<endl; return 0; }
a.cc: In function 'long long int solv(const std::vector<long long int>&, bool)': a.cc:14:11: error: 'n' was not declared in this scope 14 | rep(i,n){ | ^ a.cc:6:32: note: in definition of macro 'rep' 6 | #define rep(i,a) for(int i=0;i<a;i++) | ^
s254802659
p03741
C++
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int nmax = 100010; const LL mod = 31007; int N; LL a[nmax],ans,s1,s2,s,x; inline void Solve(){ int i,j,sgn; cin >> N; for(i = 1; i <= N; ++i) cin >> a[i]; if(!a[1]){ sgn=s1=s=1; for(i = 2; i <= N; ++i){ if(sgn>0){ x = -1-s if(a[i] <= x){s+=a[i];sgn*=-1;continue;} s+=x; s1+=abs(a[i]-x); sgn*=-1; } else{ x = 1-s if(a[i] >= x){s+=a[i];sgn*=-1;continue;} s+=x; s1+=abs(x-a[i]); sgn*=-1; } } sgn=a[1]=s=-1; s2=1; for(i = 2; i <= N; ++i){ if(sgn>0){ x = -1-s; if(a[i] <= x){s+=a[i];sgn*=-1;continue;} s+=x; s2+=abs(a[i]-x); sgn*=-1; } else{ x = 1-s; if(a[i] >= x){s+=a[i];sgn*=-1;continue;} s+=x; s2+=abs(x-a[i]); sgn*=-1; } } ans=min(s1,s2); cout << ans << '\n'; } else{ while(2); s=a[1]; s2=0; sgn=1; if(a[1]<0)sgn=-1; for(i = 2; i <= N; ++i){ if(sgn>0){ x = (s*-1)-1; if(a[i] <= x){s+=a[i];sgn*=-1;continue;} s+=x; s2+=abs(a[i]-x); sgn*=-1; } else{ x = (s*-1)+1; if(a[i] >= x){s+=a[i];sgn*=-1;continue;} s+=x; s2+=abs(x-a[i]); sgn*=-1; } } cout << s2 << '\n'; } } inline void Reset(){ } int main(void){ int tests; // freopen("txt.in","r",stdin); // freopen("txt.out","w",stdout); ios::sync_with_stdio(false); tests=1; for(int j = 1; j <= tests; ++j){ Solve(); Reset(); } return 0; }
a.cc: In function 'void Solve()': a.cc:21:21: error: expected ';' before 'if' 21 | x = -1-s | ^ | ; 22 | if(a[i] <= x){s+=a[i];sgn*=-1;continue;} | ~~ a.cc:29:23: error: expected ';' before 'if' 29 | x = 1-s | ^ | ; 30 | if(a[i] >= x){s+=a[i];sgn*=-1;continue;} | ~~
s879718946
p03741
C++
#include<stdio.h> #include<iostream> #include<vector> #include<algorithm> #include<math.h> #define rep(i,a) for(int i=0;i<a;i++) #define nrep(i,a,b) for(int i=a;i<b;i++) #define INF 1145141919810 #define ll long long using namespace std; ll solv(const vector<ll> &a,bool flag){ ll ret=0,sum=0; rep(i,n){ sum+=a[i]; if(flag){ if(sum>=0){ ans_1+=abs(sum)+1; sum=-1; } }else{ if(sum<=0){ ans_1+=abs(sum)+1; sum=1; } }flag=!flag; }return ret; } int main(){ ll n; cin>>n; vector<ll> a(n); rep(i,n) cin>>a[i]; cout<<min(solv(a,true),solv(a,false))<<endl; return 0; }
a.cc: In function 'long long int solv(const std::vector<long long int>&, bool)': a.cc:14:11: error: 'n' was not declared in this scope 14 | rep(i,n){ | ^ a.cc:6:32: note: in definition of macro 'rep' 6 | #define rep(i,a) for(int i=0;i<a;i++) | ^ a.cc:18:17: error: 'ans_1' was not declared in this scope 18 | ans_1+=abs(sum)+1; | ^~~~~ a.cc:23:17: error: 'ans_1' was not declared in this scope 23 | ans_1+=abs(sum)+1; | ^~~~~
s180620074
p03741
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long int n,D; cin>>n>>D; vector<long long int> d(n); for(int i=0;i<n;i++){ cin>>d[i]; } int q; cin>>q; vector<long long int> dis(n); dis[0]=D; for(int i=1;i<n;i++){ dis[i]=min(dis[i-1],abs(dis[i-1]-d[i-1])); } for(int i=0;i<q;i++){ int query; cin>>query; query--; int k=dis[query]; for(int i=query+1;i<n;i++){ k=min(max(k-d[i],d[i]/2),k); } if(k==0) cout<<"NO"<<endl; else cout<<"YES"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:12: error: no matching function for call to 'min(const long long int&, int&)' 27 | k=min(max(k-d[i],d[i]/2),k); | ~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:27:12: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 27 | k=min(max(k-d[i],d[i]/2),k); | ~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:27:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 27 | k=min(max(k-d[i],d[i]/2),k); | ~~~^~~~~~~~~~~~~~~~~~~~~~