submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s086255863
p04011
C++
#include<iostream> using namespace std; int main(){ int N,K,X,Y; cin>>N>>K>>X>>Y int sum=0; for(int i=0;i<N;i++){ if(i<K) sum+=X; else sum+=Y; } cout<<sum; }
a.cc: In function 'int main()': a.cc:6:18: error: expected ';' before 'int' 6 | cin>>N>>K>>X>>Y | ^ | ; 7 | int sum=0; | ~~~ a.cc:9:13: error: 'sum' was not declared in this scope 9 | if(i<K) sum+=X; | ^~~ a.cc:10:10: error: 'sum' was not declared in this scope 10 | else sum+=Y; | ^~~ a.cc:12:7: error: 'sum' was not declared in this scope 12 | cout<<sum; | ^~~
s690058473
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k,x,y; cin>>n>>k>>x>>y; cout<<n*x+miax(0,n-k)*(y-x); }
a.cc: In function 'int main()': a.cc:6:13: error: 'miax' was not declared in this scope 6 | cout<<n*x+miax(0,n-k)*(y-x); | ^~~~
s177073409
p04011
C
#include <bits/stdc++.h> using namespace std; int main(){ int n[12], a; for(int i = 0; i < 3; scanf("%d", &a), n[a]++, i++); printf("%s\n", (n[5] == 2 && n[7] == 1) ? "YES" : "NO"); return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s744269012
p04011
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n,k,x,y; cin >> n >> k >> x >> y; int sum = 0; if(n > k){ cout << k * x + (n-k) * y; else{ cout << n * x; } }
a.cc: In function 'int main()': a.cc:10:3: error: expected '}' before 'else' 10 | else{ | ^~~~ a.cc:8:12: note: to match this '{' 8 | if(n > k){ | ^
s258423755
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(void) { int n,k,c,y; int sum=0; cin>>n>>k>>x>>y; for(int i=0;i<k;i++){ if(i<k) sum+=x; else sum+=y; } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:8:14: error: 'x' was not declared in this scope 8 | cin>>n>>k>>x>>y; | ^
s806829065
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K,X,Y; cin>>N>>K>>X>>Y; int sum=0; for(int i=0;i<N;i++){ if(i>K) sum+=Y; else sum+=X; } cout<<sum<endl; }
a.cc: In function 'int main()': a.cc:15:14: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<sum<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:15:15: note: couldn't deduce template parameter '_Bi_iter' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<sum<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:15:15: note: couldn't deduce template parameter '_Bi_iter' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | cout<<sum<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:15:15: note: couldn't deduce template parameter '_CharT' 15 | cout<<sum<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:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | cout<<sum<endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::basic_ostream<char>' is not derived from 'const std::__c
s522336796
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K,X,Y; cin>>N>>K>>X>>Y; int summ=0; for(int i=0;i<N;i++){ if(i>K) sum+=Y; else sum+=X; } }
a.cc: In function 'int main()': a.cc:11:7: error: 'sum' was not declared in this scope; did you mean 'summ'? 11 | sum+=Y; | ^~~ | summ a.cc:13:7: error: 'sum' was not declared in this scope; did you mean 'summ'? 13 | sum+=X; | ^~~ | summ
s078281518
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K,N,X,Y; cin>>K>>N>>X>>Y; int sum=0; for(int i=K;i>0;i++){ sum+=X; } for(int j=N-K;j>0;j++){ sum+=Y } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:12:11: error: expected ';' before '}' token 12 | sum+=Y | ^ | ; 13 | } | ~
s729094705
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K,N,X,Y; cin>>K N X Y; int sum=0; for(int i=K;i>0;i++){ sum+=X; } for(int j=N-K;j>0;j++){ sum+=Y } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:6:9: error: expected ';' before 'N' 6 | cin>>K N X Y; | ^~ | ; a.cc:12:11: error: expected ';' before '}' token 12 | sum+=Y | ^ | ; 13 | } | ~
s968366401
p04011
C++
#include<bits/stdc++.h> using namespace std; int main() { int N, K, X, Y, ans; cin >> N >> K >> X >> Y; if (N>=K) { ans = X * K + Y * (N - K); } else { ans = X * N } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:16: error: expected ';' before '}' token 10 | ans = X * N | ^ | ; 11 | } | ~
s727005872
p04011
C++
n=int(input()) k=int(input()) x=int(input()) y=int(input()) s=0 for i in range(n): if k-1>=i: s=s+x else: s=s+y print(s)
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^
s663986601
p04011
C
#include <stdio.h> int main(void) { int a,b,c,d; double sum; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); scanf("%d",&d); sum=b*c+(a-b)*d printf("%.0f\n",sum); return 0; }
main.c: In function 'main': main.c:10:18: error: expected ';' before 'printf' 10 | sum=b*c+(a-b)*d | ^ | ; 11 | printf("%.0f\n",sum); | ~~~~~~
s819577503
p04011
C++
#include <iostream> using namespace std; int main() { int N, K, X, Y; cin N >> K >> X >> Y; if(N <= K) cout << X*K; else if(N > K) { N = N - K; int sum = K*X + N*Y; cout << sum; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: expected ';' before 'N' 7 | cin N >> K >> X >> Y; | ^~ | ;
s622072638
p04011
C++
#include <iostream> using nampspace std; int main(){ int n,k,x,y; cin >> n >> k >> x >> y; cout << min(n,k)*x+max(0,n-k)*y << endl; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'nampspace' 2 | using nampspace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n >> k >> x >> y; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << min(n,k)*x+max(0,n-k)*y << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:17: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout << min(n,k)*x+max(0,n-k)*y << endl; | ^~~ | std::min 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: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:7:28: error: 'max' was not declared in this scope; did you mean 'std::max'? 7 | cout << min(n,k)*x+max(0,n-k)*y << endl; | ^~~ | std::max /usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:7:44: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout << min(n,k)*x+max(0,n-k)*y << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s335498795
p04011
C++
x#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main(){ int n,k,x,y; cin>>n>>k>>x>>y; if(n<k) cout<< x*n <<endl; else cout<<(n-k)*y + k*x <<endl; }
a.cc:1:2: error: stray '#' in program 1 | x#include<iostream> | ^ a.cc:1:1: error: 'x' does not name a type 1 | x#include<iostream> | ^ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a t
s333083829
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K,X,Y; cin >> N >> K >> X >> Y ; int aaa; if(N<=K){ aaa=N*X } else{ aaa=K*X+(N-X)*Y; } cout <<aaa << endl; }
a.cc: In function 'int main()': a.cc:9:11: error: expected ';' before '}' token 9 | aaa=N*X | ^ | ; 10 | } | ~
s815718989
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ string w; cin >> w; int a[26]; for (int i;i<w.size();i++){ a[s[i]-'a']=1-a[s[i]-'a']; } a.sort(); if (a[25]=0){ cout << "Yes"; } else{ cout << "No"; } }
a.cc: In function 'int main()': a.cc:9:6: error: 's' was not declared in this scope 9 | a[s[i]-'a']=1-a[s[i]-'a']; | ^ a.cc:11:5: error: request for member 'sort' in 'a', which is of non-class type 'int [26]' 11 | a.sort(); | ^~~~
s551951302
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,k,c,y; cin>>n>>k>>x>>y; if (n<=k) { cout<<k*x<<endl; } else { cout<<k*x+(n-k)*y<<endl; } }
a.cc: In function 'int main()': a.cc:6:14: error: 'x' was not declared in this scope 6 | cin>>n>>k>>x>>y; | ^
s402027193
p04011
C++
#include <bits/stdc++.h> using namespace std; // 変数ダンプ先。coutかcerr #define DUMPOUT cerr // 提出時はコメントアウト #define DEBUG_ // #define int long long // intで書いたけど心配なときにlong longに変換する struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast; /* cpp template {{{ */ /* short */ #define pb push_back #define eb emplace_back #define mp make_pair #define Fi first #define Se second #define ALL(v) begin(v), end(v) #define RALL(v) rbegin(v), rend(v) #define X real() #define Y imag() /* REPmacro */ #define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i) #define REP(i, n) REPS(i, 0, n) #define RREP(i, n) REPS(i, 1, n + 1) #define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i) #define DEP(i, n) DEPS(i, n, 0) #define EACH(i, n) for (auto&& i : n) /* debug */ #define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n'; /* alias */ using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; using D = double; using P = complex<D>; using vs = vector<string>; template <typename T> using PQ = priority_queue<T>; template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>; /* const */ const int INF = 1001001001; const ll LINF = 1001001001001001001ll; const int MOD = 1e9 + 7; const D EPS = 1e-9; const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1}; /* func */ inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;} inline int in() {int x; cin >> x; return x;} inline ll IN() {ll x; cin >> x; return x;} inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;} template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;} template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;} template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;} template <typename T> inline void print(const T& x) {cout << x << '\n';} template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);} template <typename T> inline void print(const vector<T>& v, string s = " ") {REP(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");} // clang-format on /* }}} */ #ifdef DEBUG_ #define DEB #else // DEB と打つとデバッグ時以外はコメントアウトになる #define DEB /##/ #endif // 変数ダンプ用マクロ。デバッグ時以外は消滅する // 引数はいくつでもどんな型でも可(ストリーム出力演算子があればOK) #define dump(...) DEB DUMPOUT<<" "; \ DUMPOUT<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl; \ DUMPOUT<<" "; \ dump_func(__VA_ARGS__) // デバッグ用変数ダンプ関数 void dump_func() { DUMPOUT << endl; } template <class Head, class... Tail> void dump_func(Head&& head, Tail&&... tail) { DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...); } // vector出力 template<typename T> ostream& operator << (ostream& os, vector<T>& vec) { os << "{"; for (int i = 0; i<vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : ", "); } os << "}"; return os; } signed main() { int N, K, X, Y; cin >> N >> K >> X >> Y; ll ans; ans = N * X; if (K < N) { ans -= (N - K) * (X - Y); } cout << ans << endl; cout << N * (N + 1) / 2 << endl; return 0; } // https://github.com/kurokoji/.cpp-Template/wiki テンプレートについて // http://www.creativ.xyz/dump-cpp-652 dump()について // https://gist.github.com/rigibun/7905920 色々
a.cc: In function 'int main()': a.cc:23:15: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 23 | #define X real() | ^~ a.cc:114:15: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ a.cc:23:15: note: remove parentheses to default-initialize a variable 23 | #define X real() | ^~ a.cc:114:15: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ a.cc:23:15: note: or replace parentheses with braces to value-initialize a variable 23 | #define X real() | ^~ a.cc:114:15: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ a.cc:24:15: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 24 | #define Y imag() | ^~ a.cc:114:18: note: in expansion of macro 'Y' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ a.cc:24:15: note: remove parentheses to default-initialize a variable 24 | #define Y imag() | ^~ a.cc:114:18: note: in expansion of macro 'Y' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ a.cc:24:15: note: or replace parentheses with braces to value-initialize a variable 24 | #define Y imag() | ^~ a.cc:114:18: note: in expansion of macro 'Y' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ a.cc:114:35: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ~~~~~~~~~~~~~ ^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included 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/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed: a.cc:23:15: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'int' 23 | #define X real() | ~~~~^~ a.cc:114:38: note: in expansion of macro 'X' 114 | int N, K, X, Y; cin >> N >> K >> X >> Y; | ^ /usr/include/c++/14/istream:227:7: note: ca
s478405514
p04011
C++
#include <iostream> using namespace std; typedef long long unsigned int ll; int main() { int N、K,X,Y; cin >> N; cin >> K; cin >> X; cin >> Y; cout << K*X+(N-K)*Y<<endl; return 0; }
a.cc:7:7: error: extended character 、 is not valid in an identifier 7 | int N、K,X,Y; | ^ a.cc: In function 'int main()': a.cc:8:10: error: 'N' was not declared in this scope 8 | cin >> N; | ^ a.cc:9:10: error: 'K' was not declared in this scope 9 | cin >> K; | ^
s502044904
p04011
C++
#include <bits/stcd++.h> using namespace std; int main(){ int N, K, X, Y; cin >> N >> K >> X >> Y; if(N - K <= 0) cout << N * X; else cout << N * X + (K - N) * Y; }
a.cc:1:10: fatal error: bits/stcd++.h: No such file or directory 1 | #include <bits/stcd++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s960288429
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K,X,Y ; cin >>N>>K>>X>>Y ; if (N <= K ){ cout << N*X << endl; } ifelse { cout << K*X+(N-K)*Y <<endl ; } }
a.cc: In function 'int main()': a.cc:10:3: error: 'ifelse' was not declared in this scope; did you mean 'sigrelse'? 10 | ifelse { | ^~~~~~ | sigrelse
s360561573
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K,X,Y ; cin <<N<<K<<X<<Y ; if (N <= K ){ cout << N*X << endl; } ifelse { cout << K*X+(N-K)*Y <<endl ; } }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin <<N<<K<<X<<Y ; | ~~~ ^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operator<<(int, int)' (built-in) 6 | cin <<N<<K<<X<<Y ; | ~~~~^~~ a.cc:6:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<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:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:6:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 6 | cin <<N<<K<<X<<Y ; | ^~~ 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:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ 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: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin <<N<<K<<X<<Y ; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<cla
s536096207
p04011
C++
#include<iostream> using namespace std; int main(){ int N,K,X,Y; cin >> N >> K >> X >> Y; cout << (N<K)?(N*X):(K*X+(N-K)*Y) << endl; }
a.cc: In function 'int main()': a.cc:6:43: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 6 | cout << (N<K)?(N*X):(K*X+(N-K)*Y) << endl; | ~~~~~~~~~~~~~~^~~~~~~
s490923309
p04011
Java
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextint(); if(n<=k) { System.out.println(x*n); }else { System.out.println(x*k+y*(n-k)); } } }
Main.java:8: error: cannot find symbol int y = sc.nextint(); ^ symbol: method nextint() location: variable sc of type Scanner 1 error
s510771507
p04011
C++
#include <iostream> using namespace std; int main (){ int N, K, X, Y, cost; cin >> N >> K >> X >> Y; cost = X*K + (N-K)*Y; cout << cost << endl; } ~
a.cc:12:2: error: expected class-name at end of input 12 | ~ | ^
s825936496
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, K, X, Y, price = 0; cin >> N >> K >> X >> Y; if(K < N){ price = X * K + Y * (N - K); } else{ price = X * N } cout << price << endl; }
a.cc: In function 'int main()': a.cc:11:18: error: expected ';' before '}' token 11 | price = X * N | ^ | ; 12 | } | ~
s105508791
p04011
C++
#include<bits/stdc++.h> using namespace std; int N,K,X,Y,res; int main(){ cin>>N>>>K>>X>>Y; for(int i=1; i<=N; ++i){ if(i<=K) res+=X; else res+=Y; } cout<<res<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:11: error: expected primary-expression before '>' token 8 | cin>>N>>>K>>X>>Y; | ^
s788117135
p04011
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;i++) using namespace std; signed main(){ int a,b,c,d; cin>>a>>b>>c>>d; cout<<max(a,b)*c+max(a-b,0)*d<<endl; }
a.cc: In function 'int main()': a.cc:8:29: error: no matching function for call to 'max(long long int, int)' 8 | cout<<max(a,b)*c+max(a-b,0)*d<<endl; | ~~~^~~~~~~ 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:29: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 8 | cout<<max(a,b)*c+max(a-b,0)*d<<endl; | ~~~^~~~~~~ /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:29: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 8 | cout<<max(a,b)*c+max(a-b,0)*d<<endl; | ~~~^~~~~~~
s886843406
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, K, X, Y; cin >> N >> K >> X >> Y; cout << min(N,K)*X +(N>K)(N-K)*Y << endl; }
a.cc: In function 'int main()': a.cc:7:28: error: expression cannot be used as a function 7 | cout << min(N,K)*X +(N>K)(N-K)*Y << endl; | ~~~~~^~~~~
s628478412
p04011
C
#include <stdio.h> int main(void){ int a,b,c,d; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); scanf("%d",&d); if(a<b){printf("%d",(c*a);} if(a>b){printf("%d",b*c+(a-b)*d);} return 0; }
main.c: In function 'main': main.c:8:28: error: expected ')' before ';' token 8 | if(a<b){printf("%d",(c*a);} | ~ ^ | ) main.c:8:29: error: expected ';' before '}' token 8 | if(a<b){printf("%d",(c*a);} | ^ | ;
s198363121
p04011
C++
int main(){ int n,k,x,y; cin>>n>>k>>x>>y; int ans; if(n>k){ ans = (k)*x + (n-k)*y; } else{ ans = n*x; } cout <<ans<<endl; }
a.cc: In function 'int main()': a.cc:3:3: error: 'cin' was not declared in this scope 3 | cin>>n>>k>>x>>y; | ^~~ a.cc:11:3: error: 'cout' was not declared in this scope 11 | cout <<ans<<endl; | ^~~~ a.cc:11:15: error: 'endl' was not declared in this scope 11 | cout <<ans<<endl; | ^~~~
s021246978
p04011
C++
#inclde<bits/stdc++.h> using namespace std; int main(){ int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
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:4:15: error: 'cin' was not declared in this scope 4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | ^~~ 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:4:39: error: 'cout' was not declared in this scope 4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | ^~~~ a.cc:4:39: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:4:54: error: 'cout' was not declared in this scope 4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | ^~~~ a.cc:4:54: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s495142646
p04011
C++
#incldue<bits/stdc++.h> using namespace std; int main(){ int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include? 1 | #incldue<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:4:15: error: 'cin' was not declared in this scope 4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #incldue<bits/stdc++.h> a.cc:4:39: error: 'cout' was not declared in this scope 4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | ^~~~ a.cc:4:39: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:4:54: error: 'cout' was not declared in this scope 4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | ^~~~ a.cc:4:54: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s496416405
p04011
C++
#include <iostream> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; if(b>a){cout<<N*c<<endl;} else cout<<b*C+(a-b)*d<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:16: error: 'N' was not declared in this scope 7 | if(b>a){cout<<N*c<<endl;} | ^ a.cc:8:16: error: 'C' was not declared in this scope 8 | else cout<<b*C+(a-b)*d<<endl; | ^
s176518829
p04011
C++
#include<iostream> int main(void) { int n,k,x,y,ans; n = k = x = y = ans = 0; cin >> n >> k >> x >> y; for(int i = 0;i < n;i++) { if(k < i){ans += y;} else{ans += x;} } cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> n >> k >> x >> y; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 16 | cout << ans; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s680738987
p04011
Java
import java.util.*; public class Main{ public static void main(string[] args){ Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int k = Integer.parseInt(sc.next()); int x = Integer.parseInt(sc.next()); int y = Integer.parseInt(sc.next()); System.out.println(k * x + (n-k) * y); } }
Main.java:3: error: cannot find symbol public static void main(string[] args){ ^ symbol: class string location: class Main 1 error
s323715425
p04011
Java
import java.util.*; public class Main{ public static void main(string[] args){ int n = Integer.parseInt(sc.next()); int k = Integer.parseInt(sc.next()); int x = Integer.parseInt(sc.next()); int y = Integer.parseInt(sc.next()); System.out.println(k * x + (n-k) * y); } }
Main.java:3: error: cannot find symbol public static void main(string[] args){ ^ symbol: class string location: class Main Main.java:4: error: cannot find symbol int n = Integer.parseInt(sc.next()); ^ symbol: variable sc location: class Main Main.java:5: error: cannot find symbol int k = Integer.parseInt(sc.next()); ^ symbol: variable sc location: class Main Main.java:6: error: cannot find symbol int x = Integer.parseInt(sc.next()); ^ symbol: variable sc location: class Main Main.java:7: error: cannot find symbol int y = Integer.parseInt(sc.next()); ^ symbol: variable sc location: class Main 5 errors
s425471897
p04011
C
#include <stdio.h> int main(int argc, char const *argv[]) { int n,k,x,y; scanf("%d %d %d %d",&n,&k,&x,&y); printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c)); return 0; }
main.c: In function 'main': main.c:7:24: error: 'a' undeclared (first use in this function) 7 | printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c)); | ^ main.c:7:24: note: each undeclared identifier is reported only once for each function it appears in main.c:7:28: error: 'b' undeclared (first use in this function) 7 | printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c)); | ^ main.c:7:38: error: 'c' undeclared (first use in this function) 7 | printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c)); | ^ main.c:7:46: error: 'd' undeclared (first use in this function) 7 | printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c)); | ^
s717198449
p04011
C
#include <stdio.h> int main(int argc, char const *argv[]) { scanf("%d %d %d %d",&n,&k,&x,&y); printf("%d\n",(n > k) ? (k * x + n * y - k * y) : (n * x)); return 0; }
main.c: In function 'main': main.c:5:30: error: 'n' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n,&k,&x,&y); | ^ main.c:5:30: note: each undeclared identifier is reported only once for each function it appears in main.c:5:33: error: 'k' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n,&k,&x,&y); | ^ main.c:5:36: error: 'x' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n,&k,&x,&y); | ^ main.c:5:39: error: 'y' undeclared (first use in this function) 5 | scanf("%d %d %d %d",&n,&k,&x,&y); | ^
s361158677
p04011
C++
#include <iostream> using namespace std; int main(void){ int x,y,z,w; cin >> x >> y >> z >> w; if(x < y){ cout << x*z << endl; }else{ cout << y*z + (x-y)*k << endl; } }
a.cc: In function 'int main()': a.cc:10:25: error: 'k' was not declared in this scope 10 | cout << y*z + (x-y)*k << endl; | ^
s241913379
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(){ int,n,k,x,y; cin>>n>>k>>x>>y; cout<<k*x+(n-k)*y<<endl; }
a.cc: In function 'int main()': a.cc:4:12: error: expected unqualified-id before ',' token 4 | int,n,k,x,y; | ^
s412621403
p04011
C++
#include <iostream> using namespace std; int main() { int N, K, X, Y; cin >> N >> K >> X >>Y; if(N>k) cout << K*X + (N - K)*Y; else cout << N*X; }
a.cc: In function 'int main()': a.cc:8:8: error: 'k' was not declared in this scope 8 | if(N>k) | ^
s654905995
p04011
C++
#include <iostream> using namespace std; int main() { if(N>k) cout << K*X + (N - K)*Y; else cout << N*X; }
a.cc: In function 'int main()': a.cc:6:6: error: 'N' was not declared in this scope 6 | if(N>k) | ^ a.cc:6:8: error: 'k' was not declared in this scope 6 | if(N>k) | ^ a.cc:7:13: error: 'K' was not declared in this scope 7 | cout << K*X + (N - K)*Y; | ^ a.cc:7:15: error: 'X' was not declared in this scope 7 | cout << K*X + (N - K)*Y; | ^ a.cc:7:27: error: 'Y' was not declared in this scope 7 | cout << K*X + (N - K)*Y; | ^ a.cc:9:15: error: 'X' was not declared in this scope 9 | cout << N*X; | ^
s177831609
p04011
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; int main() { ll N, K, X, Y; cin >> N >> K >> X >> Y; cout << N * X - std::max(0, N - K) * (X - Y) << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:29: error: no matching function for call to 'max(int, ll)' 18 | cout << N * X - std::max(0, N - K) * (X - Y) << endl; | ~~~~~~~~^~~~~~~~~~ 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:18:29: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 18 | cout << N * X - std::max(0, N - K) * (X - Y) << endl; | ~~~~~~~~^~~~~~~~~~ /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:18:29: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 18 | cout << N * X - std::max(0, N - K) * (X - Y) << endl; | ~~~~~~~~^~~~~~~~~~
s730072089
p04011
C++
n = int(input()) k = int(input()) x = int(input()) y = int(input()) if n > k: print(k * x + (n - k) * y) else: print(n * x)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s879825653
p04011
C
#include<stdio.h> #include<stdlib.h> #include<string.h> //絶対値 long long int change_plus(long long int a) { if (a < 0) { return -a; } if (a >= 0) { return a; } } //大小比較(大) long long int big(long long int a, long long int b) { if (a >= b) { return a; } else { return b; } } //大小比較(小) long long int small(long long int a, long long int b) { if (a >= b) { return b; } else { return a; } } int main() { long long int n, m, k,p,q; char str[30],str2[15],str3[15]; scanf("%lld%lld%lld%lld",&n,&m,&k,&p); if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) } }
main.c: In function 'main': main.c:33:76: error: expected ';' before '}' token 33 | if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) } | ^~ | ;
s122004676
p04011
C
#include<stdio.h> #include<stdlib.h> #include<string.h> //絶対値 long long int change_plus(long long int a) { if (a < 0) { return -a; } if (a >= 0) { return a; } } //大小比較(大) long long int big(long long int a, long long int b) { if (a >= b) { return a; } else { return b; } } //大小比較(小) long long int small(long long int a, long long int b) { if (a >= b) { return b; } else { return a; } } int main() { long long int n, m, k,p,q; char str[30],str2[15],str3[15]; scanf("%lld%lld%lld%lld",&n,&m,&k,&p); if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) } printf("%lld",p); }
main.c: In function 'main': main.c:33:76: error: expected ';' before '}' token 33 | if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) } | ^~ | ;
s806649293
p04011
C
#include<stdio.h> int main(){ int n,k,x,y; scanf("%d%d%d%d",&n,&k,&x,&y); if(n<=k)printf("%d",n*x); else printf("%d",k*x+(n-k)*y); reurn 0; }
main.c: In function 'main': main.c:7:3: error: 'reurn' undeclared (first use in this function) 7 | reurn 0; | ^~~~~ main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in main.c:7:8: error: expected ';' before numeric constant 7 | reurn 0; | ^~ | ;
s277234866
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n, k, x, y; cint >> n >> k >> x >> y; cout << k * x + (n - k) * y << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:17: error: 'cint' was not declared in this scope; did you mean 'uint'? 6 | cint >> n >> k >> x >> y; | ^~~~ | uint
s221871174
p04011
C
#incliude <stdio.h> int main(){ int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); printf("%d",a*c+(b-a)*d); return 0; }
main.c:1:2: error: invalid preprocessing directive #incliude; did you mean #include? 1 | #incliude <stdio.h> | ^~~~~~~~ | include main.c: In function 'main': main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d%d%d%d",&a,&b,&c,&d); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #incliude <stdio.h> main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d%d%d%d",&a,&b,&c,&d); | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%d",a*c+(b-a)*d); | ^~~~~~ main.c:6:1: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:6:1: note: include '<stdio.h>' or provide a declaration of 'printf'
s324070966
p04011
C
#incliude <stdio.h> int main(){ int a,b,c,d; printf("%d",a*c+(b-a)*d); return 0; }
main.c:1:2: error: invalid preprocessing directive #incliude; did you mean #include? 1 | #incliude <stdio.h> | ^~~~~~~~ | include main.c: In function 'main': main.c:5:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 5 | printf("%d",a*c+(b-a)*d); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | #incliude <stdio.h> main.c:5:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 5 | printf("%d",a*c+(b-a)*d); | ^~~~~~ main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf'
s133099539
p04011
C
#include<stdio.h> int main(){ int N, K, X, Y, accommodation; scanf("%d %d %d %d", &N, &K, &X, &Y); if(N <= K){ accommodtion = N * X; } else { accommodation = N*X + (K - N)*Y; } printf("%d\n", accommodation); return 0; }
main.c: In function 'main': main.c:9:5: error: 'accommodtion' undeclared (first use in this function); did you mean 'accommodation'? 9 | accommodtion = N * X; | ^~~~~~~~~~~~ | accommodation main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
s891532537
p04011
C
#include <bits/stdc++.h> int main() { int n, k, x, y, fee; scanf("%d %d %d %d", &n, &k, &x, &y); if(n<=k) fee = n*x; else{ fee = k*x; fee+=((n-k)*y); } printf("%d\n", fee); return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s183788542
p04011
C
#include<stdio.h> int main(){ int n,k,x,y,ans=0;i; scanf("%d%d%d%d",&n,&k,&x,&y); for(i=1;i<=n;i++){ if(i<=k)ans+=x; else ans+=y; } return 0; }
main.c: In function 'main': main.c:4:19: error: 'i' undeclared (first use in this function) 4 | int n,k,x,y,ans=0;i; | ^ main.c:4:19: note: each undeclared identifier is reported only once for each function it appears in
s647500857
p04011
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <iostream> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; typedef vector<long long> vll, vLL; bool check(const string& s,const string& t){ int n = s.size(); int m = t.size(); for(int i=0;i<=n-m;i++){ bool ok = true; REP(j,m){ if(s[i+j]!='?' && s[i+j]!=t[j])ok=false; } if(ok)return true; } return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n,a,x[51],y[51],maxX; ll dp[51][5001]; scanf("%d %d",&n,&a); maxX = a; REP(i,n){ scanf("%d",&x[i+1]); maxX = max(x[i+1],maxX); } memset(dp,0,sizeof(dp)); REP(j,n){ y[j+1] = x[j+1] - a; } dp[0][n*maxX]=1; for(int j = 1;j<=n;j++){ REP(t,2*n*maxX + 1){ dp[j][t] = dp[j-1][t]; if(t>=y[j] && t-y[j]<=2*n*maxX){ dp[j][t] += dp[j-1][t-y[j]]; //if(dp[j][t]>0)cout << "if dp[" << j-1 << "][" << t << "]+dp[" << j-1 << "][" << t-y[j] << "]=dp[" << j << "][" << t << "]=" << dp[j][t] << endl; }else{ //if(dp[j][t]>0)cout << "else dp[" << j-1 << "][" << t << "]=dp[" << j << "][" << t << "]=" << dp[j][t] << endl; } } } cout << dp[n][n*maxX]-1 << endl; return 0; } /*int A[100100]; long long dp[100][3000]; int main3(){ int n,x,a; cin >> n >> x; for(int i=0;i<n;i++){ cin >> A[i]; A[i]-=x; } dp[0][n*x]=1; for(int i=0;i<n;i++){ for(int j=0;j<=50*50;j++){ dp[i+1][j]=dp[i][j]; if(j-A[i]>=0) dp[i+1][j]+=dp[i][j-A[i]]; cout << "dp[" << i+1 << "][" << j << "]=" << dp[i+1][j] << endl; } } cout << dp[n][n*x]-1 << endl; return 0; }*/
a.cc: In function 'int main()': a.cc:37:9: error: 'memset' was not declared in this scope 37 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <functional> +++ |+#include <cstring> 4 | #include <string>
s282783290
p04011
C++
#include <iostream> using namespace std; int main(){ int N,K,X,Y; cin << N << K << X << Y; int ans = 0; for (int i = 0; i < N; i++) { if(i<=K) ans+=X; else ans+=Y; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << N << K << X << Y; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operator<<(int, int)' (built-in) 6 | cin << N << K << X << Y; | ~~~~^~~~ a.cc:6:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' 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:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:6:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 6 | cin << N << K << X << Y; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:6:10: required from here 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s583485134
p04011
C
#include<stdio.h> #include<iostream> #include<malloc.h> #include<string.h> #include<stdlib.h> using namespace std; int main() { int N,K,X,Y; int i; int sum=0; cin >> N>>K>>X>>Y; if(N<=K) { for(i=0;i<N;i++) { sum+=X; } } else { for(i=0;i<K;i++) { sum+=X; } for(i=0;i<N-K;i++) { sum+=Y; } } cout << sum<<endl; return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s927014627
p04011
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <iostream> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; typedef vector<long long> vll, vLL; bool check(const string& s,const string& t){ int n = s.size(); int m = t.size(); for(int i=0;i<=n-m;i++){ bool ok = true; REP(j,m){ if(s[i+j]!='?' && s[i+j]!=t[j])ok=false; } if(ok)return true; } return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n,a,x[60],y[60]; scanf("%d %d",&n,&a); REP(i,n){ scanf("%d",&x[i]); } ll dp[50][2500]; memset(dp,0,sizeof(dp)); REP(j,n){ y[j] = x[j] - a; } dp[0][n*a]=1; REP(i,n){ for(int k=0;k<=n*a;k++){ dp[i+1][k] = dp[i][k]; if(k>=y[i]&&k-y[i]<=2*n*a)dp[i+1][k] += dp[i][k-y[i]]; } } cout << dp[n][n*a]-1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:35:9: error: 'memset' was not declared in this scope 35 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <functional> +++ |+#include <cstring> 4 | #include <string>
s637570681
p04011
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <iostream> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; typedef vector<long long> vll, vLL; bool check(const string& s,const string& t){ int n = s.size(); int m = t.size(); for(int i=0;i<=n-m;i++){ bool ok = true; REP(j,m){ if(s[i+j]!='?' && s[i+j]!=t[j])ok=false; } if(ok)return true; } return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n,a,x[60],y[60]; scanf("%d %d",&n,&a); REP(i,n){ scanf("%d",&x[i]); } ll dp[50][2500]; memset(dp,0,sizeof(dp)); REP(j,n){ y[j] = x[j] - a; } dp[0][n*a]=1; REP(i,n){ for(int k=0;k<=n*a;k++){ dp[i+1][k] = dp[i][k]; if(k>=y[i]&&k-y[i]<=2*n*a)dp[i+1][k] += dp[i][k-y[i]]; } } cout << dp[n][n*a]-1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:35:9: error: 'memset' was not declared in this scope 35 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <functional> +++ |+#include <cstring> 4 | #include <string>
s569526174
p04011
C++
#include<iostream> using namespace std; int main(){ int a,b,c,b; cin>>a>>b>>c>>d; if(a>b){ cout<<b*c+(a-b)*d<<endl; } else{ cout<<b*c<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:4:13: error: redeclaration of 'int b' 4 | int a,b,c,b; | ^ a.cc:4:9: note: 'int b' previously declared here 4 | int a,b,c,b; | ^ a.cc:5:17: error: 'd' was not declared in this scope 5 | cin>>a>>b>>c>>d; | ^
s037755747
p04011
C++
n = int(input()) k = int(input()) x = int(input()) y = int(input()) if n < k: print (n*x) else: print (k*x + (n-k)*y)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s541755273
p04011
C++
#include <bits/stdc++.h> int main() { int N,K,X,Y; int total=0; cin>>N>>K>>X>>Y; for(int i=1;i<=N;i++){ if(i<=X) total+=X; else total+=Y; } cout<<total<<endl; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>N>>K>>X>>Y; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 11 | cout<<total<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:11:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 11 | cout<<total<<endl; | ^~~~ | std::endl 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: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s031342983
p04011
C++
main :: IO () main = (map read).lines <$> getContents
a.cc:2:1: error: 'main' does not name a type 2 | main :: IO () | ^~~~
s747799775
p04011
C
#include<stdio.h> int main(void){ int n, ,k, x, y; scanf("%d%d%d%d",&n, &k, &x, &y); int cost; if(n<=k) cost = n*x; else cost = k*x+(n-k)*y; printf("%d\n",cost); return 0; }
main.c: In function 'main': main.c:4:12: error: expected identifier or '(' before ',' token 4 | int n, ,k, x, y; | ^ main.c:5:27: error: 'k' undeclared (first use in this function) 5 | scanf("%d%d%d%d",&n, &k, &x, &y); | ^ main.c:5:27: note: each undeclared identifier is reported only once for each function it appears in main.c:5:31: error: 'x' undeclared (first use in this function) 5 | scanf("%d%d%d%d",&n, &k, &x, &y); | ^ main.c:5:35: error: 'y' undeclared (first use in this function) 5 | scanf("%d%d%d%d",&n, &k, &x, &y); | ^
s457269505
p04011
C++
#include<iostream> using namespce std; int main(){ int n,k,x,y; cin>>n>>k>>x>>y; if(n>k)cout<<k*x+(n-k)*y<<endl; else cout<<k*x<<endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namespce' 2 | using namespce std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n>>k>>x>>y; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:6:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | if(n>k)cout<<k*x+(n-k)*y<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:6:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | if(n>k)cout<<k*x+(n-k)*y<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:7:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | else cout<<k*x<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | else cout<<k*x<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s347279575
p04011
C++
include<iostream> using namespce std; int main(){ int n,k,x,y; cin>>n>>k>>x>>y; if(n>k)cout<<k*x+(n-k)*y<<endl; else cout<<k*x<<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin>>n>>k>>x>>y; | ^~~ a.cc:6:10: error: 'cout' was not declared in this scope 6 | if(n>k)cout<<k*x+(n-k)*y<<endl; | ^~~~ a.cc:6:29: error: 'endl' was not declared in this scope 6 | if(n>k)cout<<k*x+(n-k)*y<<endl; | ^~~~ a.cc:7:8: error: 'cout' was not declared in this scope 7 | else cout<<k*x<<endl; | ^~~~ a.cc:7:19: error: 'endl' was not declared in this scope 7 | else cout<<k*x<<endl; | ^~~~
s735232104
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k,x,y; cin>>n>>k>>x>>y if(k<=n) cout<<(n*x)<<endl; else cout<<(k*x)+y*(n-k)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: expected ';' before 'if' 5 | cin>>n>>k>>x>>y | ^ | ; 6 | if(k<=n) cout<<(n*x)<<endl; | ~~ a.cc:7:3: error: 'else' without a previous 'if' 7 | else cout<<(k*x)+y*(n-k)<<endl; | ^~~~
s883235912
p04011
C++
#include<iostream> using namespace std; int main() { int N,K,X,Y; cin>>N>>K>>X>>Y; int answer if (K <= N) {answer = X * K + Y * (N - K);} else {answer = X * N;} cout << answer << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:2: error: expected initializer before 'if' 7 | if (K <= N) {answer = X * K + Y * (N - K);} | ^~ a.cc:8:2: error: 'else' without a previous 'if' 8 | else {answer = X * N;} | ^~~~ a.cc:8:8: error: 'answer' was not declared in this scope 8 | else {answer = X * N;} | ^~~~~~ a.cc:9:10: error: 'answer' was not declared in this scope 9 | cout << answer << endl; | ^~~~~~
s194977781
p04011
C++
#include <iostream> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; if(b<=A){cout<<(a-b)*d+b*c<<endl;} else{cout<<b*c<<endl;} return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'A' was not declared in this scope 6 | if(b<=A){cout<<(a-b)*d+b*c<<endl;} | ^
s386323038
p04011
C++
#include <iostream> using namespace std; int n; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; if(b<=A){cout<<(a-b)*d+b*c<<endl;} else{cout<<b*c<<endl;} return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'A' was not declared in this scope 7 | if(b<=A){cout<<(a-b)*d+b*c<<endl;} | ^
s479498924
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ cin>>N>>K>>X>>Y; if(N<=K){ cout<<N*X<<endl; }else{ cout<<K*X + (N-K)*Y<<endl; } }
a.cc: In function 'int main()': a.cc:5:8: error: 'N' was not declared in this scope 5 | cin>>N>>K>>X>>Y; | ^ a.cc:5:11: error: 'K' was not declared in this scope 5 | cin>>N>>K>>X>>Y; | ^ a.cc:5:14: error: 'X' was not declared in this scope 5 | cin>>N>>K>>X>>Y; | ^ a.cc:5:17: error: 'Y' was not declared in this scope 5 | cin>>N>>K>>X>>Y; | ^
s419369727
p04011
Java
package aproblems; import java.util.Scanner; public class ABC044 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int K = scan.nextInt(); int X = scan.nextInt(); int Y = scan.nextInt(); int result = 0; if (N>K) { result = X*K; result += Y*(N-K); } else { result = X*N; } System.out.println(result); } }
Main.java:4: error: class ABC044 is public, should be declared in a file named ABC044.java public class ABC044 { ^ 1 error
s664114114
p04011
C++
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<string> #include<iomanip> using namespace std; int main() { int n,k,x,y; cin>>n>>k>>x>>y; if(n>k) { m=k*x+(n-k)*y; } else { m=n*x; } cout<<m<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: 'm' was not declared in this scope 14 | m=k*x+(n-k)*y; | ^ a.cc:18:17: error: 'm' was not declared in this scope 18 | m=n*x; | ^ a.cc:20:15: error: 'm' was not declared in this scope 20 | cout<<m<<endl; | ^
s089037718
p04011
C++
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<string> #include<iomanip> using namespace std; int main() { int n,k,x,y; cin>>n>>k>>x>>y; if(n>k) { m=k*x+(n-k)*y; } else { m=n*x; } cout<<m<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: 'm' was not declared in this scope 14 | m=k*x+(n-k)*y; | ^ a.cc:18:17: error: 'm' was not declared in this scope 18 | m=n*x; | ^ a.cc:20:15: error: 'm' was not declared in this scope 20 | cout<<m<<endl; | ^
s930641398
p04011
C
#include<bits/stdc++.h> using namespace std; int main() { int n=0,K=0,X=0,Y=0; cin>>n>>K>>X>>Y; if(n < K) cout<<X*n<<endl; else cout<<X*K+(n-K)*Y<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s487798033
p04011
C
#include <bits/stdc++.h> using namespace std; int main() { int n,k,x,y,m,z; cin>>n>>k>>x>>y; m=k*x+(n-k)*y; z=n*x; if(n>k)cout<<m<<endl; else cout<<z<<endl; return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s950921147
p04011
C++
N = int(input()) K = int(input()) X = int(input()) Y = int(input()) total = 0 for i in range(N): if i <= (K - 1): total += X else: total += Y print(total)
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s744349955
p04011
C
#include <stdio.h> int main() { int N,K,X,Y,s,i; long long int X,Y,s; scanf("%d %d %lld %lld",&N,&K,&X,&Y); s=K*X+(N-K)*Y; printf("%lld\n",s); return 0; }
main.c: In function 'main': main.c:6:18: error: conflicting types for 'X'; have 'long long int' 6 | long long int X,Y,s; | ^ main.c:5:12: note: previous declaration of 'X' with type 'int' 5 | int N,K,X,Y,s,i; | ^ main.c:6:20: error: conflicting types for 'Y'; have 'long long int' 6 | long long int X,Y,s; | ^ main.c:5:14: note: previous declaration of 'Y' with type 'int' 5 | int N,K,X,Y,s,i; | ^ main.c:6:22: error: conflicting types for 's'; have 'long long int' 6 | long long int X,Y,s; | ^ main.c:5:16: note: previous declaration of 's' with type 'int' 5 | int N,K,X,Y,s,i; | ^
s533795469
p04011
C++
#include <iostream> using std::cin; using std::cout; using std::endl; int main () { int n, k, x, y; cin << n; cin << k; cin << x; cin << y; if (n - k > 0) { cout << k * x + (n - k) * y << endl; } else { cout << k * x << endl; } }
a.cc: In function 'int main()': a.cc:11:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 11 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:11:7: note: candidate: 'operator<<(int, int)' (built-in) 11 | cin << n; | ~~~~^~~~ a.cc:11:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' 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:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin << n; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:11:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 11 | cin << n; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin << n; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:11:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin << n; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:11:10: required from here 11 | cin << n; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:12:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 12 | cin << k; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:12:7: note: candidate: 'operator<<(int, int)' (built-in) 12 | cin << k; | ~~~~^~~~ a.cc:12:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 |
s579960699
p04011
C++
#include<iostream> using namespace std; int n; int main(){ cin>>n>>k>>x>>y; int ans=0; for(i=1;i<=n;i++){ if(i<=k)ans+=x; else ans+=y; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:13: error: 'k' was not declared in this scope 7 | cin>>n>>k>>x>>y; | ^ a.cc:7:16: error: 'x' was not declared in this scope 7 | cin>>n>>k>>x>>y; | ^ a.cc:7:19: error: 'y' was not declared in this scope 7 | cin>>n>>k>>x>>y; | ^ a.cc:9:9: error: 'i' was not declared in this scope 9 | for(i=1;i<=n;i++){ | ^
s777451872
p04011
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(),k = sc.nextInt(),x = sc.nextInt(),y = sc.nextInt(); System.out.println(n < k ? n * x : k * x + ((n-k) * y)); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s723145852
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ string a; cin >> a; int arr[1000]; memset(arr,0,sizeof(arr)); for(int i=0;i<a.size();i++){ arr[(int)a[i]]++; } int c=0; for (int i=’a’;i<=’z’,i++){ if(arr[i]%2!=0) c++; } if (c!=0) cout << ’No’ <<endl; else cout << ’Yes’ << endl; }
a.cc:13:16: error: extended character ’ is not valid in an identifier 13 | for (int i=’a’;i<=’z’,i++){ | ^ a.cc:13:16: error: extended character ’ is not valid in an identifier a.cc:13:23: error: extended character ’ is not valid in an identifier 13 | for (int i=’a’;i<=’z’,i++){ | ^ a.cc:13:23: error: extended character ’ is not valid in an identifier a.cc:16:23: error: extended character ’ is not valid in an identifier 16 | if (c!=0) cout << ’No’ <<endl; | ^ a.cc:16:23: error: extended character ’ is not valid in an identifier a.cc:17:18: error: extended character ’ is not valid in an identifier 17 | else cout << ’Yes’ << endl; | ^ a.cc:17:18: error: extended character ’ is not valid in an identifier a.cc: In function 'int main()': a.cc:13:16: error: '\U00002019a\U00002019' was not declared in this scope 13 | for (int i=’a’;i<=’z’,i++){ | ^~~ a.cc:13:23: error: '\U00002019z\U00002019' was not declared in this scope 13 | for (int i=’a’;i<=’z’,i++){ | ^~~ a.cc:13:30: error: expected ';' before ')' token 13 | for (int i=’a’;i<=’z’,i++){ | ^ | ; a.cc:16:23: error: '\U00002019No\U00002019' was not declared in this scope 16 | if (c!=0) cout << ’No’ <<endl; | ^~~~ a.cc:17:18: error: '\U00002019Yes\U00002019' was not declared in this scope 17 | else cout << ’Yes’ << endl; | ^~~~~
s603743815
p04011
C++
#include<iostream> #include<cmath> uisng namespace std; int main() { int N,K,X,Y;cin>>N>>K>>X>>Y; cout<<X*min(N,K)+Y*max(N-K,0)<<endl; return 0; }
a.cc:3:1: error: 'uisng' does not name a type 3 | uisng namespace std; | ^~~~~ a.cc: In function 'int main()': a.cc:6:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | int N,K,X,Y;cin>>N>>K>>X>>Y; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<X*min(N,K)+Y*max(N-K,0)<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:11: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout<<X*min(N,K)+Y*max(N-K,0)<<endl; | ^~~ | std::min 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: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:7:22: error: 'max' was not declared in this scope; did you mean 'std::max'? 7 | cout<<X*min(N,K)+Y*max(N-K,0)<<endl; | ^~~ | std::max /usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:7:34: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<X*min(N,K)+Y*max(N-K,0)<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s617422430
p04011
C++
#include <iostream> int main(void){ int n,k,l,x,y; cin >> n >> k >> x >> y; n = n>k? n-k: 0; cout << (k*x+n*y) << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n >> k >> x >> y; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | cout << (k*x+n*y) << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:8:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | cout << (k*x+n*y) << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s441813783
p04011
C++
#include <iostream> #include <math.h> using namespace std; const int Nmax = 50; const int Amax = 50; const int Xmax = 50; long dp[Nmax+1][Nmax+1][Nmax*Xmax+1] = {}; long xarr[Xmax]; int main() { long N,A; cin >> N >> A; for (int i = 0; i < N; i++) cin >> xarr[i]; // end input long m = (long)max(A, *max_element(xarr, xarr+N)); for (int j = 0; j <= N; j++) { for (int k = 0; k <= N; k++) { for (int s = 0; s <= m*N; s++) { long tmp = 0; if (j == 0 && k == 0 && s == 0) { tmp = 1; } else if (j >= 1 && s < xarr[j-1]) { tmp = dp[j-1][k][s]; } else if (j >= 1 && k >= 1 && s >= xarr[j-1]) { tmp = dp[j-1][k][s] + dp[j-1][k-1][s-xarr[j-1]]; } dp[j][k][s] = tmp; } } } long sum = 0; for (int i = 1; i <= N; i++) sum += dp[N][i][i*A]; cout << sum << "\n=="<<endl; // for (int i = 0; i < m*N; i++) cout << dp[N-1][i][i*A] << endl; }
a.cc: In function 'int main()': a.cc:20:26: error: 'max_element' was not declared in this scope 20 | long m = (long)max(A, *max_element(xarr, xarr+N)); | ^~~~~~~~~~~
s337523497
p04011
C++
n = int(input()) k = int(input()) x = int(input()) y = int(input()) sum = 0 for i in range(n): if i < k: sum += x else: sum += y print(sum)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s112199703
p04011
C++
using System; class A { public static void Main() { var n = int.Parse(Console.ReadLine()); var k = int.Parse(Console.ReadLine()); var x = int.Parse(Console.ReadLine()); var y = int.Parse(Console.ReadLine()); Console.WriteLine(n < k ? n * x : k * x + (n - k) * y); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:4:11: error: expected ':' before 'static' 4 | public static void Main() { | ^~~~~~~ | : a.cc:11:2: error: expected ';' after class definition 11 | } | ^ | ; a.cc: In static member function 'static void A::Main()': a.cc:5:9: error: 'var' was not declared in this scope 5 | var n = int.Parse(Console.ReadLine()); | ^~~ a.cc:6:13: error: expected ';' before 'k' 6 | var k = int.Parse(Console.ReadLine()); | ^ a.cc:7:13: error: expected ';' before 'x' 7 | var x = int.Parse(Console.ReadLine()); | ^ a.cc:8:13: error: expected ';' before 'y' 8 | var y = int.Parse(Console.ReadLine()); | ^ a.cc:9:9: error: 'Console' was not declared in this scope 9 | Console.WriteLine(n < k ? n * x : k * x + (n - k) * y); | ^~~~~~~ a.cc:9:27: error: 'n' was not declared in this scope 9 | Console.WriteLine(n < k ? n * x : k * x + (n - k) * y); | ^ a.cc:9:31: error: 'k' was not declared in this scope 9 | Console.WriteLine(n < k ? n * x : k * x + (n - k) * y); | ^ a.cc:9:39: error: 'x' was not declared in this scope 9 | Console.WriteLine(n < k ? n * x : k * x + (n - k) * y); | ^ a.cc:9:61: error: 'y' was not declared in this scope 9 | Console.WriteLine(n < k ? n * x : k * x + (n - k) * y); | ^
s896430765
p04011
C++
#include<iostream> using namespace std; int main(void) int n, k, x, y; cin >> n >> k >> x >> y; if (n > k ) cout << k*x+(n-k)*y << endl; else cout << n*x << endl; }
a.cc:5:3: error: expected initializer before 'int' 5 | int n, k, x, y; | ^~~ a.cc:6:9: error: 'cin' does not name a type 6 | cin >> n >> k >> x >> y; | ^~~ a.cc:8:4: error: expected unqualified-id before 'if' 8 | if (n > k ) cout << k*x+(n-k)*y << endl; | ^~ a.cc:9:9: error: expected unqualified-id before 'else' 9 | else cout << n*x << endl; | ^~~~ a.cc:10:1: error: expected declaration before '}' token 10 | } | ^
s534824214
p04011
C++
#include <iostream> int main() { int N, K, X, Y; std::cin >> N; std::cin >> K; std::cin >> X; std::cin >> Y; if (N >= K) { int ans = K * X + (N - K) * Y; std::cout << ans <<std::endl; } else { int ans = N * X; std::cout << ans <<std::endl; return 0; }
a.cc: In function 'int main()': a.cc:18:7: error: expected '}' at end of input 18 | } | ^ a.cc:2:17: note: to match this '{' 2 | int main() { | ^
s221091546
p04011
C++
#include <iostream> int main() { int N, K, X, Y; std::cout >> N; std::cout >> K; std::cout >> X; std::cout >> Y; int ans = K * X + (N - K) * Y; std::cout << ans <<std::endl; return 0; }
a.cc: In function 'int main()': a.cc:4:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 4 | std::cout >> N; | ~~~~~~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:4:14: note: candidate: 'operator>>(int, int)' (built-in) 4 | std::cout >> N; | ~~~~~~~~~~^~~~ a.cc:4:14: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, 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/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 4 | std::cout >> N; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:4:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 4 | std::cout >> N; | ~~~~~^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:4:17: required from here 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:5:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 5 | std::cout >> K; | ~~~~~~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:5:14: note: candidate: 'operator>>(int, int)' (built-in) 5 | std::cout >> K; | ~~~~~~~~~~^~~~ a.cc:5:14: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:5:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 5 | std::cout >> K; | ~~~~~^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'tem
s357434800
p04011
C++
#include <iostream> int main() { int N, K, X, Y; std::cout >> N; std::cout >> K; std::cout >> X; std::cout >> Y; int ans = K * X + (N - K) * Y; std::cout << ans <<std::endl; return 0; }
a.cc: In function 'int main()': a.cc:4:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 4 | std::cout >> N; | ~~~~~~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:4:14: note: candidate: 'operator>>(int, int)' (built-in) 4 | std::cout >> N; | ~~~~~~~~~~^~~~ a.cc:4:14: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, 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/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 4 | std::cout >> N; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:4:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 4 | std::cout >> N; | ~~~~~^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:4:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:4:17: required from here 4 | std::cout >> N; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:5:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 5 | std::cout >> K; | ~~~~~~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:5:14: note: candidate: 'operator>>(int, int)' (built-in) 5 | std::cout >> K; | ~~~~~~~~~~^~~~ a.cc:5:14: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:5:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 5 | std::cout >> K; | ~~~~~^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:5:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 5 | std::cout >> K; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'tem
s837525540
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K, X, Y if (N <= K) { cout << N * X << endl; } else { cout << N * Y << endl; } }
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'if' 6 | if (N <= K) { | ^~ a.cc:9:3: error: 'else' without a previous 'if' 9 | else { | ^~~~ a.cc:10:17: error: 'Y' was not declared in this scope 10 | cout << N * Y << endl; | ^
s172187959
p04011
C++
#include <iostream> using namespace std; int main(){ int n, k, x, y, a; cin >> n >> k >> x >> y; if (k >= n){ cout << n * x << endl; }else{ k - n = a; cout << (a * y) + (n * x) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: lvalue required as left operand of assignment 9 | k - n = a; | ~~^~~
s112644425
p04011
C++
#include <iostream> using namespace std; int main(){ int n, k, x, y, a; cin >> n >> k >> x >> y; if (k > n){ cout << n * x << endl; }else{ k - n = a; cout << a * y + n * x << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: lvalue required as left operand of assignment 9 | k - n = a; | ~~^~~
s549850672
p04011
C++
#include<iostream> using namespace std; int main () { int N,K,X,Y; cin>>N>>K>>X>>Y; cout<<K*X+(N-K)*Y<<endl; return 0 }
a.cc: In function 'int main()': a.cc:10:11: error: expected ';' before '}' token 10 | return 0 | ^ | ; 11 | 12 | } | ~
s147285128
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K, X, Y; cin << N << K << X << Y; int a; a = N * X; if (N > K) a = a + (N - K) * Y; }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << N << K << X << Y; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operator<<(int, int)' (built-in) 6 | cin << N << K << X << Y; | ~~~~^~~~ a.cc:6:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<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:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:6:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 6 | cin << N << K << X << Y; | ^~~ 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:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ 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: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin << N << K << X << Y; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<c
s413595818
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,pay; cin>>a>>b>>c>>d; if(a<=b){ pay=a*c; } else{ pay=b*c+(a-b)*d } cout<<pay<<endl; }
a.cc: In function 'int main()': a.cc:11:20: error: expected ';' before '}' token 11 | pay=b*c+(a-b)*d | ^ | ; 12 | } | ~
s291886640
p04011
C
#include<stdio.h> int main() int N,K,X,Y; scanf("%d",&N) }
main.c: In function 'main': main.c:4:5: error: expected declaration specifiers before 'scanf' 4 | scanf("%d",&N) | ^~~~~ main.c:3:15: error: declaration for parameter 'Y' but no such parameter 3 | int N,K,X,Y; | ^ main.c:3:13: error: declaration for parameter 'X' but no such parameter 3 | int N,K,X,Y; | ^ main.c:3:11: error: declaration for parameter 'K' but no such parameter 3 | int N,K,X,Y; | ^ main.c:3:9: error: declaration for parameter 'N' but no such parameter 3 | int N,K,X,Y; | ^ main.c:7: error: expected '{' at end of input
s868999589
p04011
C
#include<stdio.h> main() { int i,j,k,l,h,p,f,a; scanf("%d", &i); scanf("%d", &j); scanf("%d", &l); scanf("%d", &h); p=i*l; f=j*h; a=(p+f); printf("The accmodation fee is as follows: \n %d Eor 1st night\n %d For the 2nd night \n Thus in total=%d", p,f,a); } #include<stdio.h> main() { int i,j,k,l,h,p,f,a; scanf("%d", &i); scanf("%d", &j); scanf("%d", &l); scanf("%d", &h); p=i*l; f=j*h; a=(p+f); printf("The accmodation fee is as follows: \n %d Eor 1st night\n %d For the 2nd night \n Thus in total=%d", p,f,a); }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main() | ^~~~ main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int] 15 | main() | ^~~~ main.c:15:1: error: redefinition of 'main' main.c:2:1: note: previous definition of 'main' with type 'int()' 2 | main() | ^~~~